forked from iTALC/italc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
iTALC.nsi.in
323 lines (275 loc) · 10.7 KB
/
iTALC.nsi.in
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
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
!define DLLDIR "@MINGW_PREFIX@/bin"
!define DLLDIR_LIB "@MINGW_PREFIX@/lib"
!define DLLDIR_GCC "/usr/lib/gcc/@CMAKE_SYSTEM_PROCESSOR@-w64-mingw32/5.3-win32"
!if "@CMAKE_SYSTEM_PROCESSOR@" == "x86_64"
!define DLL_GCC "libgcc_s_seh-1.dll"
!else
!define DLL_GCC "libgcc_s_sjlj-1.dll"
!endif
!define QT5_PLUGINS_PLATFORMS "/usr/@CMAKE_SYSTEM_PROCESSOR@-w64-mingw32/lib/qt5/plugins/platforms"
!define APP_NAME "iTALC"
!define COMP_NAME "iTALC Solutions Inc."
!define WEB_SITE "http://italc.sf.net"
!define VERSION "@VERSION@"
!define COPYRIGHT "© Tobias Doerffel 2004-2016"
!define DESCRIPTION "Intelligent Teaching and Learning with Computers"
!define LICENSE_TXT "@CMAKE_SOURCE_DIR@/COPYING"
!define INSTALLER_NAME "italc-${VERSION}-@[email protected]"
!define MAIN_APP_EXE "italc.exe"
!define INSTALL_TYPE "SetShellVarContext all"
!define REG_ROOT "HKLM"
!define REG_APP_PATH "Software\Microsoft\Windows\CurrentVersion\App Paths\${MAIN_APP_EXE}"
!define UNINSTALL_PATH "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}"
######################################################################
VIProductVersion "${VERSION}.0"
VIAddVersionKey "ProductName" "${APP_NAME}"
VIAddVersionKey "CompanyName" "${COMP_NAME}"
VIAddVersionKey "LegalCopyright" "${COPYRIGHT}"
VIAddVersionKey "FileDescription" "${DESCRIPTION}"
VIAddVersionKey "FileVersion" "${VERSION}"
######################################################################
SetCompressor /SOLID Lzma
Name "${APP_NAME}"
Caption "${APP_NAME} ${VERSION}"
OutFile "${INSTALLER_NAME}"
BrandingText "${APP_NAME} ${VERSION}"
XPStyle on
InstallDirRegKey "${REG_ROOT}" "${REG_APP_PATH}" ""
InstallDir "$PROGRAMFILES64\iTALC"
ShowInstDetails show
######################################################################
!include "MUI.nsh"
!define MUI_ABORTWARNING
!define MUI_UNABORTWARNING
!define MUI_WELCOMEFINISHPAGE_BITMAP "@CMAKE_SOURCE_DIR@/nsis/welcome-page.bmp"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "@CMAKE_SOURCE_DIR@/nsis/header.bmp"
!define MUI_LANGDLL_REGISTRY_ROOT "${REG_ROOT}"
!define MUI_LANGDLL_REGISTRY_KEY "${UNINSTALL_PATH}"
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "${LICENSE_TXT}"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_COMPONENTS
!ifdef REG_START_MENU
!define MUI_STARTMENUPAGE_NODISABLE
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "iTALC"
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${REG_ROOT}"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "${UNINSTALL_PATH}"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${REG_START_MENU}"
!insertmacro MUI_PAGE_STARTMENU Application $SM_Folder
!endif
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_TEXT "Run iTALC Management Console now"
!define MUI_FINISHPAGE_RUN_FUNCTION "RunIMC"
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
!insertmacro MUI_LANGUAGE "Albanian"
!insertmacro MUI_LANGUAGE "Arabic"
!insertmacro MUI_LANGUAGE "Belarusian"
!insertmacro MUI_LANGUAGE "Bosnian"
!insertmacro MUI_LANGUAGE "Breton"
!insertmacro MUI_LANGUAGE "Bulgarian"
!insertmacro MUI_LANGUAGE "Catalan"
!insertmacro MUI_LANGUAGE "Croatian"
!insertmacro MUI_LANGUAGE "Czech"
!insertmacro MUI_LANGUAGE "Danish"
!insertmacro MUI_LANGUAGE "Dutch"
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "Estonian"
!insertmacro MUI_LANGUAGE "Farsi"
!insertmacro MUI_LANGUAGE "Finnish"
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "Greek"
!insertmacro MUI_LANGUAGE "Hebrew"
!insertmacro MUI_LANGUAGE "Hungarian"
!insertmacro MUI_LANGUAGE "Icelandic"
!insertmacro MUI_LANGUAGE "Indonesian"
!insertmacro MUI_LANGUAGE "Italian"
!insertmacro MUI_LANGUAGE "Japanese"
!insertmacro MUI_LANGUAGE "Korean"
!insertmacro MUI_LANGUAGE "Kurdish"
!insertmacro MUI_LANGUAGE "Latvian"
!insertmacro MUI_LANGUAGE "Lithuanian"
!insertmacro MUI_LANGUAGE "Luxembourgish"
!insertmacro MUI_LANGUAGE "Macedonian"
!insertmacro MUI_LANGUAGE "Malay"
!insertmacro MUI_LANGUAGE "Mongolian"
!insertmacro MUI_LANGUAGE "Norwegian"
!insertmacro MUI_LANGUAGE "Polish"
!insertmacro MUI_LANGUAGE "Portuguese"
!insertmacro MUI_LANGUAGE "PortugueseBR"
!insertmacro MUI_LANGUAGE "Romanian"
!insertmacro MUI_LANGUAGE "Russian"
!insertmacro MUI_LANGUAGE "Serbian"
!insertmacro MUI_LANGUAGE "SerbianLatin"
!insertmacro MUI_LANGUAGE "SimpChinese"
!insertmacro MUI_LANGUAGE "Slovak"
!insertmacro MUI_LANGUAGE "Slovenian"
!insertmacro MUI_LANGUAGE "Spanish"
!insertmacro MUI_LANGUAGE "Swedish"
!insertmacro MUI_LANGUAGE "Thai"
!insertmacro MUI_LANGUAGE "TradChinese"
!insertmacro MUI_LANGUAGE "Turkish"
!insertmacro MUI_LANGUAGE "Ukrainian"
!insertmacro MUI_RESERVEFILE_LANGDLL
######################################################################
Function .onInit
#!insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd
######################################################################
Section "iTALC Service"
SectionIn RO
${INSTALL_TYPE}
ExecWait '"$INSTDIR\ica.exe" -quiet -unregisterservice'
SetOverwrite on
SetOutPath "$INSTDIR"
# DLLs
File "${DLLDIR}\Qt5Core.dll"
File "${DLLDIR}\Qt5Gui.dll"
File "${DLLDIR}\Qt5Widgets.dll"
File "${DLLDIR}\Qt5Xml.dll"
File "${DLLDIR}\Qt5Network.dll"
File "${DLLDIR}\libjpeg-9.dll"
File "${DLLDIR}\libeay32.dll"
File "${DLLDIR}\libssl32.dll"
File "${DLLDIR}\libpng16-16.dll"
File "${DLLDIR_LIB}\zlib1.dll"
File "${DLLDIR_LIB}\libwinpthread-1.dll"
File "${DLLDIR_GCC}\libstdc++-6.dll"
File "${DLLDIR_GCC}\${DLL_GCC}"
# core components
File "italc-${VERSION}\ica.exe"
File "italc-${VERSION}\vnchooks.dll"
File "italc-${VERSION}\authSSP.dll"
File "italc-${VERSION}\ItalcCore.dll"
File "italc-${VERSION}\imc.exe"
File "italc-${VERSION}\LICENSE.TXT"
File "italc-${VERSION}\README.TXT"
SetOutPath "$INSTDIR\platforms"
File "${QT5_PLUGINS_PLATFORMS}/qwindows.dll"
File "${QT5_PLUGINS_PLATFORMS}/qminimal.dll"
SetOutPath "$INSTDIR\doc"
File "italc-${VERSION}\doc\*txt"
SetOutPath "$INSTDIR\contrib"
File "italc-${VERSION}\contrib\*"
SetOutPath "$INSTDIR\contrib\en-US"
File "italc-${VERSION}\contrib\en-US\*"
ExecWait '"$INSTDIR\ica.exe" -quiet -registerservice'
ExecWait '"$INSTDIR\imc.exe" -s Network/FirewallExceptionEnabled=1'
ExecWait '"$INSTDIR\ica.exe" -quiet -startservice'
# disable forced guest logon as otherwise logon authentication fails
WriteRegDWORD ${REG_ROOT} "SYSTEM\CurrentControlSet\Control\Lsa" "ForceGuest" "0"
SectionEnd
Section "iTALC Master"
${INSTALL_TYPE}
SetOutPath "$INSTDIR"
File "italc-${VERSION}\italc.exe"
!ifdef REG_START_MENU
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
CreateDirectory "$SMPROGRAMS\$SM_Folder"
CreateShortCut "$SMPROGRAMS\$SM_Folder\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}"
CreateShortCut "$DESKTOP\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}"
!insertmacro MUI_STARTMENU_WRITE_END
!endif
!ifndef REG_START_MENU
CreateDirectory "$SMPROGRAMS\iTALC"
CreateShortCut "$SMPROGRAMS\iTALC\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}"
CreateShortCut "$DESKTOP\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}"
!endif
SectionEnd
Function RunIMC
Exec '"$INSTDIR\imc.exe"'
FunctionEnd
######################################################################
Section -Icons_Reg
SetOutPath "$INSTDIR"
WriteUninstaller "$INSTDIR\uninstall.exe"
!ifdef REG_START_MENU
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
CreateDirectory "$SMPROGRAMS\$SM_Folder"
CreateShortCut "$SMPROGRAMS\$SM_Folder\iTALC Management Console.lnk" "$INSTDIR\imc.exe"
CreateShortCut "$SMPROGRAMS\$SM_Folder\Uninstall iTALC.lnk" "$INSTDIR\uninstall.exe"
WriteIniStr "$INSTDIR\iTALC website.url" "InternetShortcut" "URL" "${WEB_SITE}"
CreateShortCut "$SMPROGRAMS\$SM_Folder\iTALC Website.lnk" "$INSTDIR\iTALC website.url"
!insertmacro MUI_STARTMENU_WRITE_END
!endif
!ifndef REG_START_MENU
CreateDirectory "$SMPROGRAMS\iTALC"
CreateShortCut "$SMPROGRAMS\iTALC\iTALC Management Console.lnk" "$INSTDIR\imc.exe"
CreateShortCut "$SMPROGRAMS\iTALC\Uninstall iTALC.lnk" "$INSTDIR\uninstall.exe"
WriteIniStr "$INSTDIR\iTALC website.url" "InternetShortcut" "URL" "${WEB_SITE}"
CreateShortCut "$SMPROGRAMS\iTALC\iTALC Website.lnk" "$INSTDIR\iTALC website.url"
!endif
WriteRegStr ${REG_ROOT} "${REG_APP_PATH}" "" "$INSTDIR\${MAIN_APP_EXE}"
WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "DisplayName" "iTALC"
WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "UninstallString" "$INSTDIR\uninstall.exe"
WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "DisplayIcon" "$INSTDIR\${MAIN_APP_EXE}"
WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "DisplayVersion" "${VERSION}"
WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "Publisher" "${COMP_NAME}"
WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "URLInfoAbout" "${WEB_SITE}"
SectionEnd
######################################################################
Section Uninstall
${INSTALL_TYPE}
ExecWait '"$INSTDIR\imc.exe" -s Network/FirewallExceptionEnabled=0'
ExecWait '"$INSTDIR\ica.exe" -quiet -unregisterservice'
# make sure the service is stopped and all file handles are released
Sleep 2000
Delete "$INSTDIR\ica.exe"
Delete "$INSTDIR\libwinpthread-1.dll"
Delete "$INSTDIR\libgcc_s_sjlj-1.dll"
Delete "$INSTDIR\libgcc_s_seh-1.dll"
Delete "$INSTDIR\libstdc++-6.dll"
Delete "$INSTDIR\zlib1.dll"
Delete "$INSTDIR\libjpeg-9.dll"
Delete "$INSTDIR\Qt5Xml.dll"
Delete "$INSTDIR\libeay32.dll"
Delete "$INSTDIR\libpng16-16.dll"
Delete "$INSTDIR\Qt5Network.dll"
Delete "$INSTDIR\Qt5Core.dll"
Delete "$INSTDIR\libssl32.dll"
Delete "$INSTDIR\LICENSE.TXT"
Delete "$INSTDIR\authSSP.dll"
Delete "$INSTDIR\vnchooks.dll"
Delete "$INSTDIR\imc.exe"
Delete "$INSTDIR\italc.exe"
Delete "$INSTDIR\README.TXT"
Delete "$INSTDIR\ItalcCore.dll"
Delete "$INSTDIR\Qt5Gui.dll"
Delete "$INSTDIR\Qt5Widgets.dll"
Delete "$INSTDIR\uninstall.exe"
Delete "$INSTDIR\iTALC website.url"
RmDir /r "$INSTDIR\platforms"
RmDir /r "$INSTDIR\doc"
RmDir /r "$INSTDIR\contrib"
RmDir "$INSTDIR"
!ifdef REG_START_MENU
!insertmacro MUI_STARTMENU_GETFOLDER "Application" $SM_Folder
Delete "$SMPROGRAMS\$SM_Folder\iTALC.lnk"
Delete "$SMPROGRAMS\$SM_Folder\Uninstall iTALC.lnk"
Delete "$SMPROGRAMS\$SM_Folder\iTALC Management Console.lnk"
Delete "$SMPROGRAMS\$SM_Folder\iTALC Website.lnk"
Delete "$DESKTOP\iTALC.lnk"
RmDir "$SMPROGRAMS\$SM_Folder"
!endif
!ifndef REG_START_MENU
Delete "$SMPROGRAMS\iTALC\iTALC.lnk"
Delete "$SMPROGRAMS\iTALC\iTALC Management Console.lnk"
Delete "$SMPROGRAMS\iTALC\Uninstall iTALC.lnk"
Delete "$SMPROGRAMS\iTALC\iTALC Website.lnk"
Delete "$DESKTOP\iTALC.lnk"
RmDir "$SMPROGRAMS\iTALC"
!endif
DeleteRegKey ${REG_ROOT} "${REG_APP_PATH}"
DeleteRegKey ${REG_ROOT} "${UNINSTALL_PATH}"
SectionEnd
######################################################################
Function un.onInit
!insertmacro MUI_UNGETLANGUAGE
FunctionEnd
######################################################################