SuperPat45/UltraModernUI

When having a custom page installed and pressing the 'Cancel' button before this page, 'Cancel' jump to custom page

Tobias-B-Besemer opened this issue · 2 comments

When there is a custom page installed and the user press the 'Cancel' button before this page is arrived, then 'Cancel' jump to the custom page instead to UMUI_PAGE_ABORT.

Sample code:
!insertmacro UMUI_PAGE_MULTILANGUAGE
!insertmacro MUI_PAGE_WELCOME
!define MUI_LICENSEPAGE_RADIOBUTTONS
!insertmacro MUI_PAGE_LICENSE "$(MUI_LICENSE)"
!insertmacro MULTIUSER_PAGE_INSTALLMODE
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro UMUI_PAGE_SETUPTYPE
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_NOAUTOCLOSE
!define MUI_FINISHPAGE_RUN "$INSTDIR\${prodname}.exe"
!define MUI_FINISHPAGE_LINK_LOCATION "${PRODURL}"
!define MUI_FINISHPAGE_NOREBOOTSUPPORT
!insertmacro MUI_PAGE_FINISH
!insertmacro UMUI_PAGE_ABORT

According documentation: You need to use the UMUI_ABORT_IF_INSTALLFLAG_IS macro with the ${UMUI_CANCELLED} flag to hide your custom pages when user cancel the installation:

Example:

Function FunctionName ;FunctionName defined with Page command
  
  !insertmacro UMUI_ABORT_IF_INSTALLFLAG_IS ${UMUI_CANCELLED}
  
  !insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)"
  !insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioFile.ini"
FunctionEnd

Sorry for bother you and thanks for your help!