| 1 |
;NSIS Modern User Interface |
| 2 |
;Basic Example Script |
| 3 |
;Written by Joost Verburg |
| 4 |
|
| 5 |
;-------------------------------- |
| 6 |
;Include Modern UI |
| 7 |
|
| 8 |
!include "MUI2.nsh" |
| 9 |
|
| 10 |
;-------------------------------- |
| 11 |
;General |
| 12 |
|
| 13 |
;Name and file |
| 14 |
Name "Modern UI Test" |
| 15 |
OutFile "Basic.exe" |
| 16 |
Unicode True |
| 17 |
|
| 18 |
;Default installation folder |
| 19 |
InstallDir "$LOCALAPPDATA\Modern UI Test" |
| 20 |
|
| 21 |
;Get installation folder from registry if available |
| 22 |
InstallDirRegKey HKCU "Software\Modern UI Test" "" |
| 23 |
|
| 24 |
;Request application privileges for Windows Vista |
| 25 |
RequestExecutionLevel user |
| 26 |
|
| 27 |
;-------------------------------- |
| 28 |
;Interface Settings |
| 29 |
|
| 30 |
!define MUI_ABORTWARNING |
| 31 |
|
| 32 |
;-------------------------------- |
| 33 |
;Pages |
| 34 |
|
| 35 |
!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt" |
| 36 |
!insertmacro MUI_PAGE_COMPONENTS |
| 37 |
!insertmacro MUI_PAGE_DIRECTORY |
| 38 |
!insertmacro MUI_PAGE_INSTFILES |
| 39 |
|
| 40 |
!insertmacro MUI_UNPAGE_CONFIRM |
| 41 |
!insertmacro MUI_UNPAGE_INSTFILES |
| 42 |
|
| 43 |
;-------------------------------- |
| 44 |
;Languages |
| 45 |
|
| 46 |
!insertmacro MUI_LANGUAGE "English" |
| 47 |
|
| 48 |
;-------------------------------- |
| 49 |
;Installer Sections |
| 50 |
|
| 51 |
Section "Dummy Section" SecDummy |
| 52 |
|
| 53 |
SetOutPath "$INSTDIR" |
| 54 |
|
| 55 |
;ADD YOUR OWN FILES HERE... |
| 56 |
|
| 57 |
;Store installation folder |
| 58 |
WriteRegStr HKCU "Software\Modern UI Test" "" $INSTDIR |
| 59 |
|
| 60 |
;Create uninstaller |
| 61 |
WriteUninstaller "$INSTDIR\Uninstall.exe" |
| 62 |
|
| 63 |
SectionEnd |
| 64 |
|
| 65 |
;-------------------------------- |
| 66 |
;Descriptions |
| 67 |
|
| 68 |
;Language strings |
| 69 |
LangString DESC_SecDummy ${LANG_ENGLISH} "A test section." |
| 70 |
|
| 71 |
;Assign language strings to sections |
| 72 |
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN |
| 73 |
!insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy) |
| 74 |
!insertmacro MUI_FUNCTION_DESCRIPTION_END |
| 75 |
|
| 76 |
;-------------------------------- |
| 77 |
;Uninstaller Section |
| 78 |
|
| 79 |
Section "Uninstall" |
| 80 |
|
| 81 |
;ADD YOUR OWN FILES HERE... |
| 82 |
|
| 83 |
Delete "$INSTDIR\Uninstall.exe" |
| 84 |
|
| 85 |
RMDir "$INSTDIR" |
| 86 |
|
| 87 |
DeleteRegKey /ifempty HKCU "Software\Modern UI Test" |
| 88 |
|
| 89 |
SectionEnd |