BirgO
16th July 2008 16:56 UTC
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
16th July 2008 18:06 UTC
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
16th July 2008 18:59 UTC
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
17th July 2008 10:00 UTC
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
17th July 2008 15:59 UTC
Maybe your "ValidatePassword" function is calling the "Abort" instruction for some reason, so the custom page cannot leave...
BirgO
17th July 2008 16:34 UTC
You are damn right... you remind me that cancel will also do the "ValidatePassword" function call
And again... Thanks !!!!!
LoRd_MuldeR
17th July 2008 16:51 UTC
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