2004-11-27 14:50:43 +00:00
|
|
|
;NSIS Modern User Interface
|
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
|
|
|
|
2008-01-27 17:24:40 +00:00
|
|
|
!include "MUI2.nsh"
|
2002-11-09 17:58:59 +00:00
|
|
|
|
|
|
|
;--------------------------------
|
2004-02-06 23:01:57 +00:00
|
|
|
;General
|
2002-11-09 17:58:59 +00:00
|
|
|
|
2004-02-06 23:01:57 +00:00
|
|
|
;Name and file
|
2004-11-27 14:50:43 +00:00
|
|
|
Name "Modern UI Test"
|
2003-01-09 16:49:11 +00:00
|
|
|
OutFile "StartMenu.exe"
|
2002-12-24 22:38:06 +00:00
|
|
|
|
2004-01-07 19:21:00 +00:00
|
|
|
;Default installation folder
|
2008-02-04 01:35:09 +00:00
|
|
|
InstallDir "$LOCALAPPDATA\Modern UI Test"
|
2003-03-09 22:10:07 +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" ""
|
2003-05-25 20:21:21 +00:00
|
|
|
|
2008-02-04 01:35:09 +00:00
|
|
|
;Request application privileges for Windows Vista
|
2008-01-27 17:24:40 +00:00
|
|
|
RequestExecutionLevel user
|
2007-02-23 12:45:13 +00:00
|
|
|
|
2003-07-16 22:44:33 +00:00
|
|
|
;--------------------------------
|
|
|
|
;Variables
|
|
|
|
|
2008-01-27 17:24:40 +00:00
|
|
|
Var StartMenuFolder
|
2003-07-16 22:44:33 +00:00
|
|
|
|
2003-09-04 18:42:21 +00:00
|
|
|
;--------------------------------
|
2003-10-08 15:28:44 +00:00
|
|
|
;Interface Settings
|
2003-09-04 18:42:21 +00:00
|
|
|
|
|
|
|
!define MUI_ABORTWARNING
|
|
|
|
|
2003-05-25 20:21:21 +00:00
|
|
|
;--------------------------------
|
|
|
|
;Pages
|
|
|
|
|
2005-06-19 21:39:04 +00:00
|
|
|
!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt"
|
2003-11-09 23:10:04 +00:00
|
|
|
!insertmacro MUI_PAGE_COMPONENTS
|
2003-05-25 20:21:21 +00:00
|
|
|
!insertmacro MUI_PAGE_DIRECTORY
|
2003-09-04 18:42:21 +00:00
|
|
|
|
|
|
|
;Start Menu Folder Page Configuration
|
|
|
|
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"
|
2003-09-09 16:06:37 +00:00
|
|
|
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Modern UI Test"
|
2003-09-04 18:42:21 +00:00
|
|
|
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
|
|
|
|
|
2008-01-27 17:24:40 +00:00
|
|
|
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
|
2003-09-04 18:42:21 +00:00
|
|
|
|
2003-11-09 23:03:36 +00:00
|
|
|
!insertmacro MUI_PAGE_INSTFILES
|
2003-05-25 20:21:21 +00:00
|
|
|
|
|
|
|
!insertmacro MUI_UNPAGE_CONFIRM
|
|
|
|
!insertmacro MUI_UNPAGE_INSTFILES
|
2003-03-09 22:10:07 +00:00
|
|
|
|
2002-12-24 22:38:06 +00:00
|
|
|
;--------------------------------
|
|
|
|
;Languages
|
|
|
|
|
2002-11-09 17:58:59 +00:00
|
|
|
!insertmacro MUI_LANGUAGE "English"
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
;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
|
|
|
|
2004-02-06 23:01:57 +00:00
|
|
|
;ADD YOUR OWN FILES HERE...
|
2002-11-09 17:58:59 +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
|
|
|
|
2003-05-25 20:21:21 +00:00
|
|
|
;Create uninstaller
|
|
|
|
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
|
|
|
|
2003-11-09 22:12:58 +00:00
|
|
|
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
|
2002-11-15 16:00:32 +00:00
|
|
|
|
|
|
|
;Create shortcuts
|
2008-01-27 17:24:40 +00:00
|
|
|
CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
|
|
|
|
CreateShortCut "$SMPROGRAMS\$StartMenuFolder\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
|
|
|
|
|
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
|
2002-11-09 17:58:59 +00:00
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
;Uninstaller Section
|
|
|
|
|
|
|
|
Section "Uninstall"
|
|
|
|
|
2004-02-06 23:01:57 +00:00
|
|
|
;ADD YOUR OWN FILES HERE...
|
2002-11-09 17:58:59 +00:00
|
|
|
|
|
|
|
Delete "$INSTDIR\Uninstall.exe"
|
2003-05-25 20:21:21 +00:00
|
|
|
|
|
|
|
RMDir "$INSTDIR"
|
2002-11-09 17:58:59 +00:00
|
|
|
|
2008-01-27 17:24:40 +00:00
|
|
|
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
|
2003-07-16 22:44:33 +00:00
|
|
|
|
2008-01-27 17:24:40 +00:00
|
|
|
Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk"
|
|
|
|
RMDir "$SMPROGRAMS\$StartMenuFolder"
|
2003-07-16 22:44:33 +00:00
|
|
|
|
2003-09-09 16:06:37 +00:00
|
|
|
DeleteRegKey /ifempty HKCU "Software\Modern UI Test"
|
2003-06-14 12:49:33 +00:00
|
|
|
|
2003-11-09 23:03:36 +00:00
|
|
|
SectionEnd
|