2002-11-01 20:45:53 +00:00
|
|
|
;NSIS Modern User Interface version 1.4
|
2002-11-03 00:01:40 +00:00
|
|
|
;Install Options Example Script
|
2002-09-20 23:02:38 +00:00
|
|
|
;Written by Joost Verburg
|
|
|
|
|
|
|
|
!define NAME "Test Software" ;Define your own software name here
|
|
|
|
!define VERSION "1.0" ;Define your own software version here
|
|
|
|
|
2002-10-26 21:51:39 +00:00
|
|
|
!include "${NSISDIR}\Contrib\Modern UI\System.nsh"
|
2002-09-20 23:02:38 +00:00
|
|
|
|
|
|
|
;--------------------------------
|
2002-09-22 13:33:53 +00:00
|
|
|
;Configuration
|
2002-10-26 22:09:54 +00:00
|
|
|
|
2002-10-13 18:25:07 +00:00
|
|
|
!define MUI_INSTALLOPTIONS
|
|
|
|
|
2002-10-08 09:29:03 +00:00
|
|
|
!define MUI_LICENSEPAGE
|
2002-11-01 20:45:53 +00:00
|
|
|
!define MUI_COMPONENTSPAGE
|
|
|
|
!define MUI_DIRECTORYPAGE
|
2002-10-13 18:28:38 +00:00
|
|
|
!define MUI_ABORTWARNING
|
2002-10-08 09:29:03 +00:00
|
|
|
!define MUI_UNINSTALLER
|
2002-10-26 12:25:02 +00:00
|
|
|
|
2002-10-26 22:09:54 +00:00
|
|
|
!define TEMP1 $R0
|
2002-10-08 09:29:03 +00:00
|
|
|
|
2002-10-07 19:59:01 +00:00
|
|
|
;Language
|
|
|
|
;English
|
|
|
|
LoadLanguageFile "${NSISDIR}\Contrib\Language files\English.nlf"
|
2002-10-12 15:57:47 +00:00
|
|
|
!include "${NSISDIR}\Contrib\Modern UI\Language files\English.nsh"
|
2002-10-07 19:59:01 +00:00
|
|
|
|
2002-09-20 23:02:38 +00:00
|
|
|
;General
|
|
|
|
OutFile "InstallOptions.exe"
|
2002-11-01 20:45:53 +00:00
|
|
|
Name "${NAME} ${VERSION}"
|
|
|
|
|
2002-11-02 23:06:46 +00:00
|
|
|
;Page order
|
2002-11-03 12:50:06 +00:00
|
|
|
!define MUI_CUSTOMPAGECOMMANDS
|
2002-11-03 00:01:40 +00:00
|
|
|
!insertmacro MUI_PAGECOMMAND_LICENSE
|
2002-11-01 20:45:53 +00:00
|
|
|
Page custom SetCustomA
|
|
|
|
Page custom SetCustomB
|
2002-11-03 00:01:40 +00:00
|
|
|
!insertmacro MUI_PAGECOMMAND_COMPONENTS
|
|
|
|
!insertmacro MUI_PAGECOMMAND_DIRECTORY
|
2002-11-01 20:45:53 +00:00
|
|
|
Page custom SetCustomC
|
2002-11-03 00:01:40 +00:00
|
|
|
!insertmacro MUI_PAGECOMMAND_INSTFILES
|
2002-09-20 23:02:38 +00:00
|
|
|
|
2002-10-26 17:39:56 +00:00
|
|
|
!insertmacro MUI_INTERFACE
|
2002-11-01 20:45:53 +00:00
|
|
|
|
2002-10-26 17:39:56 +00:00
|
|
|
;License page
|
2002-10-12 16:16:46 +00:00
|
|
|
LicenseData "${NSISDIR}\Contrib\Modern UI\License.txt"
|
2002-09-20 23:02:38 +00:00
|
|
|
|
2002-10-26 17:39:56 +00:00
|
|
|
;Component-selection page
|
2002-10-07 19:59:01 +00:00
|
|
|
;Descriptions
|
|
|
|
LangString DESC_SecCopyUI ${LANG_ENGLISH} "Copy the modern.exe file to the application folder."
|
|
|
|
LangString DESC_SecCreateUninst ${LANG_ENGLISH} "Create a uninstaller which can automatically delete ${NAME}."
|
2002-09-20 23:02:38 +00:00
|
|
|
|
2002-10-26 17:39:56 +00:00
|
|
|
;Folder-selection page
|
2002-09-20 23:02:38 +00:00
|
|
|
InstallDir "$PROGRAMFILES\${NAME}"
|
2002-10-07 19:59:01 +00:00
|
|
|
|
2002-10-26 17:39:56 +00:00
|
|
|
;Install Options pages
|
2002-11-01 20:45:53 +00:00
|
|
|
LangString TEXT_IO_TITLE ${LANG_ENGLISH} "Install Options Page"
|
|
|
|
LangString TEXT_IO_SUBTITLE ${LANG_ENGLISH} "Create your own dialog!"
|
|
|
|
|
|
|
|
;Uninstaller
|
2002-11-03 12:50:06 +00:00
|
|
|
!define MUI_UNCUSTOMPAGECOMMANDS
|
2002-11-03 00:01:40 +00:00
|
|
|
!insertmacro MUI_UNPAGECOMMAND_CONFIRM
|
|
|
|
!insertmacro MUI_UNPAGECOMMAND_INSTFILES
|
2002-10-07 19:59:01 +00:00
|
|
|
|
2002-09-22 13:33:53 +00:00
|
|
|
;Things that need to be extracted on startup (keep these lines before any File command!)
|
|
|
|
;Use ReserveFile for your own Install Options ini files too!
|
|
|
|
ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
|
2002-10-07 19:59:01 +00:00
|
|
|
ReserveFile "ioA.ini"
|
|
|
|
ReserveFile "ioB.ini"
|
|
|
|
ReserveFile "ioC.ini"
|
2002-09-22 13:33:53 +00:00
|
|
|
|
2002-09-20 23:02:38 +00:00
|
|
|
;--------------------------------
|
|
|
|
;Installer Sections
|
|
|
|
|
2002-10-07 19:59:01 +00:00
|
|
|
Function .onInit
|
|
|
|
;Init InstallOptions
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "ioA.ini"
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "ioB.ini"
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "ioC.ini"
|
2002-11-01 20:45:53 +00:00
|
|
|
;Titles for Install Options dialogs
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioA.ini" "Settings" "Title" "$(MUI_TEXT_SETUPCAPTION): Custom page A"
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioB.ini" "Settings" "Title" "$(MUI_TEXT_SETUPCAPTION): Custom page B"
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioC.ini" "Settings" "Title" "$(MUI_TEXT_SETUPCAPTION): Custom page C"
|
|
|
|
!ifdef MUI_ABORTWARNING
|
|
|
|
;Abort warnings for Install Options dialogs
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioA.ini" "Settings" "CancelConfirm" "$(MUI_TEXT_ABORTWARNING)"
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioA.ini" "Settings" "CancelConfirmCaption" "$(MUI_TEXT_SETUPCAPTION)"
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioB.ini" "Settings" "CancelConfirm" "$(MUI_TEXT_ABORTWARNING)"
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioB.ini" "Settings" "CancelConfirmCaption" "$(MUI_TEXT_SETUPCAPTION)"
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioC.ini" "Settings" "CancelConfirm" "$(MUI_TEXT_ABORTWARNING)"
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioC.ini" "Settings" "CancelConfirmCaption" "$(MUI_TEXT_SETUPCAPTION)"
|
|
|
|
!endif
|
2002-10-07 19:59:01 +00:00
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Section "modern.exe" SecCopyUI
|
2002-09-20 23:02:38 +00:00
|
|
|
|
|
|
|
;Add your stuff here
|
|
|
|
|
|
|
|
SetOutPath "$INSTDIR"
|
|
|
|
File "${NSISDIR}\Contrib\UIs\modern.exe"
|
2002-10-26 22:09:54 +00:00
|
|
|
|
|
|
|
;Read a value from an Install Options INI File
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_READ ${TEMP1} "ioC.ini" "Field 2" "State"
|
|
|
|
StrCmp ${TEMP1} "1" "" +2
|
|
|
|
;Checked
|
|
|
|
MessageBox MB_OK "A MessageBox..."
|
2002-11-03 00:01:40 +00:00
|
|
|
|
|
|
|
;Create uninstaller
|
2002-09-20 23:02:38 +00:00
|
|
|
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
|
|
|
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
Section ""
|
|
|
|
|
|
|
|
;Invisible section to display the Finish header
|
2002-10-26 12:25:02 +00:00
|
|
|
!insertmacro MUI_FINISHHEADER
|
2002-09-20 23:02:38 +00:00
|
|
|
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
;Installer Functions
|
|
|
|
|
2002-11-01 20:45:53 +00:00
|
|
|
Function SetCustomA
|
|
|
|
!insertmacro MUI_HEADER_TEXT $(TEXT_IO_TITLE) $(TEXT_IO_SUBTITLE)
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_SHOW "ioA.ini"
|
2002-09-20 23:02:38 +00:00
|
|
|
FunctionEnd
|
|
|
|
|
2002-11-01 20:45:53 +00:00
|
|
|
Function SetCustomB
|
|
|
|
!insertmacro MUI_HEADER_TEXT $(TEXT_IO_TITLE) $(TEXT_IO_SUBTITLE)
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_SHOW "ioB.ini"
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function SetCustomC
|
|
|
|
!insertmacro MUI_HEADER_TEXT $(TEXT_IO_TITLE) $(TEXT_IO_SUBTITLE)
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_SHOW "ioC.ini"
|
2002-09-20 23:02:38 +00:00
|
|
|
FunctionEnd
|
|
|
|
|
2002-11-03 12:50:06 +00:00
|
|
|
!insertmacro MUI_FUNCTIONS_BASIC
|
2002-09-20 23:02:38 +00:00
|
|
|
|
|
|
|
;--------------------------------
|
2002-11-01 20:45:53 +00:00
|
|
|
;Uninstaller
|
2002-09-20 23:02:38 +00:00
|
|
|
|
|
|
|
Section "Uninstall"
|
|
|
|
|
|
|
|
;Add your stuff here
|
|
|
|
|
|
|
|
Delete "$INSTDIR\modern.exe"
|
|
|
|
Delete "$INSTDIR\Uninstall.exe"
|
|
|
|
|
|
|
|
RMDir "$INSTDIR"
|
|
|
|
|
2002-10-26 12:25:02 +00:00
|
|
|
!insertmacro MUI_UNFINISHHEADER
|
2002-09-20 23:02:38 +00:00
|
|
|
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
;Uninstaller Functions
|
|
|
|
|
2002-11-03 12:50:06 +00:00
|
|
|
!insertmacro MUI_UNFUNCTIONS_BASIC
|
2002-09-20 23:02:38 +00:00
|
|
|
|
2002-10-07 19:59:01 +00:00
|
|
|
;eof
|