Hide Back Button
Hi,
I'm trying to hide the back button when the installer is running for the 2nd time on the same system (I called it upgrade mode), on the component selection page. I successfuly disable the welcome, dir, startmenu pages so far.
What I'm trying to do is when user runs setup 2nd time, then disable all the pages except the component page, install page and finish page.
Here is how I'm doing this:
; Welcome page
!define MUI_PAGE_CUSTOMFUNCTION_PRE CheckPrev
!insertmacro MUI_PAGE_WELCOME
; License page
!define MUI_PAGE_CUSTOMFUNCTION_PRE CheckPrev
!define MUI_LICENSEPAGE_CHECKBOX
!insertmacro MUI_PAGE_LICENSE "E:\MyApp\license.txt"
; Components page
!insertmacro MUI_PAGE_COMPONENTS
; Directory page
!define MUI_PAGE_CUSTOMFUNCTION_PRE CheckPrev
!insertmacro MUI_PAGE_DIRECTORY
; Start menu page
var ICONS_GROUP
!define MUI_STARTMENUPAGE_NODISABLE
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "MyApp"
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${PRODUCT_STARTMENU_REGVAL}"
!define MUI_PAGE_CUSTOMFUNCTION_PRE CheckPrev
!insertmacro MUI_PAGE_STARTMENU Application $ICONS_GROUP
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\Readme.txt"
!insertmacro MUI_PAGE_FINISH
var IsUpgrade
; Check if new installation or upgrade...
Function .onInit
StrCpy $IsUpgrade "0"
ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString"
StrCmp $R0 "" NewInstallation
MessageBox MB_ICONQUESTION|MB_YESNO \
"$(^Name) is already present on the system: \
$\r$\nYou must update it. You cannot install it in a different folder.$\r$\n \
$\r$\nDo you want to continue the installation ?" IDYES +2
Abort
StrCpy $IsUpgrade "1"
ReadRegStr $ICONS_GROUP ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "${PRODUCT_STARTMENU_REGVAL}"
NewInstallation:
FunctionEnd
; Skip the Welcome, Dir, StartMenu page(s) if upgrade...
Function CheckPrev
StrCmp $IsUpgrade "1" "" +2
Abort
FunctionEnd
-- This is working great for correctly showing the pages of interest. But I would like to hide the "Back" button at component page also in "upgrade mode".
Please help...
Thanks,