Why is there an enabled cancel button in the finish page?
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?
Archive: Why is there an enabled cancel button in the finish page?
Why is there an enabled cancel button in the finish page?
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?
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 :D
Try adding this into an install section (preferably a last one) It will grey out the cancel button.
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "CancelEnable" "0"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "CancelShow" "0"
!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.
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "CancelEnable" "0"
!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
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "CancelShow" "0"
Originally posted by Lobo LunarThanks :-)
BTW: Welcome to the Forums tupper :D
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
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
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.
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.
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:
!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
!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
add
!define MUI_PAGE_CUSTOMFUNCTION_PRE OnShowFinish
Function OnShowFinish
GetDlgItem $R0 $HWNDPARENT 2
SendMessage $R0 ${WM_CLOSE} 0 0
FunctionEnd