
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2115 212acab6-be3b-0410-9dea-997c60f758d6
131 lines
No EOL
3.3 KiB
NSIS
131 lines
No EOL
3.3 KiB
NSIS
;NSIS Modern User Interface version 1.62
|
|
;Start Menu Folder Selection Example Script
|
|
;Written by Joost Verburg
|
|
|
|
!define MUI_PRODUCT "Test Software" ;Define your own software name here
|
|
!define MUI_VERSION "1.0" ;Define your own software version here
|
|
|
|
!include "MUI.nsh"
|
|
|
|
;$9 is being used to store the Start Menu Folder.
|
|
;Do not use this variable in your script (or Push/Pop it)!
|
|
|
|
;To change this variable, use MUI_STARTMENU_VARIABLE.
|
|
;Have a look at the Readme for info about other options (default folder,
|
|
;registry).
|
|
|
|
;Remember the Start Menu Folder
|
|
!define MUI_STARTMENU_REGISTRY_ROOT "HKCU"
|
|
!define MUI_STARTMENU_REGISTRY_KEY "Software\${MUI_PRODUCT}"
|
|
!define MUI_STARTMENU_REGISTRY_VALUENAME "Start Menu Folder"
|
|
|
|
!define TEMP $R0
|
|
|
|
;--------------------------------
|
|
;Configuration
|
|
|
|
;General
|
|
OutFile "StartMenu.exe"
|
|
|
|
;Folder selection page
|
|
InstallDir "$PROGRAMFILES\${MUI_PRODUCT}"
|
|
|
|
;--------------------------------
|
|
;Modern UI Configuration
|
|
|
|
!define MUI_LICENSEPAGE
|
|
!define MUI_COMPONENTSPAGE
|
|
!define MUI_DIRECTORYPAGE
|
|
!define MUI_STARTMENUPAGE
|
|
|
|
!define MUI_ABORTWARNING
|
|
|
|
!define MUI_UNINSTALLER
|
|
!define MUI_UNCONFIRMPAGE
|
|
|
|
;Modern UI System
|
|
!insertmacro MUI_SYSTEM
|
|
|
|
;--------------------------------
|
|
;Languages
|
|
|
|
!insertmacro MUI_LANGUAGE "English"
|
|
|
|
;--------------------------------
|
|
;Language Strings
|
|
|
|
;Description
|
|
LangString DESC_SecCopyUI ${LANG_ENGLISH} "Copy the modern.exe file to the application folder."
|
|
|
|
;--------------------------------
|
|
;Data
|
|
|
|
LicenseData "${NSISDIR}\Contrib\Modern UI\License.txt"
|
|
|
|
;--------------------------------
|
|
;Installer Sections
|
|
|
|
Section "modern.exe" SecCopyUI
|
|
|
|
;ADD YOUR OWN STUFF HERE!
|
|
|
|
SetOutPath "$INSTDIR"
|
|
File "${NSISDIR}\Contrib\UIs\modern.exe"
|
|
|
|
!insertmacro MUI_STARTMENU_WRITE_BEGIN
|
|
|
|
;Create shortcuts
|
|
CreateDirectory "$SMPROGRAMS\${MUI_STARTMENU_VARIABLE}"
|
|
CreateShortCut "$SMPROGRAMS\${MUI_STARTMENU_VARIABLE}\Modern UI.lnk" "$INSTDIR\modern.exe"
|
|
CreateShortCut "$SMPROGRAMS\${MUI_STARTMENU_VARIABLE}\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
|
|
|
|
;Write shortcut location to the registry (for Uninstaller)
|
|
WriteRegStr HKCU "Software\${MUI_PRODUCT}" "Start Menu Folder" "${MUI_STARTMENU_VARIABLE}"
|
|
|
|
!insertmacro MUI_STARTMENU_WRITE_END
|
|
|
|
;Create uninstaller
|
|
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
|
|
|
SectionEnd
|
|
|
|
;Display the Finish header
|
|
;Insert this macro after the sections if you are not using a finish page
|
|
!insertmacro MUI_SECTIONS_FINISHHEADER
|
|
|
|
;--------------------------------
|
|
;Descriptions
|
|
|
|
!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"
|
|
|
|
;Remove shortcut
|
|
ReadRegStr ${TEMP} HKCU "Software\${MUI_PRODUCT}" "Start Menu Folder"
|
|
|
|
StrCmp ${TEMP} "" noshortcuts
|
|
|
|
Delete "$SMPROGRAMS\${TEMP}\Modern UI.lnk"
|
|
Delete "$SMPROGRAMS\${TEMP}\Uninstall.lnk"
|
|
RMDir "$SMPROGRAMS\${TEMP}" ;Only if empty, so it won't delete other shortcuts
|
|
|
|
noshortcuts:
|
|
|
|
RMDir "$INSTDIR"
|
|
|
|
DeleteRegValue HKCU "Software\${MUI_PRODUCT}" "Start Menu Folder"
|
|
|
|
;Display the Finish header
|
|
!insertmacro MUI_UNFINISHHEADER
|
|
|
|
SectionEnd |