
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2571 212acab6-be3b-0410-9dea-997c60f758d6
127 lines
No EOL
3.1 KiB
NSIS
127 lines
No EOL
3.1 KiB
NSIS
;NSIS Modern User Interface version 1.65
|
|
;Start Menu Folder Selection Example Script
|
|
;Written by Joost Verburg
|
|
|
|
!define TEMP $R0
|
|
|
|
;--------------------------------
|
|
;Include Modern UI
|
|
|
|
!include "MUI.nsh"
|
|
|
|
;--------------------------------
|
|
;Product Info
|
|
|
|
!define MUI_PRODUCT "Modern UI Test"
|
|
!define MUI_VERSION "1.65"
|
|
|
|
;--------------------------------
|
|
;Configuration
|
|
|
|
;General
|
|
OutFile "StartMenu.exe"
|
|
|
|
;Folder selection page
|
|
InstallDir "$PROGRAMFILES\${MUI_PRODUCT}"
|
|
|
|
;Get install folder from registry if available
|
|
InstallDirRegKey HKCU "Software\${MUI_PRODUCT}" ""
|
|
|
|
;--------------------------------
|
|
;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
|
|
|
|
;$9 is being used to store the Start Menu Folder.
|
|
;Do not use this variable in your script!
|
|
|
|
;To change this variable, use MUI_STARTMENUPAGE_VARIABLE.
|
|
;Have a look at the Readme for info about other options (default folder,
|
|
;registry).
|
|
|
|
;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"
|
|
|
|
;--------------------------------
|
|
;Languages
|
|
|
|
!insertmacro MUI_LANGUAGE "English"
|
|
|
|
;--------------------------------
|
|
;Data
|
|
|
|
LicenseData "${NSISDIR}\Contrib\Modern UI\License.txt"
|
|
|
|
;--------------------------------
|
|
;Installer Sections
|
|
|
|
Section "Dummy Test File" SecCopyUI
|
|
|
|
;ADD YOUR OWN STUFF HERE!
|
|
|
|
SetOutPath "$INSTDIR"
|
|
File "${NSISDIR}\Contrib\UIs\modern.exe"
|
|
|
|
;Store install folder
|
|
WriteRegStr HKCU "Software\${MUI_PRODUCT}" "" $INSTDIR
|
|
|
|
;Create uninstaller
|
|
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
|
|
|
!insertmacro MUI_STARTMENU_WRITE_BEGIN
|
|
|
|
;Create shortcuts
|
|
CreateDirectory "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}"
|
|
CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Modern UI.lnk" "$INSTDIR\modern.exe"
|
|
CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
|
|
|
|
!insertmacro MUI_STARTMENU_WRITE_END
|
|
|
|
SectionEnd
|
|
|
|
;--------------------------------
|
|
;Descriptions
|
|
|
|
LangString DESC_SecCopyUI ${LANG_ENGLISH} "Copy modern.exe to the application folder."
|
|
|
|
!insertmacro MUI_FUNCTIONS_DESCRIPTION_BEGIN
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${SecCopyUI} $(DESC_SecCopyUI)
|
|
!insertmacro MUI_FUNCTIONS_DESCRIPTION_END
|
|
|
|
;--------------------------------
|
|
;Uninstaller Section
|
|
|
|
Section "Uninstall"
|
|
|
|
;ADD YOUR OWN STUFF HERE!
|
|
|
|
Delete "$INSTDIR\modern.exe"
|
|
Delete "$INSTDIR\Uninstall.exe"
|
|
|
|
RMDir "$INSTDIR"
|
|
|
|
DeleteRegKey /ifempty HKCU "Software\${MUI_PRODUCT}"
|
|
|
|
!insertmacro MUI_STARTMENU_DELETE_BEGIN ${TEMP}
|
|
|
|
Delete "$SMPROGRAMS\${TEMP}\Modern UI.lnk"
|
|
Delete "$SMPROGRAMS\${TEMP}\Uninstall.lnk"
|
|
RMDir "$SMPROGRAMS\${TEMP}" ;Only if empty, so it won't delete other shortcuts
|
|
|
|
!insertmacro MUI_STARTMENU_DELETE_END
|
|
|
|
SectionEnd |