Old 19th August 2009, 06:53   #1
shazia.parveen
Senior Member
 
Join Date: Jul 2009
Posts: 103
Finish Page

Hi,
I am making setup using NSIS and i want to add photos or images in the Finsh page. How to do that, can anyone help me..
Thanks
shazia.parveen is offline   Reply With Quote
Old 19th August 2009, 19:31   #2
f0rt
Junior Member
 
Join Date: Jul 2009
Posts: 36
If you use the Modern User Interface (MUI) then this could be achieved just by setting the MUI_WELCOMEFINISHPAGE_BITMAP define to the path of your bitmap file (recommended size: 164x314 pixels).

E. g. with Examples\Modern UI\WelcomeFinish.nsi the modification would look like:
PHP Code:
;--------------------------------
;Interface 
Settings

  
!define MUI_ABORTWARNING
  
!define MUI_WELCOMEFINISHPAGE_BITMAP your_favorite_bitmap.bmp 
For the uninstaller you would use the define MUI_UNWELCOMEFINISHPAGE_BITMAP. You might also consider the defines MUI_WELCOMEFINISHPAGE_BITMAP_NOSTRETCH and MUI_UNWELCOMEFINISHPAGE_BITMAP_NOSTRETCH.

Detailed information is available in Docs\Modern UI 2\Readme.html.
f0rt is offline   Reply With Quote
Old 24th August 2009, 07:37   #3
shazia.parveen
Senior Member
 
Join Date: Jul 2009
Posts: 103
Thanks for the reply,
i Am using Modern User Interface (MUI) for setup but by using
!define MUI_ABORTWARNING
!define MUI_WELCOMEFINISHPAGE_BITMAP our_favorite_bitmap.bmp
By this we can change welcome as well as finish page, but i want to add some images only on finish page for making Nsis set up..
shazia.parveen is offline   Reply With Quote
Old 25th August 2009, 02:45   #4
File077
Junior Member
 
Join Date: Aug 2009
Posts: 14
Simply place the define image line above the finish page macro. At that point the welcome page macro will already have been defined, and inserted, and won't use the image.
File077 is offline   Reply With Quote
Old 25th August 2009, 08:15   #5
shazia.parveen
Senior Member
 
Join Date: Jul 2009
Posts: 103
finish page (right side)

Thanks for the reply,
Sorry for some confusion, I want to display images(photos) on the right side of the finish page , suppose i want to display photos of some developer which where involved in the completion of project , and need there photos to be displayed to the right hand side of the finish page, for help i am attaching a file please go through it and help me . I want to display photos on shown area of the attached file, i.e on the right side of the file...
shazia.parveen is offline   Reply With Quote
Old 25th August 2009, 17:18   #6
f0rt
Junior Member
 
Join Date: Jul 2009
Posts: 36
If you'd like to have different images on the welcome and finish page then you have the option to define either a custom welcome or finish page.

The following example illustrate how this could be done:
PHP Code:
!include "MUI2.nsh"

OutFile "nsFinish.exe"
Name    "nsFinish"

InstallDir "$TEMPDIR"
BrandingText " "

!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
Page custom nsDialogsFinish

!insertmacro MUI_LANGUAGE English

Var DIALOG
Var HEADLINE
Var TEXT
Var IMAGECTL
Var IMAGE

Function .onInit
   InitPluginsDir
   File 
/oname=$PLUGINSDIR\\finish.bmp "${NSISDIR}\\Contrib\\Graphics\\Wizard\\orange-nsis.bmp"
FunctionEnd

Function nsDialogsFinish

   nsDialogs
::Create 1044
   Pop $DIALOG

   
