| 1 |
;NSIS Modern User Interface |
| 2 |
;Multilingual Example Script |
| 3 |
;Written by Joost Verburg |
| 4 |
|
| 5 |
!pragma warning error all |
| 6 |
|
| 7 |
;-------------------------------- |
| 8 |
;Include Modern UI |
| 9 |
|
| 10 |
!include "MUI2.nsh" |
| 11 |
|
| 12 |
;-------------------------------- |
| 13 |
;General |
| 14 |
|
| 15 |
;Properly display all languages (Installer will not work on Windows 95, 98 or ME!) |
| 16 |
Unicode true |
| 17 |
|
| 18 |
;Name and file |
| 19 |
Name "Modern UI Test" |
| 20 |
OutFile "MultiLanguage.exe" |
| 21 |
|
| 22 |
;Default installation folder |
| 23 |
InstallDir "$LOCALAPPDATA\Modern UI Test" |
| 24 |
|
| 25 |
;Get installation folder from registry if available |
| 26 |
InstallDirRegKey HKCU "Software\Modern UI Test" "" |
| 27 |
|
| 28 |
;Request application privileges for Windows Vista |
| 29 |
RequestExecutionLevel user |
| 30 |
|
| 31 |
;-------------------------------- |
| 32 |
;Interface Settings |
| 33 |
|
| 34 |
!define MUI_ABORTWARNING |
| 35 |
|
| 36 |
;Show all languages, despite user's codepage |
| 37 |
!define MUI_LANGDLL_ALLLANGUAGES |
| 38 |
|
| 39 |
;-------------------------------- |
| 40 |
;Language Selection Dialog Settings |
| 41 |
|
| 42 |
;Remember the installer language |
| 43 |
!define MUI_LANGDLL_REGISTRY_ROOT "HKCU" |
| 44 |
!define MUI_LANGDLL_REGISTRY_KEY "Software\Modern UI Test" |
| 45 |
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language" |
| 46 |
|
| 47 |
;-------------------------------- |
| 48 |
;Pages |
| 49 |
|
| 50 |
!insertmacro MUI_PAGE_WELCOME |
| 51 |
!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt" |
| 52 |
!insertmacro MUI_PAGE_COMPONENTS |
| 53 |
!insertmacro MUI_PAGE_DIRECTORY |
| 54 |
!insertmacro MUI_PAGE_INSTFILES |
| 55 |
!insertmacro MUI_PAGE_FINISH |
| 56 |
|
| 57 |
!insertmacro MUI_UNPAGE_WELCOME |
| 58 |
!insertmacro MUI_UNPAGE_CONFIRM |
| 59 |
!insertmacro MUI_UNPAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt" |
| 60 |
!insertmacro MUI_UNPAGE_COMPONENTS |
| 61 |
!insertmacro MUI_UNPAGE_DIRECTORY |
| 62 |
!insertmacro MUI_UNPAGE_INSTFILES |
| 63 |
!insertmacro MUI_UNPAGE_FINISH |
| 64 |
|
| 65 |
;-------------------------------- |
| 66 |
;Languages |
| 67 |
|
| 68 |
!insertmacro MUI_LANGUAGE "English" ; The first language is the default language |
| 69 |
!insertmacro MUI_LANGUAGE "French" |
| 70 |
!insertmacro MUI_LANGUAGE "German" |
| 71 |
!insertmacro MUI_LANGUAGE "Spanish" |
| 72 |
!insertmacro MUI_LANGUAGE "SpanishInternational" |
| 73 |
!insertmacro MUI_LANGUAGE "SimpChinese" |
| 74 |
!insertmacro MUI_LANGUAGE "TradChinese" |
| 75 |
!insertmacro MUI_LANGUAGE "Japanese" |
| 76 |
!insertmacro MUI_LANGUAGE "Korean" |
| 77 |
!insertmacro MUI_LANGUAGE "Italian" |
| 78 |
!insertmacro MUI_LANGUAGE "Dutch" |
| 79 |
!insertmacro MUI_LANGUAGE "Danish" |
| 80 |
!insertmacro MUI_LANGUAGE "Swedish" |
| 81 |
!insertmacro MUI_LANGUAGE "Norwegian" |
| 82 |
!insertmacro MUI_LANGUAGE "NorwegianNynorsk" |
| 83 |
!insertmacro MUI_LANGUAGE "Finnish" |
| 84 |
!insertmacro MUI_LANGUAGE "Greek" |
| 85 |
!insertmacro MUI_LANGUAGE "Russian" |
| 86 |
!insertmacro MUI_LANGUAGE "Portuguese" |
| 87 |
!insertmacro MUI_LANGUAGE "PortugueseBR" |
| 88 |
!insertmacro MUI_LANGUAGE "Polish" |
| 89 |
!insertmacro MUI_LANGUAGE "Ukrainian" |
| 90 |
!insertmacro MUI_LANGUAGE "Czech" |
| 91 |
!insertmacro MUI_LANGUAGE "Slovak" |
| 92 |
!insertmacro MUI_LANGUAGE "Croatian" |
| 93 |
!insertmacro MUI_LANGUAGE "Bulgarian" |
| 94 |
!insertmacro MUI_LANGUAGE "Hungarian" |
| 95 |
!insertmacro MUI_LANGUAGE "Thai" |
| 96 |
!insertmacro MUI_LANGUAGE "Romanian" |
| 97 |
!insertmacro MUI_LANGUAGE "Latvian" |
| 98 |
!insertmacro MUI_LANGUAGE "Macedonian" |
| 99 |
!insertmacro MUI_LANGUAGE "Estonian" |
| 100 |
!insertmacro MUI_LANGUAGE "Turkish" |
| 101 |
!insertmacro MUI_LANGUAGE "Lithuanian" |
| 102 |
!insertmacro MUI_LANGUAGE "Slovenian" |
| 103 |
!insertmacro MUI_LANGUAGE "Serbian" |
| 104 |
!insertmacro MUI_LANGUAGE "SerbianLatin" |
| 105 |
!insertmacro MUI_LANGUAGE "Arabic" |
| 106 |
!insertmacro MUI_LANGUAGE "Farsi" |
| 107 |
!insertmacro MUI_LANGUAGE "Hebrew" |
| 108 |
!insertmacro MUI_LANGUAGE "Indonesian" |
| 109 |
!insertmacro MUI_LANGUAGE "Mongolian" |
| 110 |
!insertmacro MUI_LANGUAGE "Luxembourgish" |
| 111 |
!insertmacro MUI_LANGUAGE "Albanian" |
| 112 |
!insertmacro MUI_LANGUAGE "Breton" |
| 113 |
!insertmacro MUI_LANGUAGE "Belarusian" |
| 114 |
!insertmacro MUI_LANGUAGE "Icelandic" |
| 115 |
!insertmacro MUI_LANGUAGE "Malay" |
| 116 |
!insertmacro MUI_LANGUAGE "Bosnian" |
| 117 |
!insertmacro MUI_LANGUAGE "Kurdish" |
| 118 |
!insertmacro MUI_LANGUAGE "Irish" |
| 119 |
!insertmacro MUI_LANGUAGE "Uzbek" |
| 120 |
!insertmacro MUI_LANGUAGE "Galician" |
| 121 |
!insertmacro MUI_LANGUAGE "Afrikaans" |
| 122 |
!insertmacro MUI_LANGUAGE "Catalan" |
| 123 |
!insertmacro MUI_LANGUAGE "Esperanto" |
| 124 |
!insertmacro MUI_LANGUAGE "Asturian" |
| 125 |
!insertmacro MUI_LANGUAGE "Basque" |
| 126 |
!insertmacro MUI_LANGUAGE "Pashto" |
| 127 |
!insertmacro MUI_LANGUAGE "ScotsGaelic" |
| 128 |
!insertmacro MUI_LANGUAGE "Georgian" |
| 129 |
!insertmacro MUI_LANGUAGE "Vietnamese" |
| 130 |
!insertmacro MUI_LANGUAGE "Welsh" |
| 131 |
!insertmacro MUI_LANGUAGE "Armenian" |
| 132 |
!insertmacro MUI_LANGUAGE "Corsican" |
| 133 |
!insertmacro MUI_LANGUAGE "Tatar" |
| 134 |
!insertmacro MUI_LANGUAGE "Hindi" |
| 135 |
|
| 136 |
;-------------------------------- |
| 137 |
;Reserve Files |
| 138 |
|
| 139 |
;If you are using solid compression, files that are required before |
| 140 |
;the actual installation should be stored first in the data block, |
| 141 |
;because this will make your installer start faster. |
| 142 |
|
| 143 |
!insertmacro MUI_RESERVEFILE_LANGDLL |
| 144 |
|
| 145 |
;-------------------------------- |
| 146 |
;Installer Sections |
| 147 |
|
| 148 |
Section "Dummy Section" SecDummy |
| 149 |
|
| 150 |
SetOutPath "$INSTDIR" |
| 151 |
|
| 152 |
;ADD YOUR OWN FILES HERE... |
| 153 |
|
| 154 |
;Store installation folder |
| 155 |
WriteRegStr HKCU "Software\Modern UI Test" "" $INSTDIR |
| 156 |
|
| 157 |
;Create uninstaller |
| 158 |
WriteUninstaller "$INSTDIR\Uninstall.exe" |
| 159 |
|
| 160 |
SectionEnd |
| 161 |
|
| 162 |
;-------------------------------- |
| 163 |
;Installer Functions |
| 164 |
|
| 165 |
Function .onInit |
| 166 |
|
| 167 |
!insertmacro MUI_LANGDLL_DISPLAY |
| 168 |
|
| 169 |
FunctionEnd |
| 170 |
|
| 171 |
;-------------------------------- |
| 172 |
;Descriptions |
| 173 |
|
| 174 |
;USE A LANGUAGE STRING IF YOU WANT YOUR DESCRIPTIONS TO BE LANGUAGE SPECIFIC |
| 175 |
|
| 176 |
;Assign descriptions to sections |
| 177 |
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN |
| 178 |
!insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} "A test section." |
| 179 |
!insertmacro MUI_FUNCTION_DESCRIPTION_END |
| 180 |
|
| 181 |
|
| 182 |
;-------------------------------- |
| 183 |
;Uninstaller Section |
| 184 |
|
| 185 |
Section "Uninstall" |
| 186 |
|
| 187 |
;ADD YOUR OWN FILES HERE... |
| 188 |
|
| 189 |
Delete "$INSTDIR\Uninstall.exe" |
| 190 |
|
| 191 |
RMDir "$INSTDIR" |
| 192 |
|
| 193 |
DeleteRegKey /ifempty HKCU "Software\Modern UI Test" |
| 194 |
|
| 195 |
SectionEnd |
| 196 |
|
| 197 |
;-------------------------------- |
| 198 |
;Uninstaller Functions |
| 199 |
|
| 200 |
Function un.onInit |
| 201 |
|
| 202 |
!insertmacro MUI_UNGETLANGUAGE |
| 203 |
|
| 204 |
FunctionEnd |