Why is there an enabled cancel button in the finish page?
I'm using the modern UI. Any tips on how to disable the cancel button in the finish page?
Why is there an enabled cancel button in the finish page?
14 posts
Good point.
If the installation end *succesfully*,
both cancel and finish are up.
Why noy desable one of them?
BTW: Welcome to the Forums tupper 😁
If the installation end *succesfully*,
both cancel and finish are up.
Why noy desable one of them?
BTW: Welcome to the Forums tupper 😁
Try adding this into an install section (preferably a last one) It will grey out the cancel button.
If it doesn't work, then try putting it in a custom finish page function like so:
Optionally, you could completely remove the cancel button by doing this:
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "CancelEnable" "0"
Let me know if it works.
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "CancelShow" "0"
If it doesn't work, then try putting it in a custom finish page function like so:
-Stu!insertmacro MUI_PAGECOMMAND_FINISH "CustomFinish"
Function "CustomFinish"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "CancelEnable" "0"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "CancelShow" "0"
FunctionEnd
Stu, thanks for the suggestions. I tried the suggestions, with mixed results.
The first approach (as follows) didn't affect the cancel button.
The first approach (as follows) didn't affect the cancel button.
The second approach (as follows) caused a compiler error ["MUI_PAGECOMMAND_FINISH" requires 0 parameter(s)]
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "CancelEnable" "0"
The "optionally" variant of the first approach (as follows) does work. So it seems that the installer enables / disables the buttons after the last section is completed.!insertmacro MUI_PAGECOMMAND_FINISH "CustomFinish"
Function "CustomFinish"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "CancelEnable" "0"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "CancelShow" "0"
FunctionEnd
It might be better to have the button visible but disabled (not sure...), but this will do fine! Thanks again!
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "CancelShow" "0"
Originally posted by Lobo LunarThanks :-)
BTW: Welcome to the Forums tupper 😁
Sorry, I made a typo error.
Use:
-Stu
Use:
That should work fine.
!define MUI_CUSTOMFUNCTION_FINISH_SHOW "CustomFinish"
Function "CustomFinish"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "CancelEnable" "0"
FunctionEnd
-Stu
There is a cancel button on the finish page so the user will be able to cancel seeing the readme and running your program without clicking too much.
Hmm, well I was going to test it, but the Cancel button on the Finish page is already disabled!
Not sure why your's isn't?
-Stu
Not sure why your's isn't?
-Stu
Originally posted by Afrow UKThis doesn't affect the cancel button with my installer. Even replacing "CancelEnable" with "CancelShow" makes no difference. But if I replace "CancelEnable" with "CancelShow" and MUI_CUSTOMFUNCTION_FINISH_SHOW with MUI_CUSTOMFUNCTION_FINISH_PRE, then the cancel button disappears. But your earlier suggestion (putting the code in the installation section) has the same effect and seems to be a bit simpler and more logical.
Sorry, I made a typo error.
Use:
!define MUI_CUSTOMFUNCTION_FINISH_SHOW "CustomFinish"
Function "CustomFinish"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "CancelEnable" "0"
FunctionEnd
Originally posted by kichikKichik, thanks for the explanation :-) I think I'll stick with hiding the button as pressing "Cancel" won't actually cancel (roll back) the installation.
There is a cancel button on the finish page so the user will be able to cancel seeing the readme and running your program without clicking too much.
I guess another option for me would be to add some code to change the button text (to "Stop" or "Abort" or "Close" ... ?) but I think that might be confusing for users (perhaps not if the right word was found) --- and I don't know how to do that anyway :-)
Originally posted by Afrow UKThe button seems to be automatically disabled if you don't bring up checkboxes for running the program or for viewing the read me. This agrees with Kichik's comments (that the button allows users to avoid the horrible fate of running or looking at what they just installed ;-)
Hmm, well I was going to test it, but the Cancel button on the Finish page is already disabled!
Not sure why your's isn't?
Originally posted by kichikI've something more to add --- clicking on the close box seems to have the same effect as clicking on the cancel button. Any comments about not showing the warning / confirmation window if the installation has completed? This would allow a one-click escape. (Is this easily coded in my script?)
There is a cancel button on the finish page so the user will be able to cancel seeing the readme and running your program without clicking too much.
Thanks again :-)
Hm, only thing I can suggest, is that you..
1. In a !define MUI_CUSTOMFUNCTION_FINISH_SHOW function, copy say $9 as "done" (StrCpy $9 done)
2. Make a copy of the Contrib\Modern UI\System.nsh file and paste it as a different copy. Scroll down until you get to !macro MUI_ABORTWARNING (use search)
Replace this:
-Stu
1. In a !define MUI_CUSTOMFUNCTION_FINISH_SHOW function, copy say $9 as "done" (StrCpy $9 done)
2. Make a copy of the Contrib\Modern UI\System.nsh file and paste it as a different copy. Scroll down until you get to !macro MUI_ABORTWARNING (use search)
Replace this:
With this.
!macro MUI_ABORTWARNING
!ifndef MUI_NOVERBOSE & MUI_MANUALVERBOSE
!verbose 3
!endif
;Warning when Cancel button is pressed
MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(MUI_TEXT_ABORTWARNING)" IDYES quit
Abort
quit:
!ifndef MUI_NOVERBOSE & MUI_MANUALVERBOSE
!verbose 4
!endif
!macroend
Make sure you !include that special modified system.nsh file instead of using the original one. It think that this should be added to the orig system.nsh.
!macro MUI_ABORTWARNING
!ifndef MUI_NOVERBOSE & MUI_MANUALVERBOSE
!verbose 3
!endif
;Warning when Cancel button is pressed
StrCmp $9 done quit
MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(MUI_TEXT_ABORTWARNING)" IDYES quit
Abort
quit:
!ifndef MUI_NOVERBOSE & MUI_MANUALVERBOSE
!verbose 4
!endif
!macroend
-Stu
add
!define MUI_PAGE_CUSTOMFUNCTION_PRE OnShowFinish
Function OnShowFinish
GetDlgItem $R0 $HWNDPARENT 2
SendMessage $R0 ${WM_CLOSE} 0 0
FunctionEnd
!define MUI_PAGE_CUSTOMFUNCTION_PRE OnShowFinish
Function OnShowFinish
GetDlgItem $R0 $HWNDPARENT 2
SendMessage $R0 ${WM_CLOSE} 0 0
FunctionEnd