1 |
; LinuxSampler Windows installer |
2 |
; |
3 |
; Copyright (C) 2007-2009, The LinuxSampler Developers |
4 |
; |
5 |
; All-in-one Installer for all subprojects / software components of the |
6 |
; LinuxSampler Project. |
7 |
; |
8 |
; PREREQUISITES: |
9 |
; |
10 |
; -> You must install the file cpudesc\cpudesc.dll into the NSIS's |
11 |
; plugin directory before being able to compile this installer! |
12 |
; |
13 |
; -> The compiled binaries must be placed into the respecitve directories |
14 |
; under bin\ (you have to read this file in order to get those exact |
15 |
; locations and expected file names). |
16 |
|
17 |
; Probably the best compression ratio |
18 |
SetCompressor lzma |
19 |
|
20 |
;Include Modern UI |
21 |
!include "MUI.nsh" |
22 |
|
23 |
!define RELEASE_DATE "20090428" |
24 |
|
25 |
; The name of the installer |
26 |
Name "LinuxSampler (${RELEASE_DATE})" |
27 |
|
28 |
; The file to write |
29 |
OutFile "linuxsampler_${RELEASE_DATE}_setup.exe" |
30 |
|
31 |
; Java Runtime Environment, needed for JSampler |
32 |
!define JRE_VERSION "1.6" |
33 |
!define JRE_URL "http://javadl.sun.com/webapps/download/AutoDL?BundleId=11292" |
34 |
|
35 |
; The default installation directory |
36 |
InstallDir $PROGRAMFILES\LinuxSampler |
37 |
|
38 |
; Get installation folder from registry if available |
39 |
InstallDirRegKey HKCU "Software\LinuxSampler" "" |
40 |
|
41 |
;-------------------------------- |
42 |
;Interface Settings |
43 |
|
44 |
!define MUI_HEADERIMAGE |
45 |
!define MUI_HEADERIMAGE_BITMAP "linuxsampler.bmp" |
46 |
!define MUI_ABORTWARNING |
47 |
|
48 |
;-------------------------------- |
49 |
;Version Information |
50 |
|
51 |
VIProductVersion "0.0.0.0" |
52 |
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "all-in-one installer" |
53 |
VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "http://linuxsampler.org" |
54 |
VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "The LinuxSampler Project" |
55 |
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" "" |
56 |
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "� 2003-2009 The LinuxSampler Project" |
57 |
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "LinuxSampler Installer (${RELEASE_DATE})" |
58 |
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "0.0.0" |
59 |
|
60 |
!define BIN_TYPE_64BIT "64 bit" |
61 |
!define BIN_TYPE_686SSE "686 SSE" |
62 |
!define BIN_TYPE_686 "686" |
63 |
|
64 |
;-------------------------------- |
65 |
; Pages |
66 |
|
67 |
!insertmacro MUI_PAGE_LICENSE "license.rtf" |
68 |
!insertmacro MUI_PAGE_COMPONENTS |
69 |
!insertmacro MUI_PAGE_DIRECTORY |
70 |
!insertmacro MUI_PAGE_INSTFILES |
71 |
!insertmacro MUI_UNPAGE_CONFIRM |
72 |
!insertmacro MUI_UNPAGE_INSTFILES |
73 |
|
74 |
;-------------------------------- |
75 |
;Languages |
76 |
|
77 |
!insertmacro MUI_LANGUAGE "English" |
78 |
|
79 |
;-------------------------------- |
80 |
|
81 |
Function .onInit |
82 |
Var /GLOBAL installingLinuxSampler |
83 |
Var /GLOBAL installingJSampler |
84 |
Var /GLOBAL installingQSampler |
85 |
Var /GLOBAL installinggigedit |
86 |
StrCpy $installingLinuxSampler "0" |
87 |
StrCpy $installingJSampler "0" |
88 |
StrCpy $installingQSampler "0" |
89 |
StrCpy $installinggigedit "0" |
90 |
FunctionEnd |
91 |
|
92 |
; detects CPU capabilities and determmines which native binary type to install |
93 |
Function DetectSystemType |
94 |
Var /GLOBAL binType |
95 |
|
96 |
; check if this is a 64 bit windows |
97 |
System::Call "kernel32::GetCurrentProcess() i .s" |
98 |
System::Call "kernel32::IsWow64Process(i s, *i .r0)" |
99 |
IntCmp $0 0 not64bit |
100 |
StrCpy $binType BIN_TYPE_64BIT |
101 |
DetailPrint "64 bit Windows detected." |
102 |
Goto DetectSystemDone |
103 |
|
104 |
not64bit: ; a 32 bit system |
105 |
|
106 |
; check if CPU supports SSE |
107 |
cpudesc::tell |
108 |
Pop $0 ; full identification string in $0 |
109 |
StrCpy $1 $0 1, 34 ; pull out one character after SSE= |
110 |
IntFmt $2 "%u" $1 ; and turn it into a number |
111 |
IntCmpU $2 1 +1 +4 +4 |
112 |
StrCpy $binType BIN_TYPE_686SSE |
113 |
DetailPrint "32 bit Windows, SSE CPU detected." |
114 |
Goto DetectSystemDone |
115 |
StrCpy $binType BIN_TYPE_686 |
116 |
DetailPrint "32 bit Windows (no SSE support) detected." |
117 |
|
118 |
DetectSystemDone: |
119 |
FunctionEnd |
120 |
|
121 |
; Check for the presence of gtkmm, and if false, ask the user whether to |
122 |
; download and install gtkmm now from the internet. |
123 |
Function CheckForGtkmm |
124 |
Var /GLOBAL gtkmmSetupFile |
125 |
|
126 |
ClearErrors |
127 |
; This is just a lazy check for the presence of gtkmm, we should better use: |
128 |
; System::Call function (NSI internal function) to actually call an arbitrary |
129 |
; gtkmm function (/method) from a gtkmm DLL to make it certain |
130 |
ReadRegStr $0 HKCU "Software\gtkmm\2.4" "Installer Language" |
131 |
IfErrors +2 0 |
132 |
goto NoAbort |
133 |
MessageBox MB_YESNO "gtkmm not found. Install it now (internet connection needed)?" IDYES InstallGtkmm |
134 |
MessageBox MB_YESNO "gigedit won't work without gtkmm. Continue anyway?" IDYES NoAbort |
135 |
Abort ; causes installer to quit |
136 |
InstallGtkmm: |
137 |
ClearErrors |
138 |
StrCpy $gtkmmSetupFile $TEMP\gtkmm-win32-runtime-2.10.11-1.exe |
139 |
NSISdl::download "http://ftp.gnome.org/pub/gnome/binaries/win32/gtkmm/2.10/gtkmm-win32-runtime-2.10.11-1.exe" $gtkmmSetupFile |
140 |
IfErrors 0 +2 |
141 |
Goto InstallGtkmmFailed |
142 |
ExecWait $gtkmmSetupFile |
143 |
Delete $gtkmmSetupFile ; we don't need it anymore |
144 |
IfErrors 0 +2 |
145 |
Goto InstallGtkmmFailed |
146 |
Goto NoAbort |
147 |
InstallGtkmmFailed: |
148 |
MessageBox MB_YESNO "Could not download gtkmm. gigedit won't work without gtkmm. Continue anyway?" IDYES NoAbort |
149 |
Abort ; causes installer to quit |
150 |
NoAbort: |
151 |
FunctionEnd |
152 |
|
153 |
; Downloads and launches the JRE installer from the internet |
154 |
Function GetJRE |
155 |
MessageBox MB_OK "JSampler requires Java ${JRE_VERSION}, it will now \ |
156 |
be downloaded and installed" |
157 |
|
158 |
StrCpy $2 "$TEMP\Java Runtime Environment.exe" |
159 |
nsisdl::download /TIMEOUT=30000 ${JRE_URL} $2 |
160 |
Pop $R0 ;Get the return value |
161 |
StrCmp $R0 "success" +3 |
162 |
MessageBox MB_OK "Download failed: $R0" |
163 |
Quit |
164 |
ExecWait $2 |
165 |
Delete $2 |
166 |
FunctionEnd |
167 |
|
168 |
; Checks if the JRE is already installed, if not it will download and install it from the internet |
169 |
Function DetectJRE |
170 |
ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" \ |
171 |
"CurrentVersion" |
172 |
StrCmp $2 ${JRE_VERSION} done |
173 |
|
174 |
Call GetJRE |
175 |
|
176 |
done: |
177 |
FunctionEnd |
178 |
|
179 |
;-------------------------------- |
180 |
|
181 |
; primer things to do |
182 |
Section "" |
183 |
Call DetectSystemType |
184 |
SectionEnd |
185 |
|
186 |
;-------------------------------- |
187 |
|
188 |
; The stuff to install |
189 |
Section "LinuxSampler 0.5.1" SecLinuxSampler |
190 |
DetailPrint "Installing LinuxSampler binaries ..." |
191 |
StrCpy $installingLinuxSampler "1" |
192 |
|
193 |
; Set output path to the installation directory. |
194 |
SetOutPath $INSTDIR |
195 |
|
196 |
StrCmp $binType BIN_TYPE_64BIT linuxsampler64 |
197 |
StrCmp $binType BIN_TYPE_686SSE linuxsampler686sse |
198 |
Goto linuxsampler686 |
199 |
|
200 |
; Files to install |
201 |
|
202 |
linuxsampler64: |
203 |
;File bin\64\linuxsampler.exe |
204 |
;File bin\64\liblinuxsampler-1.dll |
205 |
Goto done |
206 |
|
207 |
linuxsampler686sse: |
208 |
;File bin\686sse\linuxsampler.exe |
209 |
;File bin\686sse\liblinuxsampler-1.dll |
210 |
Goto done |
211 |
|
212 |
linuxsampler686: |
213 |
;File bin\686\linuxsampler.exe |
214 |
;File bin\686\liblinuxsampler-1.dll |
215 |
Goto done |
216 |
|
217 |
done: |
218 |
SectionEnd |
219 |
|
220 |
Section "JSampler 'Fantasia' 0.8a" SecJSampler |
221 |
DetailPrint "Installing JSampler binaries ..." |
222 |
; make sure JRE is installed |
223 |
Call DetectJRE |
224 |
StrCpy $installingJSampler "1" |
225 |
; Set output path to the installation directory. |
226 |
SetOutPath $INSTDIR |
227 |
; Files to install |
228 |
;File bin\Fantasia-0.8a.jar |
229 |
;File jsampler.ico |
230 |
SectionEnd |
231 |
|
232 |
Section "QSampler 0.2.1" SecQSampler |
233 |
DetailPrint "Installing QSampler binaries ..." |
234 |
StrCpy $installingQSampler "1" |
235 |
; Set output path to the installation directory. |
236 |
SetOutPath $INSTDIR |
237 |
; Files to install |
238 |
;File bin\qsampler.exe |
239 |
;File bin\QtCore4.dll |
240 |
;File bin\QtGui4.dll |
241 |
;File bin\mingwm10.dll |
242 |
;File qsampler.ico |
243 |
SectionEnd |
244 |
|
245 |
Section "gigedit 0.1.1" Secgigedit |
246 |
DetailPrint "Installing gigedit binaries ..." |
247 |
StrCpy $installinggigedit "1" |
248 |
|
249 |
; make sure gtkmm is installed |
250 |
Call CheckForGtkmm |
251 |
; Set output path to the installation directory. |
252 |
SetOutPath $INSTDIR |
253 |
|
254 |
StrCmp $binType BIN_TYPE_64BIT gigedit64 |
255 |
StrCmp $binType BIN_TYPE_686SSE gigedit686sse |
256 |
Goto gigedit686 |
257 |
|
258 |
; Files to install |
259 |
|
260 |
gigedit64: |
261 |
;File bin\64\gigedit.exe |
262 |
SetOutPath "$INSTDIR\Plugins" |
263 |
;File bin\64\libgigedit.dll |
264 |
Goto done |
265 |
|
266 |
gigedit686sse: |
267 |
;File bin\686sse\gigedit.exe |
268 |
SetOutPath "$INSTDIR\Plugins" |
269 |
;File bin\686sse\libgigedit.dll |
270 |
Goto done |
271 |
|
272 |
gigedit686: |
273 |
;File bin\686\gigedit.exe |
274 |
SetOutPath "$INSTDIR\Plugins" |
275 |
;File bin\686\libgigedit.dll |
276 |
Goto done |
277 |
|
278 |
done: |
279 |
SectionEnd |
280 |
|
281 |
Section "libgig 3.2.1" Seclibgig |
282 |
DetailPrint "Installing libgig binaries ..." |
283 |
; We make this a mandatory component |
284 |
SectionIn RO |
285 |
; Set output path to the installation directory. |
286 |
SetOutPath $INSTDIR |
287 |
|
288 |
StrCmp $binType BIN_TYPE_64BIT libgig64 |
289 |
StrCmp $binType BIN_TYPE_686SSE libgig686sse |
290 |
Goto libgig686 |
291 |
|
292 |
; Files to install |
293 |
|
294 |
libgig64: |
295 |
;File bin\64\libgig-6.dll |
296 |
;File bin\64\rifftree.exe |
297 |
;File bin\64\dlsdump.exe |
298 |
;File bin\64\gigdump.exe |
299 |
;File bin\64\gigextract.exe |
300 |
Goto done |
301 |
|
302 |
libgig686sse: |
303 |
;File bin\686sse\libgig-6.dll |
304 |
;File bin\686sse\rifftree.exe |
305 |
;File bin\686sse\dlsdump.exe |
306 |
;File bin\686sse\gigdump.exe |
307 |
;File bin\686sse\gigextract.exe |
308 |
Goto done |
309 |
|
310 |
libgig686: |
311 |
;File bin\686\libgig-6.dll |
312 |
;File bin\686\rifftree.exe |
313 |
;File bin\686\dlsdump.exe |
314 |
;File bin\686\gigdump.exe |
315 |
;File bin\686\gigextract.exe |
316 |
Goto done |
317 |
|
318 |
done: |
319 |
|
320 |
; As this is a mandatory component, we misuse it to install the uninstaller as well ... |
321 |
; Write the uninstall keys for Windows |
322 |
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "DisplayName" "LinuxSampler ${RELEASE_DATE}" |
323 |
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "UninstallString" '"$INSTDIR\uninstall.exe"' |
324 |
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "NoModify" 1 |
325 |
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "NoRepair" 1 |
326 |
WriteUninstaller "uninstall.exe" |
327 |
;Store installation folder |
328 |
WriteRegStr HKCU "Software\LinuxSampler" "" $INSTDIR |
329 |
SectionEnd |
330 |
|
331 |
Section "libsndfile 1.0.17" Seclibsndfile |
332 |
DetailPrint "Installing libsndfile binaries ..." |
333 |
; We make this a mandatory component |
334 |
SectionIn RO |
335 |
; Set output path to the installation directory. |
336 |
SetOutPath $INSTDIR |
337 |
|
338 |
StrCmp $binType BIN_TYPE_64BIT libsndfile64 |
339 |
; I think we don't need a SSE optimized 32 bit binary for libsndfile, one 64bit and one simple 32 bit DLL should be sufficient |
340 |
;StrCmp $binType BIN_TYPE_686SSE libsndfile686sse |
341 |
Goto libsndfile686 |
342 |
|
343 |
; Files to install |
344 |
|
345 |
libsndfile64: |
346 |
;File bin\64\libsndfile-1.dll |
347 |
Goto done |
348 |
|
349 |
libsndfile686: |
350 |
;File bin\686\libsndfile-1.dll |
351 |
Goto done |
352 |
|
353 |
done: |
354 |
SectionEnd |
355 |
|
356 |
Section "Start Menu Shortcuts" SecShortcuts |
357 |
CreateDirectory "$SMPROGRAMS\LinuxSampler" |
358 |
|
359 |
CreateShortCut "$SMPROGRAMS\LinuxSampler\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 |
360 |
|
361 |
StrCmp $installingLinuxSampler '1' 0 +2 |
362 |
CreateShortCut "$SMPROGRAMS\LinuxSampler\LinuxSampler 0.5.1 (backend).lnk" "$INSTDIR\linuxsampler.exe" "" "$INSTDIR\linuxsampler.exe" 0 |
363 |
|
364 |
StrCmp $installingJSampler '1' 0 +2 |
365 |
CreateShortCut '$SMPROGRAMS\LinuxSampler\JSampler Fantasia 0.8a (frontend).lnk' 'javaw' '-jar "$INSTDIR\Fantasia-0.8a.jar"' '$INSTDIR\jsampler.ico' 0 |
366 |
|
367 |
StrCmp $installingQSampler '1' 0 +2 |
368 |
CreateShortCut "$SMPROGRAMS\LinuxSampler\QSampler 0.2.1 (frontend).lnk" "$INSTDIR\qsampler.exe" "" "$INSTDIR\qsampler.ico" 0 |
369 |
|
370 |
StrCmp $installinggigedit '1' 0 +2 |
371 |
CreateShortCut "$SMPROGRAMS\LinuxSampler\gigedit 0.1.1 (stand alone).lnk" "$INSTDIR\gigedit.exe" "" "$INSTDIR\gigedit.exe" 0 |
372 |
SectionEnd |
373 |
|
374 |
;-------------------------------- |
375 |
|
376 |
; Uninstaller |
377 |
|
378 |
Section "Uninstall" |
379 |
; Remove registry keys |
380 |
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" |
381 |
; Remove files and uninstaller |
382 |
Delete $INSTDIR\*.* |
383 |
Delete $INSTDIR\plugins\*.* |
384 |
; Remove shortcuts, if any |
385 |
Delete "$SMPROGRAMS\LinuxSampler\*.*" |
386 |
; Remove directories used |
387 |
RMDir "$SMPROGRAMS\LinuxSampler" |
388 |
RMDir "$INSTDIR\plugins" |
389 |
RMDir "$INSTDIR" |
390 |
SectionEnd |
391 |
|
392 |
;-------------------------------- |
393 |
;Descriptions |
394 |
|
395 |
;Language strings |
396 |
LangString DESC_SecLinuxSampler ${LANG_ENGLISH} "Sampler backend, including sampler engine, MIDI and audio drivers, native C++ API as well as network (LSCP) API. Use a frontend application like JSampler or QSampler to control the sampler." |
397 |
LangString DESC_SecJSampler ${LANG_ENGLISH} "Graphical frontend (user interface) for LinuxSampler written in Java, supporting all current features of LinuxSampler. This is the 'Fantasia' distribution of JSampler, offering a modern skin based look." |
398 |
LangString DESC_SecQSampler ${LANG_ENGLISH} "Graphical light-weight frontend (user interface) for LinuxSampler written in C++, offering a fast native user interface. NOTE: QSampler doesn't support all LinuxSampler features yet!" |
399 |
LangString DESC_Secgigedit ${LANG_ENGLISH} "Graphical instrument editor for Gigasampler format v2 and v3 files. Can be used stand-alone or in conjunction with LinuxSampler. NOTE: this is yet an early development version!" |
400 |
LangString DESC_Seclibgig ${LANG_ENGLISH} "C++ program library for accessing DLS (Level 1 and Level 2) and Gigasampler format (v2 and v3) files. This library is required by LinuxSampler, gigedit and QSampler." |
401 |
LangString DESC_Seclibsndfile ${LANG_ENGLISH} "C program library for reading and writing files containing sampled sound (such as MS Windows WAV and the Apple/SGI AIFF format), used by gigedit to import samples." |
402 |
LangString DESC_SecShortcuts ${LANG_ENGLISH} "Installs start menu shortcuts for all applications." |
403 |
|
404 |
;Assign language strings to sections |
405 |
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN |
406 |
!insertmacro MUI_DESCRIPTION_TEXT ${SecLinuxSampler} $(DESC_SecLinuxSampler) |
407 |
!insertmacro MUI_DESCRIPTION_TEXT ${SecJSampler} $(DESC_SecJSampler) |
408 |
!insertmacro MUI_DESCRIPTION_TEXT ${SecQSampler} $(DESC_SecQSampler) |
409 |
!insertmacro MUI_DESCRIPTION_TEXT ${Secgigedit} $(DESC_Secgigedit) |
410 |
!insertmacro MUI_DESCRIPTION_TEXT ${Seclibgig} $(DESC_Seclibgig) |
411 |
!insertmacro MUI_DESCRIPTION_TEXT ${Seclibsndfile} $(DESC_Seclibsndfile) |
412 |
!insertmacro MUI_DESCRIPTION_TEXT ${SecShortcuts} $(DESC_SecShortcuts) |
413 |
!insertmacro MUI_FUNCTION_DESCRIPTION_END |