-
Notifications
You must be signed in to change notification settings - Fork 0
/
installer.nsi
292 lines (219 loc) · 8.31 KB
/
installer.nsi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
;NSIS Modern User Interface
;Multilingual Example Script
;Written by Joost Verburg
!pragma warning error all
;--------------------------------
;Include Modern UI
!include "MUI2.nsh"
;--------------------------------
;Include FileFunc
!include "FileFunc.nsh"
;--------------------------------
;Registry Settings
!define EN_NAME "Rex and Captain Nemo - Extended Edition"
!define REGISTRY_KEY "Software\${EN_NAME}"
!define UNINSTALL_REGISTRY_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${EN_NAME}"
;--------------------------------
;Interface Settings
!define MUI_ABORTWARNING
;Show all languages, despite user's codepage
!define MUI_LANGDLL_ALLLANGUAGES
;Properly display all languages (Installer will not work on Windows 95, 98 or ME!)
Unicode true
;--------------------------------
;Language Selection Dialog Settings
;Remember the installer language
!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
!define MUI_LANGDLL_REGISTRY_KEY "${REGISTRY_KEY}"
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
;--------------------------------
;Create Desktop Shortcut Function
Function CreateDesktopShortcut
SetOutPath "$INSTDIR"
CreateShortcut "$DESKTOP\$(NAME).lnk" "$INSTDIR\nemo.exe"
FunctionEnd
!define MUI_FINISHPAGE_SHOWREADME ""
!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
!define MUI_FINISHPAGE_SHOWREADME_TEXT "$(CreateDesktopShortcutText)"
!define MUI_FINISHPAGE_SHOWREADME_FUNCTION CreateDesktopShortcut
;--------------------------------
;Set Install Directory
Function SetInstallDir
;Default installation folder
StrCpy $INSTDIR "$PROGRAMFILES\$(NAME)"
FunctionEnd
;--------------------------------
;Pages
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE SetInstallDir
!define MUI_WELCOMEPAGE_TITLE_3LINES
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "license.txt"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_TITLE_3LINES
!insertmacro MUI_PAGE_FINISH
!define MUI_WELCOMEPAGE_TITLE_3LINES
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!define MUI_FINISHPAGE_TITLE_3LINES
!insertmacro MUI_UNPAGE_FINISH
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "English" ; The first language is the default language
!insertmacro MUI_LANGUAGE "Polish"
!insertmacro MUI_LANGUAGE "Czech"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "Hungarian"
!insertmacro MUI_LANGUAGE "Romanian"
!insertmacro MUI_LANGUAGE "Russian"
;--------------------------------
;Reserve Files
;If you are using solid compression, files that are required before
;the actual installation should be stored first in the data block,
;because this will make your installer start faster.
!insertmacro MUI_RESERVEFILE_LANGDLL
;--------------------------------
;Create Desktop Shortcut Text
LangString CreateDesktopShortcutText ${LANG_ENGLISH} "Create desktop shortcut"
LangString CreateDesktopShortcutText ${LANG_POLISH} "Utwórz skrót na pulpicie"
LangString CreateDesktopShortcutText ${LANG_CZECH} "Vytvořit zástupce na ploše"
LangString CreateDesktopShortcutText ${LANG_GERMAN} "Desktopverknüpfung erstellen"
LangString CreateDesktopShortcutText ${LANG_HUNGARIAN} "Asztali parancsikon létrehozása"
LangString CreateDesktopShortcutText ${LANG_ROMANIAN} "Creați o comandă rapidă pe desktop"
LangString CreateDesktopShortcutText ${LANG_RUSSIAN} "Создать ярлык на рабочем столе"
;--------------------------------
;General
;Name and file
LangString Name ${LANG_ENGLISH} "${EN_NAME}"
LangString Name ${LANG_POLISH} "Reksio i Kapitan Nemo - Edycja Rozszerzona"
LangString Name ${LANG_CZECH} "${EN_NAME}"
LangString Name ${LANG_GERMAN} "${EN_NAME}"
LangString Name ${LANG_HUNGARIAN} "${EN_NAME}"
LangString Name ${LANG_ROMANIAN} "${EN_NAME}"
LangString Name ${LANG_RUSSIAN} "${EN_NAME}"
Name $(NAME)
OutFile "RaCN-EE-setup.exe"
;Default installation folder
InstallDir "$PROGRAMFILES\$(NAME)"
;Get installation folder from registry if available
InstallDirRegKey HKCU "${REGISTRY_KEY}" "ProgramPath"
;Request application privileges for Windows Vista
RequestExecutionLevel admin
;--------------------------------
;Installer Sections
Section "Game" Game
SetOutPath "$INSTDIR"
File "BlooMoo.ini"
File "BlooMooDLL.dll"
File "dorozka.wav"
File "dziki_zachod.wav"
File "egipt.wav"
File "happyend.wav"
File "hipisi.wav"
File "indie.wav"
File "intro.wav"
File "introtytul.wav"
File "komnata_b.wav"
File "konstantynopol.wav"
File "kretes.wav"
File "masajaje.wav"
File "Microsoft.VC80.CRT.manifest"
File "msvcm80.dll"
File "msvcp80.dll"
File "msvcr80.dll"
File "mu.wav"
File "nautilus.wav"
File "Nemo.exe"
File "/oname=Nemo.ini" "Nemo.ini.example"
File "orient_express.wav"
File "paryz.wav"
File "rejs.wav"
File "sndDLL.dll"
File "wieza.wav"
File "wyspa.wav"
SetOutPath "$INSTDIR\common"
File "common\*.*"
SetOutPath "$INSTDIR\common\classes"
File /r "common\classes\"
!define COMMON_SAVE_DIRECTORY "common\save"
!define COMMON_SAVE_FULL_DIRECTORY "$INSTDIR\${COMMON_SAVE_DIRECTORY}"
SetOutPath "${COMMON_SAVE_FULL_DIRECTORY}"
File "/oname=global_info.dta" "${COMMON_SAVE_DIRECTORY}\global_info.dta.example"
File "${COMMON_SAVE_DIRECTORY}\slot_def.dta"
CopyFiles "${COMMON_SAVE_FULL_DIRECTORY}\slot_def.dta" "${COMMON_SAVE_FULL_DIRECTORY}\slot0.dta"
CopyFiles "${COMMON_SAVE_FULL_DIRECTORY}\slot_def.dta" "${COMMON_SAVE_FULL_DIRECTORY}\slot0free.dta"
CopyFiles "${COMMON_SAVE_FULL_DIRECTORY}\slot_def.dta" "${COMMON_SAVE_FULL_DIRECTORY}\slot1.dta"
CopyFiles "${COMMON_SAVE_FULL_DIRECTORY}\slot_def.dta" "${COMMON_SAVE_FULL_DIRECTORY}\slot1free.dta"
CopyFiles "${COMMON_SAVE_FULL_DIRECTORY}\slot_def.dta" "${COMMON_SAVE_FULL_DIRECTORY}\slot2.dta"
CopyFiles "${COMMON_SAVE_FULL_DIRECTORY}\slot_def.dta" "${COMMON_SAVE_FULL_DIRECTORY}\slot2free.dta"
CopyFiles "${COMMON_SAVE_FULL_DIRECTORY}\slot_def.dta" "${COMMON_SAVE_FULL_DIRECTORY}\slot3.dta"
CopyFiles "${COMMON_SAVE_FULL_DIRECTORY}\slot_def.dta" "${COMMON_SAVE_FULL_DIRECTORY}\slot3free.dta"
SetOutPath "$INSTDIR\dane"
File /r "dane\"
SetOutPath "$INSTDIR\wavs"
File /r "wavs\"
;Start Menu
SetOutPath "$INSTDIR"
CreateShortcut "$SMPROGRAMS\$(NAME).lnk" "$INSTDIR\Nemo.exe" "" ""
;Store installation folder
WriteRegStr HKCU "${REGISTRY_KEY}" "ProgramPath" $INSTDIR
;Create uninstaller
WriteUninstaller "$INSTDIR\uninstall.exe"
WriteRegStr HKLM "${UNINSTALL_REGISTRY_KEY}" "DisplayName" "$(NAME)"
WriteRegStr HKLM "${UNINSTALL_REGISTRY_KEY}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
SectionGetSize ${Game} $0
IntFmt $0 "0x%08X" $0
WriteRegDWORD HKLM "${UNINSTALL_REGISTRY_KEY}" "EstimatedSize" "$0"
SectionEnd
;--------------------------------
;Installer Functions
Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd
;--------------------------------
;Uninstaller Section
Section "Uninstall"
RMDir /r "$INSTDIR\common"
RMDir /r "$INSTDIR\dane"
RMDir /r "$INSTDIR\wavs"
Delete "$INSTDIR\BlooMoo.ini"
Delete "$INSTDIR\BlooMooDLL.dll"
Delete "$INSTDIR\dorozka.wav"
Delete "$INSTDIR\dziki_zachod.wav"
Delete "$INSTDIR\egipt.wav"
Delete "$INSTDIR\happyend.wav"
Delete "$INSTDIR\hipisi.wav"
Delete "$INSTDIR\indie.wav"
Delete "$INSTDIR\intro.wav"
Delete "$INSTDIR\introtytul.wav"
Delete "$INSTDIR\komnata_b.wav"
Delete "$INSTDIR\konstantynopol.wav"
Delete "$INSTDIR\kretes.wav"
Delete "$INSTDIR\masajaje.wav"
Delete "$INSTDIR\Microsoft.VC80.CRT.manifest"
Delete "$INSTDIR\msvcm80.dll"
Delete "$INSTDIR\msvcp80.dll"
Delete "$INSTDIR\msvcr80.dll"
Delete "$INSTDIR\mu.wav"
Delete "$INSTDIR\nautilus.wav"
Delete "$INSTDIR\Nemo.exe"
Delete "$INSTDIR\Nemo.ini"
Delete "$INSTDIR\orient_express.wav"
Delete "$INSTDIR\paryz.wav"
Delete "$INSTDIR\rejs.wav"
Delete "$INSTDIR\sndDLL.dll"
Delete "$INSTDIR\wieza.wav"
Delete "$INSTDIR\wyspa.wav"
Delete "$DESKTOP\$(NAME).lnk"
Delete "$SMPROGRAMS\$(NAME).lnk"
Delete "$INSTDIR\uninstall.exe"
RMDir "$INSTDIR"
DeleteRegKey HKCU "${REGISTRY_KEY}"
DeleteRegKey HKLM "${UNINSTALL_REGISTRY_KEY}"
SectionEnd
;--------------------------------
;Uninstaller Functions
Function un.onInit
!insertmacro MUI_UNGETLANGUAGE
FunctionEnd