Archive: Finish Page


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


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:


;--------------------------------

;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.

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..


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.


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...


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:


"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=$PLUGINSDIRfinish.bmp "${NSISDIR}\\Contrib\\Graphics\\Wizard\\orange-nsis.bmp"
>FunctionEnd

>Function nsDialogsFinish

nsDialogs
::Create 1044
Pop $DIALOG

${NSD_CreateBitmap} 0 0 109u 193u ""
Pop $IMAGECTL

StrCpy$0 $PLUGINSDIRfinish.bmp
${NSD_SetImage} $IMAGECTL $0 $IMAGE

${NSD_CreateLabel} 120u 10u -130u 20u "Finish!"
Pop $HEADLINE

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

nsDialogs::Show

${NSD_FreeImage} $IMAGE

FunctionEnd

Section
SectionEnd
>

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..


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:


"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"
!insertmacro ForEachImage AddImage
FunctionEnd

>Function nsDialogsFinish
Push$0
Push$1

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

${NSD_CreateBitmap} 0 0 165 315 ""
Pop $0

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

; 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
>

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...


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


Thanks for the reply ,will do in our code and will see the
result , i think it is surely a awesome help .


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


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.


Also make sure you have included MUI2.nsh rather than MUI.nsh.

Stu