;NSIS Modern User Interface version 1.63 !define MUI_PRODUCT "Harbinger 2003 Standard Edition" !define MUI_VERSION "1.0.1.63" !include "MUI.nsh" ;-------------------------------- ;Configuration ;General OutFile "SetupHarbinger2003s.exe" ;-------------------------------- ;Modern UI Configuration !define MUI_WELCOMEPAGE !define MUI_SPECIALBITMAP "wizard01.bmp" !define MUI_CUSTOMPAGECOMMANDS !define MUI_COMPONENTSPAGE !define MUI_COMPONENTSPAGE_NODESC !define MUI_HEADERBITMAP "LT-Header.bmp" !define MUI_ICON "icon.ico" !define MUI_DIRECTORYPAGE !define MUI_CUSTOMFUNCTION_COMPONENTS_LEAVE ComponentPost !define MUI_CUSTOMFUNCTION_DIRECTORY_SHOW DirectoryShow !define MUI_CUSTOMFUNCTION_DIRECTORY_LEAVE DirectoryLeave !define MUI_FINISHPAGE !define MUI_FINISHPAGE_RUN "$2\Harbinger.exe" !define MUI_FINISHPAGE_NOREBOOTSUPPORT !define MUI_ABORTWARNING ;-------------------------------- ;Pages !insertmacro MUI_PAGECOMMAND_WELCOME !insertmacro MUI_PAGECOMMAND_COMPONENTS !insertmacro MUI_PAGECOMMAND_DIRECTORY !insertmacro MUI_PAGECOMMAND_DIRECTORY !insertmacro MUI_PAGECOMMAND_INSTFILES !insertmacro MUI_PAGECOMMAND_FINISH ;-------------------------------- ;Languages !insertmacro MUI_LANGUAGE "English" ;-------------------------------- ;Reserve Files ;Things that need to be extracted on first (keep these lines before any File command!) ;Only useful for BZIP2 compression !insertmacro MUI_RESERVEFILE_WELCOMEFINISHPAGE ;-------------------------------- ;Installer Types InstType "Full (Inc. Shortcuts)" InstType "Simple (No Shortcuts)" ;-------------------------------- ;Installer Sections Section "Program Files" SectionIn 1 2 RO SetOutPath "$2" File /oname=Harbinger.exe "Harbinger2003s.exe" File "h2003se.opt" WriteINIStr "$2\h2003se.opt" "Main" "Data" $3 ;Write DataPath to config file CreateDirectory "$3" SectionEnd SubSection /E "Shortcuts" Section "Desktop" SectionIn 1 SetOutPath "$2" SetShellVarContext all CreateShortCut "$DESKTOP\Harbinger 2003 Standard Edition.lnk" "$2\Harbinger.exe" SectionEnd Section "Start Menu" SectionIn 1 SetOutPath "$2" SetShellVarContext all CreateDirectory "$SMPROGRAMS\Harbinger" CreateShortCut "$SMPROGRAMS\Harbinger\Harbinger 2003 Standard Edition.lnk" "$2\Harbinger.exe" SectionEnd SubSectionEnd ;-------------------------------- ;Installer Functions Function .onInit ; Must set $INSTDIR here to avoid adding ${MUI_PRODUCT} to the end of the ; path when user selects a new directory using the 'Browse' button. StrCpy $INSTDIR "$PROGRAMFILES\${MUI_PRODUCT}" FunctionEnd Function ComponentPost StrCpy $9 "0" FunctionEnd Function DirectoryShow StrCmp $9 "0" AppDirectoryPage StrCmp $9 "1" DataDirectoryPage AppDirectoryPage: StrCpy $9 "1" !insertmacro MUI_INNERDIALOG_TEXT 1041 "Destination Folder" !insertmacro MUI_INNERDIALOG_TEXT 1019 "$PROGRAMFILES\${MUI_PRODUCT}\" !insertmacro MUI_INNERDIALOG_TEXT 1006 "Setup will install ${MUI_PRODUCT} in the following folder.$\r$\n$\r$\nTo install in a different folder, click Browse and select another folder. Click Next to continue." Goto EndDirectoryShow DataDirectoryPage: StrCpy $9 "2" !insertmacro MUI_HEADER_TEXT "Choose Data Location" "Choose the folder in which to install ${MUI_PRODUCT} - Data Files." !insertmacro MUI_INNERDIALOG_TEXT 1041 "Data Destination Folder" !insertmacro MUI_INNERDIALOG_TEXT 1019 "$INSTDIR\Data\" !insertmacro MUI_INNERDIALOG_TEXT 1006 "Setup will install ${MUI_PRODUCT} - Data Files in the following folder.$\r$\n$\r$\nTo install in a different folder, click Browse and select another folder. Click Install to start the installation." EndDirectoryShow: FunctionEnd Function DirectoryLeave StrCmp $9 "1" SaveInstallDir StrCmp $9 "2" SaveDatabaseDir Goto EndDirectoryLeave SaveInstallDir: StrCpy $2 $INSTDIR Goto EndDirectoryLeave SaveDatabaseDir: StrCpy $3 $INSTDIR EndDirectoryLeave: FunctionEnd Function .onVerifyInstDir ; MessageBox MB_OK "$INSTDIR" StrCpy $R1 $INSTDIR "" -1 ; MessageBox MB_OK "$R1" StrCmp $R1 "\" PathOK StrCpy $INSTDIR "$INSTDIR \" PathOK: FunctionEnd