Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Skip a page (http://forums.winamp.com/showthread.php?t=233066)

Tonnie Krijger 13th December 2005 13:40

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!

Afrow UK 13th December 2005 14:11

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

code:
!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


All times are GMT. The time now is 05:49.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.