2003-05-25 20:21:21 +00:00
|
|
|
;NSIS Modern User Interface version 1.65
|
2002-11-09 17:58:59 +00:00
|
|
|
;Start Menu Folder Selection Example Script
|
|
|
|
;Written by Joost Verburg
|
|
|
|
|
2003-05-25 20:21:21 +00:00
|
|
|
;--------------------------------
|
|
|
|
;Include Modern UI
|
2002-11-09 17:58:59 +00:00
|
|
|
|
2003-06-10 19:32:00 +00:00
|
|
|
!include "MUI.nsh"
|
2002-11-09 17:58:59 +00:00
|
|
|
|
2003-05-25 20:21:21 +00:00
|
|
|
;--------------------------------
|
|
|
|
;Product Info
|
|
|
|
|
2003-06-10 19:32:00 +00:00
|
|
|
!define MUI_PRODUCT "Modern UI Test"
|
|
|
|
!define MUI_VERSION "1.65"
|
2003-05-25 20:21:21 +00:00
|
|
|
|
2002-11-09 17:58:59 +00:00
|
|
|
;--------------------------------
|
|
|
|
;Configuration
|
|
|
|
|
2002-12-24 22:38:06 +00:00
|
|
|
;General
|
2003-01-09 16:49:11 +00:00
|
|
|
OutFile "StartMenu.exe"
|
2002-12-24 22:38:06 +00:00
|
|
|
|
|
|
|
;Folder selection page
|
|
|
|
InstallDir "$PROGRAMFILES\${MUI_PRODUCT}"
|
2003-03-09 22:10:07 +00:00
|
|
|
|
2003-04-30 21:44:52 +00:00
|
|
|
;Get install folder from registry if available
|
2003-03-14 09:23:45 +00:00
|
|
|
InstallDirRegKey HKCU "Software\${MUI_PRODUCT}" ""
|
2003-05-25 20:21:21 +00:00
|
|
|
|
2003-07-16 22:44:33 +00:00
|
|
|
;--------------------------------
|
|
|
|
;Variables
|
|
|
|
|
2003-07-16 23:03:02 +00:00
|
|
|
Var MUI_TEMP
|
2003-07-16 22:44:33 +00:00
|
|
|
|
2003-05-25 20:21:21 +00:00
|
|
|
;--------------------------------
|
|
|
|
;Pages
|
|
|
|
|
|
|
|
!insertmacro MUI_PAGE_LICENSE
|
|
|
|
!insertmacro MUI_PAGE_COMPONENTS
|
|
|
|
!insertmacro MUI_PAGE_DIRECTORY
|
|
|
|
!insertmacro MUI_PAGE_STARTMENU
|
|
|
|
!insertmacro MUI_PAGE_INSTFILES
|
|
|
|
|
|
|
|
!insertmacro MUI_UNPAGE_CONFIRM
|
|
|
|
!insertmacro MUI_UNPAGE_INSTFILES
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
;Modern UI Configuration
|
|
|
|
|
|
|
|
!define MUI_ABORTWARNING
|
2003-03-09 22:38:13 +00:00
|
|
|
|
2003-03-09 22:10:07 +00:00
|
|
|
;Remember the Start Menu Folder
|
|
|
|
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"
|
|
|
|
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\${MUI_PRODUCT}"
|
|
|
|
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
|
|
|
|
|
2002-12-24 22:38:06 +00:00
|
|
|
;--------------------------------
|
|
|
|
;Languages
|
|
|
|
|
2002-11-09 17:58:59 +00:00
|
|
|
!insertmacro MUI_LANGUAGE "English"
|
|
|
|
|
|
|
|
;--------------------------------
|
2002-12-24 22:38:06 +00:00
|
|
|
;Data
|
|
|
|
|
|
|
|
LicenseData "${NSISDIR}\Contrib\Modern UI\License.txt"
|
2002-11-09 17:58:59 +00:00
|
|
|
|
2003-06-14 12:49:33 +00:00
|
|
|
;--------------------------------
|
|
|
|
;Reserve Files
|
|
|
|
|
|
|
|
;Things that need to be extracted on first (keep these lines before any File command!)
|
|
|
|
;Only for BZIP2 compression
|
|
|
|
!insertmacro MUI_RESERVEFILE_STARTMENU
|
|
|
|
|
2002-11-09 17:58:59 +00:00
|
|
|
;--------------------------------
|
|
|
|
;Installer Sections
|
|
|
|
|
2003-06-10 19:32:00 +00:00
|
|
|
Section "Dummy Section" SecDummy
|
2002-11-09 17:58:59 +00:00
|
|
|
|
|
|
|
SetOutPath "$INSTDIR"
|
2003-06-10 19:32:00 +00:00
|
|
|
|
|
|
|
;ADD YOUR OWN STUFF HERE!
|
2002-11-09 17:58:59 +00:00
|
|
|
|
2003-03-09 22:38:13 +00:00
|
|
|
;Store install folder
|
2003-03-14 09:23:45 +00:00
|
|
|
WriteRegStr HKCU "Software\${MUI_PRODUCT}" "" $INSTDIR
|
2003-03-09 22:38:13 +00:00
|
|
|
|
2003-05-25 20:21:21 +00:00
|
|
|
;Create uninstaller
|
|
|
|
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
|
|
|
|
2002-11-15 16:00:32 +00:00
|
|
|
!insertmacro MUI_STARTMENU_WRITE_BEGIN
|
|
|
|
|
|
|
|
;Create shortcuts
|
2003-07-25 17:25:00 +00:00
|
|
|
CreateDirectory "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}"
|
2003-07-18 15:22:37 +00:00
|
|
|
CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
|
2002-11-09 17:58:59 +00:00
|
|
|
|
2002-11-15 16:00:32 +00:00
|
|
|
!insertmacro MUI_STARTMENU_WRITE_END
|
2002-11-09 17:58:59 +00:00
|
|
|
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
;Descriptions
|
|
|
|
|
2003-06-10 19:32:00 +00:00
|
|
|
LangString DESC_SecDummy ${LANG_ENGLISH} "A test section."
|
2003-05-25 20:21:21 +00:00
|
|
|
|
2003-06-10 19:32:00 +00:00
|
|
|
!insertmacro MUI_FUNCTIONS_DESCRIPTION_BEGIN
|
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)
|
|
|
|
!insertmacro MUI_FUNCTIONS_DESCRIPTION_END
|
2002-11-09 17:58:59 +00:00
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
;Uninstaller Section
|
|
|
|
|
|
|
|
Section "Uninstall"
|
|
|
|
|
|
|
|
;ADD YOUR OWN STUFF HERE!
|
|
|
|
|
|
|
|
Delete "$INSTDIR\Uninstall.exe"
|
2003-05-25 20:21:21 +00:00
|
|
|
|
|
|
|
RMDir "$INSTDIR"
|
2002-11-09 17:58:59 +00:00
|
|
|
|
2003-07-16 23:03:02 +00:00
|
|
|
!insertmacro MUI_STARTMENU_GETFOLDER $MUI_TEMP
|
2003-07-16 22:44:33 +00:00
|
|
|
|
2003-07-16 23:03:02 +00:00
|
|
|
Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
|
2003-07-16 22:44:33 +00:00
|
|
|
|
|
|
|
;Delete empty start menu parent diretories
|
2003-07-16 23:03:02 +00:00
|
|
|
StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"
|
2003-07-16 22:44:33 +00:00
|
|
|
|
|
|
|
startMenuDeleteLoop:
|
2003-07-18 15:22:37 +00:00
|
|
|
RMDir $MUI_TEMP
|
2003-07-16 23:03:02 +00:00
|
|
|
GetFullPathName $MUI_TEMP "$MUI_TEMP\.."
|
2003-07-16 22:44:33 +00:00
|
|
|
|
|
|
|
IfErrors startMenuDeleteLoopDone
|
|
|
|
|
2003-07-18 15:22:37 +00:00
|
|
|
StrCmp $MUI_TEMP $SMPROGRAMS startMenuDeleteLoopDone startMenuDeleteLoop
|
2003-07-16 22:44:33 +00:00
|
|
|
startMenuDeleteLoopDone:
|
2002-11-09 17:58:59 +00:00
|
|
|
|
2003-06-14 12:49:33 +00:00
|
|
|
DeleteRegKey /ifempty HKCU "Software\${MUI_PRODUCT}"
|
|
|
|
|
2003-07-25 17:25:00 +00:00
|
|
|
SectionEnd
|