- NSIS Discussion
- Create custom finish page
Archive: Create custom finish page
M. Ratz
5th March 2008 11:44 UTC
Create custom finish page
hi @ all
I have to create a finish page with a label or text/list-box where the things I have installed are listed. I assumed that with rect = 1040 I can create welcome/finish-pages (as it is said in nsDialogs help) where the welcome-bitmap on the left side is already set. But instead of that I get a page where neither my controls are shown nor the welcome-bitmap
please help me
thx in advance
pospec
5th March 2008 12:34 UTC
I see there that "bla" button, what's wrong?
M. Ratz
5th March 2008 12:41 UTC
I'm sorry i attached wrong file :rolleyes:
pospec
5th March 2008 12:52 UTC
(copy-paste from Docs)
Create
nsDialogs::Create /NOUNLOAD rect
Creates a new dialog. rect specific the identifier of the control whose location will be mimiced. This should usually be 1018, which is control mimiced for creation of built-in pages. The Modern UI also has control 1040 for the welcome and the finish page.
Returns the new dialog's HWND on the stack or error.
M. Ratz
5th March 2008 13:20 UTC
I have already read the nsDialogs help.
When i take "1018" as rect everything is good, but the welcome-picture is not shown. Changing rect into "1040" I get only the blank page.
pospec
5th March 2008 13:30 UTC
You are mixing basic UI and MUI...
M. Ratz
6th March 2008 08:39 UTC
Hello
i now changed the pages included to MUI format but it's still the same. so please tell me: what am I doing wrong.
pospec
7th March 2008 07:09 UTC
I'm using 1018 all the time and it's :up:
M. Ratz
7th March 2008 09:04 UTC
good morning pospec
when using 1018 i only get a page, as they are before instfiles-dialog. what I wnat is a finish-page-looking page as it is given in the image. tell me plz how I can create such a page
M. Ratz
7th March 2008 09:06 UTC
forgot the image
here is it
Afrow UK
7th March 2008 16:08 UTC
Use Page Custom ....
Stu
greatguns
19th June 2009 11:07 UTC
Originally posted by Afrow UK
Use Page Custom ....
Stu
I have the same problem. Page Custom does not help with creating a specific page.
Page custom AbortedInstall
Function AbortedInstall
!ifdef AbortInstall
Abort
!endif
nsDialogs::Create /NOUNLOAD 1040
Pop $Dialog
${If} $Dialog == error
Abort
${EndIf}
!insertmacro MUI_HEADER_TEXT "Installation Aborted" "Product was not installed."
${NSD_CreateLabel} 0 0 100% 16u \
"Click Finish to exit the wizard."
nsDialogs::Show
FunctionEnd
I want the page to look like the finish page but i get the normal nsis page.
I can put in all the code from the finish.nsh file in here, to make the page to show up right.....but that does not seem right.
Afrow UK
20th June 2009 16:37 UTC
Do you have to recreate the entire finish page? If you only need to add a control or two you can do so without recreating the dialog.
Stu
greatguns
20th June 2009 22:55 UTC
Originally posted by Afrow UK
Do you have to recreate the entire finish page? If you only need to add a control or two you can do so without recreating the dialog.
Stu
Thanks for the reply stu.
Here is a mockup of exactly what i need.
I want to define this page such that if anyone clicks cancel on any of the wizard pages i need to redirect them to this custom abort page.
As for your question, i need to recreate the entire page as this is a single custom page, which gets shown on abort.
I am not sure what you mean by "do you have to recreate the entire finish page"
sergforce
21st June 2009 13:13 UTC
Originally posted by greatguns
Thanks for the reply stu.
I want to define this page such that if anyone clicks cancel on any of the wizard pages i need to redirect them to this custom abort page.
Could you explain how you made it? I'm trying to do such things. And your last attachment looks great. How did you create it?
demiller9
21st June 2009 14:40 UTC
I did a similar 'not finished' page for one of my installers (but based upon a condition I detect in .onInit, not upon the Cancel button). I added logic in the 'pre' functions for each page to abort them, letting the installer go directly to the finish page. I customized the text on the page to announce that the software was not installed and they read it and press 'Finish' to close the program.
!define MUI_PAGE_CUSTOMFUNCTION_PRE SccVerErrPre
!insertmacro MUI_PAGE_WELCOME
!ifdef LICENSE_TXT
!define MUI_PAGE_CUSTOMFUNCTION_PRE SccVerErrPre
!insertmacro MUI_PAGE_LICENSE "${LICENSE_TXT}"
!endif
!define MUI_PAGE_CUSTOMFUNCTION_PRE SccVerErrPre
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_TEXT $FinishText
!define MUI_FINISHPAGE_TITLE $FinishTitle
!insertmacro MUI_PAGE_FINISH
function SccVerErrPre
${If} $SccVerError <> 0
${OrIf} $OlhVerError <> 0
Abort
${EndIf}
functionEnd
$FinishText and $FinishTitle are variables that I build up to tell them it wasn't installed and why.
Don
greatguns
21st June 2009 22:10 UTC
Originally posted by demiller9
I did a similar 'not finished' page for one of my installers (but based upon a condition I detect in .onInit, not upon the Cancel button). I added logic in the 'pre' functions for each page to abort them, letting the installer go directly to the finish page. I customized the text on the page to announce that the software was not installed and they read it and press 'Finish' to close the program.
!define MUI_PAGE_CUSTOMFUNCTION_PRE SccVerErrPre
!insertmacro MUI_PAGE_WELCOME
!ifdef LICENSE_TXT
!define MUI_PAGE_CUSTOMFUNCTION_PRE SccVerErrPre
!insertmacro MUI_PAGE_LICENSE "${LICENSE_TXT}"
!endif
!define MUI_PAGE_CUSTOMFUNCTION_PRE SccVerErrPre
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_TEXT $FinishText
!define MUI_FINISHPAGE_TITLE $FinishTitle
!insertmacro MUI_PAGE_FINISH
function SccVerErrPre
${If} $SccVerError <> 0
${OrIf} $OlhVerError <> 0
Abort
${EndIf}
functionEnd
$FinishText and $FinishTitle are variables that I build up to tell them it wasn't installed and why.
Don
I thought of doing the same thing, but add a pre function to each of the pages and redirecting to the finish page and then customizing the finish page messages seems a very round about way of achieving this.
I hope there is a better way to get the custom finish page.
greatguns
21st June 2009 22:22 UTC
Originally posted by sergforce
Could you explain how you made it? I'm trying to do such things. And your last attachment looks great. How did you create it?
well that was a mockup of how i want the page to look.
I can tell you how i disabled the buttons and made that page to show up when you click cancel, but i don't know how to make that page appear just like that.
Var /Global AbortInstall
!define MUI_CUSTOMFUNCTION_ABORT CancelInstall
;Makes NSIS to go to a specified page relatively from the current page
;See http://nsis.sourceforge.net/Go_to_a_NSIS_page
Function RelGotoPage
IntCmp $R9 0 0 Move Move
StrCmp $R9 "X" 0 Move
StrCpy $R9 "120"
Move:
SendMessage $HWNDPARENT "0x408" "$R9" ""
FunctionEnd
Function CancelInstall
StrCpy $AbortInstall "true" ;We specify that we are aborting the installation
StrCpy $R9 1
Call RelGotoPage
Abort
FunctionEnd
!macro DisableBackCancelAndFinishButton
SendMessage $mui.Button.Back ${WM_SETTEXT} 0 "STR:$(^BackBtn)"
ShowWindow $mui.Button.Back ${SW_SHOW}
EnableWindow $mui.Button.Back 0
SendMessage $mui.Button.Cancel ${WM_SETTEXT} 0 "STR:$(^CancelBtn)"
ShowWindow $mui.Button.Cancel ${SW_SHOW}
EnableWindow $mui.Button.Cancel 0
SendMessage $mui.Button.Next ${WM_SETTEXT} 0 "STR:Finish"
ShowWindow $mui.Button.Next ${SW_SHOW}
EnableWindow $mui.Button.Next 1
!macroend
It has more functions, but this is how it works.
sergforce
22nd June 2009 19:01 UTC
demiller9, greatguns Thanks! It works :)
I thought there was a special macros or function to go to the finish page silently. Aborting each page wasn't obvious to me. Maybe because I've just started using NSIS. I think it wouldn't be bad to place this recipe on the tutorials wiki page.
greatguns
22nd June 2009 19:35 UTC
Originally posted by sergforce
demiller9, greatguns Thanks! It works :)
I thought there was a special macros or function to go to the finish page silently. Aborting each page wasn't obvious to me. Maybe because I've just started using NSIS. I think it wouldn't be bad to place this recipe on the tutorials wiki page.
Aborting each page is a very bad way of going to the finish page.(atleast i think so)
Ideally, what we want to do is in the custom abort function
Function CancelInstall
StrCpy $AbortInstall "true" ;We specify that we are aborting the installation
StrCpy $R9 1
Call
AbortPage ; we specify a specific abort page
Abort
FunctionEnd
This way anytime a person clicks cancel we will redirect them to the abort page instead of aborting the installation in each page.
But i could not get the RelGotoPage function to go to a specified page(it always goes to a relative page from the current page). I think there is a way to do this.....just need to find it :)
greatguns
23rd June 2009 21:50 UTC
ideas anyone??
Still can't figure out how to create a "Welcome"/"finish" dialog using nsDialogs.