Archive: Skip a page


Skip a page
I started to write a installation script for installing an application.

The first time installing the application the user should be able to select a directory.
The next time the installation should be handled as an update, so it shouldn't be able to select the install directory.

Is it possible to skip the 'directory' page in the 'update mode'?

Thanks!


If you're storing the directory path in the registry, you can check for the value in the directory page's PRE function...

!define InstallDirRegKey '"HKLM" "Software\MyApp" "InstallDir"'

InstallDirRegKey ${InstallDirRegKey}

!define MUI_PAGE_CUSTOMFUNCTION_PRE DirectoryPre
!insertmacro MUI_PAGE_DIRECTORY

Function DirectoryPre
ReadRegStr $R0 ${InstallDirRegKey}
StrCmp $R0 "" ShowDirectoryPage
IfFileExists "$R0\*.*" 0 ShowDirectoryPage
StrCpy $INSTDIR $R0
Abort ; skip Directory Page
ShowDirectoryPage:
FunctionEnd


-Stu