;InstallOptions Test Script !include Sections.nsh !define TEMP1 $R0 ;Temp variable ;The name of the installer Name "Your software" ;The file to write OutFile "yourinstaller.exe" ;The default installation directory InstallDir "$PROGRAMFILES\yoursoftware" ;Settings ShowInstDetails show ;Texts on the dialogs DirText "Choose a directory" LicenseText "A license" LicenseData "yourcompany.txt" ComponentText "Choose components" ;Order of pages Page license Page custom SetCustom "" ": User name and password" Page components Page directory Page instfiles Section "-user1" user1 ; the -user1 makes it so no installation options are visible DetailPrint "user1 section" StrCmp $R9 "user1" 0 skip DetailPrint "install files" SetOutPath "$INSTDIR" ; you could change this to SetOutPath "$PROGRAMFILES\user1" It's the same as c:\Program Files\user1 File /r "user1program.exe" ; the file installed for user1 skip: SectionEnd Section "-user2" user2 ; -user2 makes it so no installation options are visible DetailPrint "user2 section" StrCmp $R9 "user2" 0 skip DetailPrint "install files" SetOutPath "$INSTDIR" ; you could change this to SetOutPath "$PROGRAMFILES\user2" It's the same as c:\Program Files\user2 File /r "user2program.exe" ; the file installed for user2 skip: SectionEnd Section "-user3" user3 ; -user3 makes it so no installation options are visible DetailPrint "user3 section" StrCmp $R9 "user3" 0 skip DetailPrint "install files" SetOutPath "$INSTDIR" ; you could change this to SetOutPath "$PROGRAMFILES\user3" It's the same as c:\Program Files\user3 File /r "user3program.exe" ; the file installed for user3 skip: SectionEnd Function .onInit StrCpy $2 0 InitPluginsDir File /oname=$PLUGINSDIR\up.ini "up.ini" FunctionEnd Function SetCustom ;Display the InstallOptions dialog Push ${TEMP1} again: InstallOptions::dialog "$PLUGINSDIR\up.ini" Pop ${TEMP1} StrCmp ${TEMP1} "success" 0 continue ReadINIStr $0 "$PLUGINSDIR\up.ini" "Field 1" "State" ReadINIStr $1 "$PLUGINSDIR\up.ini" "Field 2" "State" MessageBox MB_OK "user [$0] pass [$1]" StrCmp $0 "user1" 0 +2 StrCmp $1 "password1" continue wrong StrCmp $0 "user2" 0 +2 StrCmp $1 "password2" continue wrong StrCmp $0 "user3" 0 +2 StrCmp $1 "password3" continue wrong wrong: StrCpy $R9 "" IntOp $2 $2 + 1 StrCmp $2 3 kill MessageBox MB_OK|MB_ICONSTOP "Wrong user name and password, try again" Goto again continue: StrCpy $R9 $0 Pop ${TEMP1} Return kill: MessageBox MB_OK|MB_ICONSTOP "3 times wrong, bye!" Quit FunctionEnd