- NSIS Discussion
- Custom Page after abort ?
Archive: Custom Page after abort ?
IceCork
26th August 2003 22:52 UTC
Custom Page after abort ?
Could someone please tell me if it's posible (if so how ?) to call a custom page after an abort message box. I'd like to have a page that basically says Setup aborted, nothing was installed and no changes were made to the system. While the below code appears to work I'm fairly certain that it is not the correct way to go about it.
Function .onUserAbort
MessageBox MB_YESNO "The program is not completely installed on your computer.$\r$\nDo you want to abort setup ?" IDYES NoCancelAbort
Abort
NoCancelAbort:
!insertmacro MUI_HEADER_TEXT "Setup Aborted" " "
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "abort.ini"
Pop $R0
GetDlgItem $R1 $R0 1200
CreateFont $R2 "MS Sans Serif" 8 700
!insertmacro MUI_INSTALLOPTIONS_SHOW
Quit
FunctionEnd
Afrow UK
27th August 2003 00:26 UTC
That is the only way.
-Stu
deguix
27th August 2003 00:41 UTC
Give me more details, when you click YES in that MessageBox, what occurs?
IceCork
27th August 2003 06:01 UTC
After pressing Yes the custom page is displayed, however after pressing the OK button (to exit the custom page)an error message box quickly appears saying something about a corrupted installer. I don't know what the error box says exactly because it closes too quickly.
Afrow UK
27th August 2003 17:09 UTC
This is probably because the abort flag is set after the user clicks the cancel button.
Therefore you can't use this at all, unless someone adds code to allow for this.
-Stu
kichik
27th August 2003 17:15 UTC
InstallOptions can not be called outside of a page creator function. Afrow, you should know that already ;)
The best way I can think of right would be not to use Abort, skip the rest of the installation and change the finish page to show the desired message.
Afrow UK
27th August 2003 17:20 UTC
bah :)
-Stu
deguix
27th August 2003 21:34 UTC
And if you remove the Quit command of the code, what occurs?
kichik
27th August 2003 21:36 UTC
Doesn't matter. InstallOptions should not be used outside of a page's creator function.
IceCork
28th August 2003 01:32 UTC
Thanks for the help. Kichik I'm not sure if I understand what you've suggested. If I change the Finish page won't that page (with the abort messages) be shown at the succesfull completion of the install as well ?
kichik
28th August 2003 10:45 UTC
No, you only change it if the installation was aborted.