-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.nsi
250 lines (200 loc) · 7.57 KB
/
install.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
############################################################################################
# NSIS Installation Script created by NSIS Quick Setup Script Generator v1.09.18
# Entirely Edited with NullSoft Scriptable Installation System
# by Vlasis K. Barkas aka Red Wine red_wine@freemail.gr Sep 2006
############################################################################################
!define RELEASE_FOLDER "build\src\jucevlc_artefacts\Release\"
!define APP_NAME "JuceVLC"
!define COMP_NAME "Matthieu A."
!define WEB_SITE "https://github.com/maudoin/jucevlc"
!define VERSION "00.09.07.00"
!define V "0.9.7"
!define COPYRIGHT "Matthieu A. © 2024"
!define DESCRIPTION "JuceVLC Video Player"
!define INSTALLER_NAME "${APP_NAME}setup-${V}.exe"
!define MAIN_APP_EXE "juceVLC.exe"
!define INSTALL_TYPE "SetShellVarContext current"
!define REG_START_MENU "Start Menu Folder"
RequestExecutionLevel user
var SM_Folder
######################################################################
VIProductVersion "${VERSION}"
VIAddVersionKey "ProductName" "${APP_NAME}"
VIAddVersionKey "CompanyName" "${COMP_NAME}"
VIAddVersionKey "LegalCopyright" "${COPYRIGHT}"
VIAddVersionKey "FileDescription" "${DESCRIPTION}"
VIAddVersionKey "FileVersion" "${VERSION}"
######################################################################
SetCompressor /SOLID Bzip2
Name "${APP_NAME}"
Caption "${APP_NAME}"
OutFile "${INSTALLER_NAME}"
BrandingText "${APP_NAME}"
XPStyle on
InstallDir "$LOCALAPPDATA\${APP_NAME}-${V}"
AllowRootDirInstall false
######################################################################
!include "MUI.nsh"
!define MUI_ABORTWARNING
!define MUI_UNABORTWARNING
; MUI Settings / Icons
!define MUI_ICON "icons\vlc.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall-nsis.ico"
; MUI Settings / Header
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_RIGHT
!define MUI_HEADERIMAGE_BITMAP_NOSTRETCH
!define MUI_HEADERIMAGE_BITMAP "installer\logo.bmp"
!define MUI_HEADERIMAGE_UNBITMAP "installer\logo.bmp"
!insertmacro MUI_PAGE_DIRECTORY
!ifdef REG_START_MENU
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "JuceVLC"
!insertmacro MUI_PAGE_STARTMENU Application $SM_Folder
!endif
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_RUN "$INSTDIR\${MAIN_APP_EXE}"
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "Dutch"
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "Korean"
!insertmacro MUI_LANGUAGE "Russian"
!insertmacro MUI_LANGUAGE "Spanish"
!insertmacro MUI_LANGUAGE "Swedish"
!insertmacro MUI_LANGUAGE "TradChinese"
!insertmacro MUI_LANGUAGE "SimpChinese"
!insertmacro MUI_LANGUAGE "Slovak"
######################################################################
Section -MainProgram
${INSTALL_TYPE}
SetOverwrite ifnewer
SetOutPath "$INSTDIR"
File /a "${RELEASE_FOLDER}\${MAIN_APP_EXE}"
File /a "${RELEASE_FOLDER}\libvlc.dll"
File /a "${RELEASE_FOLDER}\libvlccore.dll"
SetOutPath "$INSTDIR\plugins"
File /a /r "${RELEASE_FOLDER}\plugins\*.*"
SectionEnd
######################################################################
Section -Icons_Reg
SetOutPath "$INSTDIR"
WriteUninstaller "$INSTDIR\uninstall.exe"
!ifdef REG_START_MENU
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
SetShellVarContext current
CreateDirectory "$SMPROGRAMS\$SM_Folder"
CreateShortCut "$SMPROGRAMS\$SM_Folder\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}"
CreateShortCut "$DESKTOP\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}"
CreateShortCut "$SMPROGRAMS\$SM_Folder\Uninstall ${APP_NAME}.lnk" "$INSTDIR\uninstall.exe"
!ifdef WEB_SITE
WriteIniStr "$INSTDIR\${APP_NAME} website.url" "InternetShortcut" "URL" "${WEB_SITE}"
CreateShortCut "$SMPROGRAMS\$SM_Folder\${APP_NAME} Website.lnk" "$INSTDIR\${APP_NAME} website.url"
!endif
!insertmacro MUI_STARTMENU_WRITE_END
!endif
!ifndef REG_START_MENU
CreateDirectory "$SMPROGRAMS\${APP_NAME}"
CreateShortCut "$SMPROGRAMS\${APP_NAME}\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}"
CreateShortCut "$DESKTOP\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}"
CreateShortCut "$SMPROGRAMS\${APP_NAME}\Uninstall ${APP_NAME}.lnk" "$INSTDIR\uninstall.exe"
!ifdef WEB_SITE
WriteIniStr "$INSTDIR\${APP_NAME} website.url" "InternetShortcut" "URL" "${WEB_SITE}"
CreateShortCut "$SMPROGRAMS\${APP_NAME}\${APP_NAME} Website.lnk" "$INSTDIR\${APP_NAME} website.url"
!endif
!endif
SectionEnd
######################################################################
Section Uninstall
FindProcDLL::FindProc ${MAIN_APP_EXE}
IntCmp $R0 1 0 notRunning
MessageBox MB_OK|MB_ICONEXCLAMATION "JuceVLC is running. Please close it first" /SD IDOK
Abort
notRunning:
${INSTALL_TYPE}
Delete "$INSTDIR\${MAIN_APP_EXE}"
RmDir /r "$INSTDIR\plugins\*.*"
RmDir "$INSTDIR\plugins"
Delete "$INSTDIR\plugins.dat"
Delete "$INSTDIR\France.lang"
Delete "$INSTDIR\mediaTimes.xml"
Delete "$INSTDIR\settings.xml"
Delete "$INSTDIR\shortcuts.list"
Delete "$INSTDIR\libvlccore.dll"
Delete "$INSTDIR\libvlc.dll"
Delete "$INSTDIR\uninstall.exe"
Delete "$INSTDIR\France.lang.sample"
Delete "$INSTDIR\thumbnails"
Delete "$INSTDIR\README.txt"
!ifdef WEB_SITE
Delete "$INSTDIR\${APP_NAME} website.url"
!endif
RmDir "$INSTDIR"
!ifdef REG_START_MENU
SetShellVarContext current
!insertmacro MUI_STARTMENU_GETFOLDER "Application" $SM_Folder
Delete "$SMPROGRAMS\$SM_Folder\${APP_NAME}.lnk"
Delete "$SMPROGRAMS\$SM_Folder\Uninstall ${APP_NAME}.lnk"
!ifdef WEB_SITE
Delete "$SMPROGRAMS\$SM_Folder\${APP_NAME} Website.lnk"
!endif
Delete "$DESKTOP\${APP_NAME}.lnk"
RmDir "$SMPROGRAMS\$SM_Folder"
!endif
!ifndef REG_START_MENU
Delete "$SMPROGRAMS\JuceVLC\${APP_NAME}.lnk"
Delete "$SMPROGRAMS\JuceVLC\Uninstall ${APP_NAME}.lnk"
!ifdef WEB_SITE
Delete "$SMPROGRAMS\JuceVLC\${APP_NAME} Website.lnk"
!endif
Delete "$DESKTOP\${APP_NAME}.lnk"
RmDir "$SMPROGRAMS\JuceVLC"
!endif
SectionEnd
######################################################################
######################################################################
Function .onInit
;File /oname=$TEMP\vlc.bmp "installer\vlc.bmp"
;advsplash::show 1000 600 400 0xFFFFFF $TEMP\vlc
;Pop $0 ; $0 has '1' if the user closed the splash screen early,
; '0' if everything closed normally, and '-1' if some error occurred.
;Delete $TEMP\vlc.bmp
FindProcDLL::FindProc ${MAIN_APP_EXE}
IntCmp $R0 1 0 notRunning
MessageBox MB_OK|MB_ICONEXCLAMATION "JuceVLC is running. Please close it first" /SD IDOK
Abort
notRunning:
;Language selection dialog
Push ""
Push ${LANG_ENGLISH}
Push English
Push ${LANG_DUTCH}
Push Dutch
Push ${LANG_FRENCH}
Push French
Push ${LANG_GERMAN}
Push German
Push ${LANG_KOREAN}
Push Korean
Push ${LANG_RUSSIAN}
Push Russian
Push ${LANG_SPANISH}
Push Spanish
Push ${LANG_SWEDISH}
Push Swedish
Push ${LANG_TRADCHINESE}
Push "Traditional Chinese"
Push ${LANG_SIMPCHINESE}
Push "Simplified Chinese"
Push ${LANG_SLOVAK}
Push Slovak
Push A ; A means auto count languages
; for the auto count to work the first empty push (Push "") must remain
LangDLL::LangDialog "Installer Language" "Please select the language of the installer"
Pop $LANGUAGE
StrCmp $LANGUAGE "cancel" 0 +2
Abort
FunctionEnd