-
Notifications
You must be signed in to change notification settings - Fork 0
/
cuberok-vs.nsi
189 lines (150 loc) · 6.02 KB
/
cuberok-vs.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
!define VERSION "0.1.0-rc0"
Name "Cuberok ${VERSION}"
OutFile "win32-vs\cuberok_setup-${VERSION}.exe"
InstallDir $PROGRAMFILES\Cuberok
; Request application privileges for Windows Vista
RequestExecutionLevel user
; Registry key to check for directory (so if you install again, it will
; overwrite the old one automatically)
InstallDirRegKey HKLM "Software\Cuberok" "Install_Dir"
; First is default
LoadLanguageFile "${NSISDIR}\Contrib\Language files\English.nlf"
LoadLanguageFile "${NSISDIR}\Contrib\Language files\Russian.nlf"
LicenseData license.txt
SetCompressor /SOLID /FINAL lzma
; Pages
Page license
Page components
Page directory
Page instfiles
UninstPage uninstConfirm
UninstPage instfiles
Section "Cuberok"
SectionIn RO
;KillProcDLL::KillProc "cuberok.exe"
;Sleep 100
; Set output path to the installation directory.
SetOutPath $INSTDIR
; Put file there
File "win32-vs\Cuberok.exe"
File "win32-vs\Cuberok.exe.manifest"
CreateDirectory $INSTDIR\translations
File /oname=translations\cuberok_ru.qm "win32-vs\translations\cuberok_ru.qm"
File "win32-vs\tag.dll"
; File "win32-vs\msvcp71.dll"
; File "win32-vs\msvcr71.dll"
File "license.txt"
; CreateDirectory $INSTDIR\Microsoft.VC80.CRT
; File /oname=Microsoft.VC80.CRT\msvcp80.dll "win32-vs\Microsoft.VC80.CRT\msvcp80.dll"
; File /oname=Microsoft.VC80.CRT\msvcr80.dll "win32-vs\Microsoft.VC80.CRT\msvcr80.dll"
; File /oname=Microsoft.VC80.CRT\msvcm80.dll "win32-vs\Microsoft.VC80.CRT\msvcm80.dll"
; File /oname=Microsoft.VC80.CRT\Microsoft.VC80.CRT.manifest "win32-vs\Microsoft.VC80.CRT\Microsoft.VC80.CRT.manifest"
; Write the installation path into the registry
WriteRegStr HKLM SOFTWARE\Cuberok "Install_Dir" "$INSTDIR"
; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cuberok" "DisplayName" "Cuberok"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cuberok" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cuberok" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cuberok" "NoRepair" 1
WriteUninstaller "uninstall.exe"
CreateDirectory "$SMPROGRAMS\Cuberok"
CreateShortCut "$SMPROGRAMS\Cuberok\Cuberok.lnk" "$INSTDIR\Cuberok.exe" "" "$INSTDIR\Cuberok.exe" 0
CreateShortCut "$SMPROGRAMS\Cuberok\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
SectionEnd
; Optional section (can be disabled by the user)
Section "Qt4 library"
File "win32-vs\QtCore4.dll"
File "win32-vs\QtGui4.dll"
File "win32-vs\QtNetwork4.dll"
File "win32-vs\QtSql4.dll"
File "win32-vs\QtXml4.dll"
File "win32-vs\QtWebKit4.dll"
File "win32-vs\phonon4.dll"
CreateDirectory $INSTDIR\phonon_backend
File /oname=phonon_backend\phonon_ds94.dll "win32-vs\phonon_backend\phonon_ds94.dll"
CreateDirectory $INSTDIR\sqldrivers
File /oname=sqldrivers\qsqlite4.dll "win32-vs\sqldrivers\qsqlite4.dll"
CreateDirectory $INSTDIR\imageformats
File /oname=imageformats\qgif4.dll "win32-vs\imageformats\qgif4.dll"
File /oname=imageformats\qjpeg4.dll "win32-vs\imageformats\qjpeg4.dll"
File /oname=imageformats\qmng4.dll "win32-vs\imageformats\qmng4.dll"
File /oname=imageformats\qsvg4.dll "win32-vs\imageformats\qsvg4.dll"
File /oname=imageformats\qtiff4.dll "win32-vs\imageformats\qtiff4.dll"
SectionEnd
Section "MSVC"
InitPluginsDir
SetOutPath $PLUGINSDIR
File "win32-vs\vcredist_x86.exe"
DetailPrint "Installing Visual C++ 2005 Libraries"
ExecWait '"$PLUGINSDIR\vcredist_x86.exe" /q:a /c:"msiexec /i vcredist.msi /quiet"'
SectionEnd
Section "Audiere plugin"
CreateDirectory $INSTDIR\plugins
File "win32-vs\audiere.dll"
File /oname=plugins\player_audiere.dll "win32-vs\plugins\player_audiere.dll"
SectionEnd
;Section "GStreamer plugin"
; CreateDirectory $INSTDIR\plugins
; File /oname=plugins\player_gst.dll "win32-vs\plugins\player_gst.dll"
;SectionEnd
Section "Phonon plugin"
CreateDirectory $INSTDIR\plugins
File /oname=plugins\player_phonon.dll "win32-vs\plugins\player_phonon.dll"
SectionEnd
Section "FFmpeg plugin"
CreateDirectory $INSTDIR\plugins
File /oname=plugins\player_ffmpeg.dll "win32\plugins\player_ffmpeg.dll"
File "win32\avcodec-52.dll"
File "win32\avformat-52.dll"
File "win32\avutil-50.dll"
File "win32\SDL.dll"
SectionEnd
Section "Desktop Shortcut"
CreateShortCut "$DESKTOP\Cuberok.lnk" "$INSTDIR\Cuberok.exe" "" "$INSTDIR\Cuberok.exe" 0
SectionEnd
Section /o "Sources"
File /nonfatal "..\cuberok-${VERSION}.tar.gz"
SectionEnd
Section "Uninstall"
;KillProcDLL::KillProc "cuberok.exe"
Sleep 100
; Remove registry keys
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cuberok"
DeleteRegKey HKLM SOFTWARE\Cuberok
; Remove files and uninstaller
Delete $INSTDIR\uninstall.exe
Delete "$INSTDIR\*.*"
Delete "$INSTDIR\plugins\*.*"
Delete "$INSTDIR\sqldrivers\*.*"
Delete "$INSTDIR\imageformats\*.*"
Delete "$INSTDIR\translations\*.*"
Delete "$INSTDIR\phonon_backend\*.*"
Delete "$INSTDIR\Microsoft.VC80.CRT\*.*"
; Remove shortcuts, if any
Delete "$SMPROGRAMS\Cuberok\*.*"
Delete "$DESKTOP\Cuberok.lnk"
; Remove directories used
RMDir "$SMPROGRAMS\Cuberok"
RMDir "$INSTDIR\translations"
RMDir "$INSTDIR\plugins"
RMDir "$INSTDIR\sqldrivers"
RMDir "$INSTDIR\imageformats"
RMDir "$INSTDIR\phonon_backend"
; RMDir "$INSTDIR\Microsoft.VC80.CRT"
RMDir "$INSTDIR"
SectionEnd
;--------------------------------
Function .onInit
;Language selection dialog
Push ""
Push ${LANG_ENGLISH}
Push English
Push ${LANG_RUSSIAN}
Push Russian
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