${NSD_CreateBitmap0 0 109u 193u ""
   
Pop $IMAGECTL

   StrCpy 
$0 $PLUGINSDIR\\finish.bmp
   
${NSD_SetImage$IMAGECTL $0 $IMAGE

   
${NSD_CreateLabel120u 10u -130u 20u "Finish!"
   
Pop $HEADLINE

   
${NSD_CreateLabel120u 32u -130u -32u "This is the end.$\\r$\\n$\\r$\\nHit the Close button."
   
Pop $TEXT

   nsDialogs
::Show

   
${NSD_FreeImage$IMAGE

FunctionEnd

Section
SectionEnd 
f0rt is offline   Reply With Quote
Old 25th August 2009, 17:48   #7
shazia.parveen
Senior Member
 
Join Date: Jul 2009
Posts: 103
finish page (right side)

thanks very much for reply,
i have tried this code its working for the finish page left hand side , but if i need to display the image on the right side only , for more help i am attaching a file please go through it..
Attached Images
File Type: png right.png (16.1 KB, 390 views)
shazia.parveen is offline   Reply With Quote
Old 27th August 2009, 22:27   #8
f0rt
Junior Member
 
Join Date: Jul 2009
Posts: 36
The custom finish page reassembling your desired layout extensively uses nsDialogs. Therefore it is highly recommended to read and comprehend the nsDialogs documentation [Docs\nsDialogs\Readme.html].

The ${NSD_Create*} macros have the first parameters in common. These first parameters are x, y, width and height. The values for these parameters could either be given in dialog units (e.g. 120u) or pixels (e.g. 150). Consequently the controls could be freely placed.

So here is the script:

PHP Code:
!include "MUI2.nsh"

OutFile      "nsFinish.exe"
Name         "nsFinish"
InstallDir   "$TEMPDIR"
BrandingText " "

Background color
!define BG_COLOR 0xffffff 

!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
Page custom nsDialogsFinish

!insertmacro MUI_LANGUAGE English

Convenience macro to perform the same operation on several images
!macro ForEachImage MACRO
   
!insertmacro ${MACRO"nsis.bmp"
   
!insertmacro ${MACRO"orange.bmp"
!macroend

Add image file
!macro AddImage IMAGE
   File 
/oname=$PLUGINSDIR\\${IMAGE}  "${NSISDIR}\\Contrib\\Graphics\\Header\\${IMAGE}"
!macroend

; $:= first x-position to place image
Pushes image handle onto stack
!macro CreateAndSetImage IMAGE
   
${NSD_CreateBitmap} $-57 150 57 ""
   
Exch $1
   Push 
$2
   
${NSD_SetImage} $"$PLUGINSDIR\\${IMAGE}$2
   Exch
   Pop 
$1
   Exch 
$2
   IntOp 
$$160
!macroend

Release image handle
!macro FreeImage IMAGE
   Exch 
$0
   
${NSD_FreeImage} $0
   Pop 
$0
!macroend

Function .onInit
   Push 
$0
   InitPluginsDir
   File 
/oname=$PLUGINSDIR\\finish.bmp "${NSISDIR}\\Contrib\\Graphics\\Wizard\\orange-nsis.bmp"
   
!insertmacro ForEachImage AddImage
FunctionEnd

Function nsDialogsFinish
   Push 
$0
   Push 
$1

   nsDialogs
::Create 1044
   Pop 
$0
   SetCtlColors 
$"" ${BG_COLOR}

   ${
NSD_CreateBitmap0 0 165 315 ""
   
Pop $0

   
${NSD_SetImage} $0 $PLUGINSDIR\\finish.bmp $1
   Push 
$1

   
Initialize x-Position for placement of first image
   StrCpy 
$0 180
   
!insertmacro ForEachImage CreateAndSetImage
   
Image handles pushed onto stack

   
${NSD_CreateLabel120u 10u -130u 20u "Finish!"
   
Pop $0
   SetCtlColors 
$"" ${BG_COLOR}

   ${
NSD_CreateLabel120u 32u -130u -32u "This is the end.$\\r$\\n$\\r$\\nHit the Close button."
   
Pop $0
   SetCtlColors 
$"" ${BG_COLOR}

   ; 
Hide branding text control
   GetDlgItem 
$0 $HWNDPARENT 1028
   ShowWindow 
$${SW_HIDE}

   ; 
Hide separator
   GetDlgItem 
$0 $HWNDPARENT 1256
   ShowWindow 
$${SW_HIDE}

   
nsDialogs::Show

   Pop 
$0
   
${NSD_FreeImage} $0

   
Release image handles previously pushed onto stack
   
!insertmacro ForEachImage FreeImage

   Pop 
$1
   Pop 
$0
FunctionEnd

Section
SectionEnd 
f0rt is offline   Reply With Quote
Old 28th August 2009, 08:45   #9
shazia.parveen
Senior Member
 
Join Date: Jul 2009
Posts: 103
Thanks so much for the reply,
you have send me two different code after running the codes the results coming are the same, the images are not coming on the right side as i have attached the file above post, need some more help...
shazia.parveen is offline   Reply With Quote
Old 8th September 2009, 11:16   #10
dfranklin72
Junior Member
 
Join Date: Apr 2009
Posts: 44
you just need to define the second image on the wright.

have a play with this.


!include "MUI2.nsh"

OutFile "nsFinish.exe"
Name "nsFinish"
InstallDir "$TEMPDIR"
BrandingText " "

; Background color
!define BG_COLOR 0xffffff

!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
Page custom nsDialogsFinish

!insertmacro MUI_LANGUAGE English

; Convenience macro to perform the same operation on several images
!macro ForEachImage MACRO
!insertmacro ${MACRO} "nsis.bmp"
!insertmacro ${MACRO} "orange.bmp"
!macroend

; Add image file
!macro AddImage IMAGE
File /oname=$PLUGINSDIR${IMAGE} "${NSISDIR}\Contrib\Graphics\Header\${IMAGE}"
!macroend

; $0 := first x-position to place image
; Pushes image handle onto stack
!macro CreateAndSetImage IMAGE
${NSD_CreateBitmap} $0 -57 150 57 ""
Exch $1
Push $2
${NSD_SetImage} $1 "$PLUGINSDIR\${IMAGE}" $2
Exch
Pop $1
Exch $2
IntOp $0 $0 + 160
!macroend

; Release image handle
!macro FreeImage IMAGE
Exch $0
${NSD_FreeImage} $0
Pop $0
!macroend

Function .onInit
Push $0
InitPluginsDir
File /oname=$PLUGINSDIRfinish.bmp "${NSISDIR}\Contrib\Graphics\Wizard\orange-nsis.bmp"
File /oname=$PLUGINSDIRfinish2.bmp "${NSISDIR}\Contrib\Graphics\Wizard\win.bmp"
!insertmacro ForEachImage AddImage
FunctionEnd

Function nsDialogsFinish
Push $0
Push $1

nsDialogs::Create 1044
Pop $0
SetCtlColors $0 "" ${BG_COLOR}

${NSD_CreateBitmap} 0 0 30% 315 ""
Pop $0

${NSD_SetImage} $0 $PLUGINSDIRfinish.bmp $1
Push $1

${NSD_CreateBitmap} 30% 200 70% 315 ""
Pop $1

${NSD_SetImage} $1 $PLUGINSDIRfinish2.bmp $2
Push $2

; Initialize x-Position for placement of first image
StrCpy $0 180
!insertmacro ForEachImage CreateAndSetImage
; Image handles pushed onto stack

${NSD_CreateLabel} 120u 10u -130u 20u "Finish!"
Pop $0
SetCtlColors $0 "" ${BG_COLOR}

${NSD_CreateLabel} 120u 32u -130u -32u "This is the end.$\r$\n$\r$\nHit the Close button."
Pop $0
SetCtlColors $0 "" ${BG_COLOR}

; Hide branding text control
GetDlgItem $0 $HWNDPARENT 1028
ShowWindow $0 ${SW_HIDE}

; Hide separator
GetDlgItem $0 $HWNDPARENT 1256
ShowWindow $0 ${SW_HIDE}

nsDialogs::Show

Pop $0
${NSD_FreeImage} $0

; Release image handles previously pushed onto stack
!insertmacro ForEachImage FreeImage

Pop $1
Pop $0
FunctionEnd

Section
SectionEnd
dfranklin72 is offline   Reply With Quote
Old 8th September 2009, 15:25   #11
shazia.parveen
Senior Member
 
Join Date: Jul 2009
Posts: 103
Thanks for the reply ,will do in our code and will see the
result , i think it is surely a awesome help .
shazia.parveen is offline   Reply With Quote
Old 27th December 2012, 13:02   #12
Naaryan
Junior Member
 
Join Date: Dec 2012
Posts: 2
How to use NSD_Create* on Finish page

Hi,

I am trying to create hyperlink control another than the default provided by NSIS but when i use ${NSD_CreateLink} in my script. it's compiled successfully but on finish page it does not render any control even the title and sub title text.

Please suggest, How would i use ${NSD_Create* } on finish page or any alternative of this.

Your response is awaited.

Regards,
Naaryan
Naaryan is offline   Reply With Quote
Old 28th December 2012, 23:50   #13
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
The nsDialogs macros and/or commands should be used in the finish page's SHOW function. You can use pastebin to show us a (minimal) example of what you're doing, then we can maybe explain what you're doing wrong.
MSG is offline   Reply With Quote
Old 30th December 2012, 13:01   #14
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Also make sure you have included MUI2.nsh rather than MUI.nsh.

Stu
Afrow UK is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump