Skip to content
⌘ NSIS Forum Archive

Problem with Abort page and custom page

7 posts

BirgO#

Problem with Abort page and custom page

Hi

I have a little problem with my UltraModernUI installer.

I'm trying to add an Abort page to my installer but it always jump to my custom page instead to UMUI_PAGE_ABORT when i click on the cancel button on one of the pages.

I'm using:
!insertmacro UMUI_PAGE_ABORT 
I have one custum page (and the other built-in):
Page custom EnterPasswordPage ValidatePassword
...
Function EnterPasswordPage
  !insertmacro MUI_HEADER_TEXT "Enter Installation Password" "Enter installation password"
  
  Push $R0
  InstallOptions::initDialog /NOUNLOAD "$TEMP\Password.ini"
  Pop $R0
...
FunctionEnd 
I have WELCOME, LICENSE, COMPONENTS, myCustom, INSTFILES, FINISH pages that all of them are working perfectly but when i click on cencel in one of them myCustom page pops up.... 🙁

Done anyone know what the problem is?? please help...
Thanks.
LoRd_MuldeR#
This will solve the problem:

Page custom EnterPasswordPage ValidatePassword
...

Function EnterPasswordPage
!insertmacro UMUI_ABORT_IF_INSTALLFLAG_IS ${UMUI_CANCELLED} ; <- NEW NEW NEW

!insertmacro MUI_HEADER_TEXT "Enter Installation Password" "Enter installation password"

Push $R0
InstallOptions::initDialog /NOUNLOAD "$TEMPPassword.ini"
Pop $R0
...
FunctionEnd
It prevents you custom page from popping up after the installer was aborted 🙂
LoRd_MuldeR#
Also in UMUI you should show custom InstallOptions pages with the pre-defined macros to get correct (skinned) stlye:

; pages
...
Page custom EnterPasswordPage ValidatePassword
...
!insertmacro UMUI_PAGE_ABORT


Function .onInit
!insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "pages\my_page.ini" "my_page.ini"
FunctionEnd

Function EnterPasswordPage
!insertmacro UMUI_ABORT_IF_INSTALLFLAG_IS ${UMUI_CANCELLED}
!insertmacro MUI_HEADER_TEXT "My Page" "This my page, not yours!"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "my_page.ini"
FunctionEnd
BirgO#edited
First of all thanks a lot!!

Those changes did the job nice but now i still have a little problem when i click cancel on my custom page it doesnt jump to the abort page - the page stuck on my custom page after the click (only when i click back the installer close)

All the rest pages are just fine.

Do you know what can cause it?
LoRd_MuldeR#
Maybe your "ValidatePassword" function is calling the "Abort" instruction for some reason, so the custom page cannot leave...
BirgO#
You are damn right... you remind me that cancel will also do the "ValidatePassword" function call
And again... Thanks !!!!!
LoRd_MuldeR#
Maybe you can do it like that

Function ValidatePassword
!insertmacro UMUI_IF_INSTALLFLAG_IS ${UMUI_CANCELLED}
Goto SkipPasswordChecks
!insertmacro UMUI_ENDIF_INSTALLFLAG

; Check whether password is okay or not
; You may call ABORT here

[...]

SkipPasswordChecks:
FunctionEnd