2004-02-06 23:01:57 +00:00
|
|
|
;NSIS Modern User Interface version 1.70
|
2002-12-15 21:43:38 +00:00
|
|
|
;InstallOptions Example Script
|
2002-09-20 23:02:38 +00:00
|
|
|
;Written by Joost Verburg
|
|
|
|
|
2003-07-16 23:03:02 +00:00
|
|
|
;---------------------
|
2003-05-25 20:21:21 +00:00
|
|
|
;Include Modern UI
|
2002-11-04 11:19:21 +00:00
|
|
|
|
2003-06-10 19:32:00 +00:00
|
|
|
!include "MUI.nsh"
|
2002-09-20 23:02:38 +00:00
|
|
|
|
|
|
|
;--------------------------------
|
2004-02-06 23:01:57 +00:00
|
|
|
;General
|
2002-12-24 22:38:06 +00:00
|
|
|
|
2004-02-06 23:01:57 +00:00
|
|
|
;Name and file
|
|
|
|
Name "Modern UI Test 1.70"
|
2003-01-09 16:49:11 +00:00
|
|
|
OutFile "InstallOptions.exe"
|
2002-12-24 22:38:06 +00:00
|
|
|
|
2004-01-07 19:21:00 +00:00
|
|
|
;Default installation folder
|
2003-09-09 16:06:37 +00:00
|
|
|
InstallDir "$PROGRAMFILES\Modern UI Test"
|
2003-03-09 22:38:13 +00:00
|
|
|
|
2004-01-07 19:21:00 +00:00
|
|
|
;Get installation folder from registry if available
|
2003-09-09 16:06:37 +00:00
|
|
|
InstallDirRegKey HKCU "Software\Modern UI Test" ""
|
2002-12-24 22:38:06 +00:00
|
|
|
|
|
|
|
;--------------------------------
|
2003-05-25 20:21:21 +00:00
|
|
|
;Pages
|
2002-12-24 22:38:06 +00:00
|
|
|
|
2005-06-19 21:39:04 +00:00
|
|
|
!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt"
|
2003-05-25 20:21:21 +00:00
|
|
|
Page custom CustomPageA
|
|
|
|
!insertmacro MUI_PAGE_COMPONENTS
|
|
|
|
Page custom CustomPageB
|
|
|
|
!insertmacro MUI_PAGE_DIRECTORY
|
|
|
|
Page custom CustomPageC
|
|
|
|
!insertmacro MUI_PAGE_INSTFILES
|
2002-11-10 14:58:59 +00:00
|
|
|
|
2003-05-25 20:21:21 +00:00
|
|
|
!insertmacro MUI_UNPAGE_CONFIRM
|
|
|
|
!insertmacro MUI_UNPAGE_INSTFILES
|
2002-12-06 21:56:28 +00:00
|
|
|
|
2003-03-02 19:51:49 +00:00
|
|
|
;--------------------------------
|
2003-10-08 15:28:44 +00:00
|
|
|
;Interface Settings
|
2003-03-02 19:51:49 +00:00
|
|
|
|
2003-05-25 20:21:21 +00:00
|
|
|
!define MUI_ABORTWARNING
|
|
|
|
|
2002-12-24 22:38:06 +00:00
|
|
|
;--------------------------------
|
|
|
|
;Languages
|
|
|
|
|
2002-11-04 16:40:35 +00:00
|
|
|
!insertmacro MUI_LANGUAGE "English"
|
2002-12-24 22:38:06 +00:00
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
;Reserve Files
|
2002-10-07 19:59:01 +00:00
|
|
|
|
2003-10-08 15:28:44 +00:00
|
|
|
;These files should be inserted before other files in the data block
|
|
|
|
;Keep these lines before any File command
|
2004-01-07 19:21:00 +00:00
|
|
|
;Only for solid compression (by default, solid compression is enabled for BZIP2 and LZMA)
|
2002-12-24 22:38:06 +00:00
|
|
|
|
2002-10-07 19:59:01 +00:00
|
|
|
ReserveFile "ioA.ini"
|
|
|
|
ReserveFile "ioB.ini"
|
|
|
|
ReserveFile "ioC.ini"
|
2002-12-15 21:43:38 +00:00
|
|
|
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
|
2002-09-22 13:33:53 +00:00
|
|
|
|
2003-10-08 15:28:44 +00:00
|
|
|
;--------------------------------
|
|
|
|
;Variables
|
|
|
|
|
|
|
|
Var INI_VALUE
|
|
|
|
|
2002-09-20 23:02:38 +00:00
|
|
|
;--------------------------------
|
|
|
|
;Installer Sections
|
|
|
|
|
2003-06-10 19:32:00 +00:00
|
|
|
Section "Dummy Section" SecDummy
|
2002-09-20 23:02:38 +00:00
|
|
|
|
|
|
|
SetOutPath "$INSTDIR"
|
2003-06-10 19:32:00 +00:00
|
|
|
|
2004-02-06 23:01:57 +00:00
|
|
|
;ADD YOUR OWN FILES HERE...
|
2002-10-26 22:09:54 +00:00
|
|
|
|
2004-01-07 19:21:00 +00:00
|
|
|
;Store installation folder
|
2003-09-09 16:06:37 +00:00
|
|
|
WriteRegStr HKCU "Software\Modern UI Test" "" $INSTDIR
|
2003-03-09 22:38:13 +00:00
|
|
|
|
2002-11-03 00:01:40 +00:00
|
|
|
;Create uninstaller
|
2002-09-20 23:02:38 +00:00
|
|
|
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
2003-05-25 20:21:21 +00:00
|
|
|
|
|
|
|
;Read a value from an InstallOptions INI file
|
2003-10-08 15:28:44 +00:00
|
|
|
!insertmacro MUI_INSTALLOPTIONS_READ $INI_VALUE "ioC.ini" "Field 2" "State"
|
2003-05-25 20:21:21 +00:00
|
|
|
|
|
|
|
;Display a messagebox if check box was checked
|
2003-10-08 15:28:44 +00:00
|
|
|
StrCmp $INI_VALUE "1" "" +2
|
2003-05-25 20:21:21 +00:00
|
|
|
MessageBox MB_OK "You checked the check box, here is the MessageBox..."
|
2002-09-20 23:02:38 +00:00
|
|
|
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
;Installer Functions
|
|
|
|
|
2002-11-04 14:13:24 +00:00
|
|
|
Function .onInit
|
|
|
|
|
2003-05-25 20:21:21 +00:00
|
|
|
;Extract InstallOptions INI files
|
2002-11-04 14:13:24 +00:00
|
|
|
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "ioA.ini"
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "ioB.ini"
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "ioC.ini"
|
|
|
|
|
|
|
|
FunctionEnd
|
|
|
|
|
2003-05-25 20:21:21 +00:00
|
|
|
LangString TEXT_IO_TITLE ${LANG_ENGLISH} "InstallOptions page"
|
|
|
|
LangString TEXT_IO_SUBTITLE ${LANG_ENGLISH} "This is a page created using the InstallOptions plug-in."
|
|
|
|
|
|
|
|
Function CustomPageA
|
|
|
|
|
2002-11-09 17:58:22 +00:00
|
|
|
!insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)"
|
2002-11-08 21:08:27 +00:00
|
|
|
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioA.ini"
|
2003-05-25 20:21:21 +00:00
|
|
|
|
2002-09-20 23:02:38 +00:00
|
|
|
FunctionEnd
|
|
|
|
|
2003-05-25 20:21:21 +00:00
|
|
|
Function CustomPageB
|
|
|
|
|
2002-11-09 17:58:22 +00:00
|
|
|
!insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)"
|
2002-11-08 21:08:27 +00:00
|
|
|
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioB.ini"
|
2003-05-25 20:21:21 +00:00
|
|
|
|
2002-11-01 20:45:53 +00:00
|
|
|
FunctionEnd
|
|
|
|
|
2003-05-25 20:21:21 +00:00
|
|
|
Function CustomPageC
|
|
|
|
|
2002-11-09 17:58:22 +00:00
|
|
|
!insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)"
|
2002-11-08 21:08:27 +00:00
|
|
|
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioC.ini"
|
2003-05-25 20:21:21 +00:00
|
|
|
|
2002-09-20 23:02:38 +00:00
|
|
|
FunctionEnd
|
|
|
|
|
2003-05-25 20:21:21 +00:00
|
|
|
;--------------------------------
|
|
|
|
;Descriptions
|
|
|
|
|
2004-01-07 19:21:00 +00:00
|
|
|
;Language strings
|
2003-06-10 19:32:00 +00:00
|
|
|
LangString DESC_SecDummy ${LANG_ENGLISH} "A test section."
|
2003-05-25 20:21:21 +00:00
|
|
|
|
2004-01-07 19:21:00 +00:00
|
|
|
;Assign language strings to sections
|
2003-09-04 18:42:21 +00:00
|
|
|
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
2003-06-10 19:32:00 +00:00
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)
|
2003-09-04 18:42:21 +00:00
|
|
|
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
2003-05-25 20:21:21 +00:00
|
|
|
|
2002-09-20 23:02:38 +00:00
|
|
|
;--------------------------------
|
2002-11-03 13:21:09 +00:00
|
|
|
;Uninstaller Section
|
2002-09-20 23:02:38 +00:00
|
|
|
|
|
|
|
Section "Uninstall"
|
|
|
|
|
2004-02-06 23:01:57 +00:00
|
|
|
;ADD YOUR OWN FILES HERE...
|
2002-09-20 23:02:38 +00:00
|
|
|
|
|
|
|
Delete "$INSTDIR\Uninstall.exe"
|
|
|
|
|
|
|
|
RMDir "$INSTDIR"
|
|
|
|
|
2003-09-09 16:06:37 +00:00
|
|
|
DeleteRegKey /ifempty HKCU "Software\Modern UI Test"
|
2003-05-25 20:21:21 +00:00
|
|
|
|
2002-12-05 16:29:41 +00:00
|
|
|
SectionEnd
|