1 |
; LinuxSampler Windows installer |
; LinuxSampler Windows installer |
2 |
; |
; |
3 |
; Copyright (C) 2007, The LinuxSampler Developers |
; Copyright (C) 2007-2009, The LinuxSampler Developers |
4 |
; |
; |
5 |
; All-in-one Installer for all subprojects / software components of the |
; All-in-one Installer for all subprojects / software components of the |
6 |
; LinuxSampler Project. |
; 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 |
; Probably the best compression ratio |
18 |
SetCompressor lzma |
SetCompressor lzma |
20 |
;Include Modern UI |
;Include Modern UI |
21 |
!include "MUI.nsh" |
!include "MUI.nsh" |
22 |
|
|
23 |
|
!define RELEASE_DATE "20090428" |
24 |
|
|
25 |
; The name of the installer |
; The name of the installer |
26 |
Name "LinuxSampler" |
Name "LinuxSampler (${RELEASE_DATE})" |
27 |
|
|
28 |
; The file to write |
; The file to write |
29 |
OutFile "linuxsampler_20071206_setup.exe" |
OutFile "linuxsampler_${RELEASE_DATE}_setup.exe" |
30 |
|
|
31 |
; Java Runtime Environment, needed for JSampler |
; Java Runtime Environment, needed for JSampler |
32 |
!define JRE_VERSION "1.6" |
!define JRE_VERSION "1.6" |
38 |
; Get installation folder from registry if available |
; Get installation folder from registry if available |
39 |
InstallDirRegKey HKCU "Software\LinuxSampler" "" |
InstallDirRegKey HKCU "Software\LinuxSampler" "" |
40 |
|
|
|
;LoadLanguageFile "${NSISDIR}\Contrib\Language files\English.nlf" |
|
|
|
|
41 |
;-------------------------------- |
;-------------------------------- |
42 |
;Interface Settings |
;Interface Settings |
43 |
|
|
49 |
;Version Information |
;Version Information |
50 |
|
|
51 |
VIProductVersion "0.0.0.0" |
VIProductVersion "0.0.0.0" |
52 |
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "LinuxSampler Installer" |
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "all-in-one installer" |
53 |
VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "http://linuxsampler.org" |
VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "http://linuxsampler.org" |
54 |
VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "The LinuxSampler Project" |
VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "The LinuxSampler Project" |
55 |
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" "" |
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" "" |
56 |
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "© 2003-2007 The LinuxSampler Project" |
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "© 2003-2009 The LinuxSampler Project" |
57 |
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "all-in-one installer" |
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "LinuxSampler Installer (${RELEASE_DATE})" |
58 |
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "0.0.0" |
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 |
; Pages |
66 |
|
|
|
;Page license |
|
|
;Page components |
|
|
;Page directory |
|
|
;Page instfiles |
|
|
|
|
67 |
!insertmacro MUI_PAGE_LICENSE "license.rtf" |
!insertmacro MUI_PAGE_LICENSE "license.rtf" |
68 |
!insertmacro MUI_PAGE_COMPONENTS |
!insertmacro MUI_PAGE_COMPONENTS |
69 |
!insertmacro MUI_PAGE_DIRECTORY |
!insertmacro MUI_PAGE_DIRECTORY |
71 |
!insertmacro MUI_UNPAGE_CONFIRM |
!insertmacro MUI_UNPAGE_CONFIRM |
72 |
!insertmacro MUI_UNPAGE_INSTFILES |
!insertmacro MUI_UNPAGE_INSTFILES |
73 |
|
|
|
;UninstPage uninstConfirm |
|
|
;UninstPage instfiles |
|
|
|
|
|
;LicenseData license.rtf |
|
|
|
|
74 |
;-------------------------------- |
;-------------------------------- |
75 |
;Languages |
;Languages |
76 |
|
|
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 |
; Check for the presence of gtkmm, and if false, ask the user whether to |
122 |
; download and install gtkmm now from the internet. |
; download and install gtkmm now from the internet. |
123 |
Function CheckForGtkmm |
Function CheckForGtkmm |
124 |
Var /GLOBAL gtkmmSetupFile |
Var /GLOBAL gtkmmSetupFile |
125 |
|
|
126 |
|
ClearErrors |
127 |
; This is just a lazy check for the presence of gtkmm, we should better use: |
; 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 |
; System::Call function (NSI internal function) to actually call an arbitrary |
129 |
; gtkmm function (/method) from a gtkmm DLL to make it certain |
; gtkmm function (/method) from a gtkmm DLL to make it certain |
178 |
|
|
179 |
;-------------------------------- |
;-------------------------------- |
180 |
|
|
181 |
|
; primer things to do |
182 |
|
Section "" |
183 |
|
Call DetectSystemType |
184 |
|
SectionEnd |
185 |
|
|
186 |
|
;-------------------------------- |
187 |
|
|
188 |
; The stuff to install |
; The stuff to install |
189 |
Section "LinuxSampler 0.5.1" SecLinuxSampler |
Section "LinuxSampler 0.5.1" SecLinuxSampler |
190 |
|
DetailPrint "Installing LinuxSampler binaries ..." |
191 |
|
StrCpy $installingLinuxSampler "1" |
192 |
|
|
193 |
; Set output path to the installation directory. |
; Set output path to the installation directory. |
194 |
SetOutPath $INSTDIR |
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 |
; Files to install |
201 |
; File linuxsampler.exe |
|
202 |
; File liblinuxsampler.dll |
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 |
SectionEnd |
219 |
|
|
220 |
Section "JSampler 'Fantasia' 0.0.1" SecJSampler |
Section "JSampler 'Fantasia' 0.8a" SecJSampler |
221 |
|
DetailPrint "Installing JSampler binaries ..." |
222 |
; make sure JRE is installed |
; make sure JRE is installed |
223 |
Call DetectJRE |
Call DetectJRE |
224 |
|
StrCpy $installingJSampler "1" |
225 |
; Set output path to the installation directory. |
; Set output path to the installation directory. |
226 |
SetOutPath $INSTDIR |
SetOutPath $INSTDIR |
227 |
; Files to install |
; Files to install |
228 |
; File jsampler.jar |
;File bin\Fantasia-0.8a.jar |
229 |
|
;File jsampler.ico |
230 |
SectionEnd |
SectionEnd |
231 |
|
|
232 |
Section "QSampler 0.2.0" SecQSampler |
Section "QSampler 0.2.1" SecQSampler |
233 |
|
DetailPrint "Installing QSampler binaries ..." |
234 |
|
StrCpy $installingQSampler "1" |
235 |
; Set output path to the installation directory. |
; Set output path to the installation directory. |
236 |
SetOutPath $INSTDIR |
SetOutPath $INSTDIR |
237 |
; Files to install |
; Files to install |
238 |
; File qsampler.exe |
;File bin\qsampler.exe |
239 |
; File liblscp.dll |
;File bin\QtCore4.dll |
240 |
|
;File bin\QtGui4.dll |
241 |
|
;File bin\mingwm10.dll |
242 |
|
;File qsampler.ico |
243 |
SectionEnd |
SectionEnd |
244 |
|
|
245 |
Section "gigedit 0.1.1" Secgigedit |
Section "gigedit 0.1.1" Secgigedit |
246 |
|
DetailPrint "Installing gigedit binaries ..." |
247 |
|
StrCpy $installinggigedit "1" |
248 |
|
|
249 |
; make sure gtkmm is installed |
; make sure gtkmm is installed |
250 |
Call CheckForGtkmm |
Call CheckForGtkmm |
251 |
; Set output path to the installation directory. |
; Set output path to the installation directory. |
252 |
SetOutPath $INSTDIR |
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 |
; Files to install |
259 |
; File gigedit.exe |
|
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" |
SetOutPath "$INSTDIR\Plugins" |
275 |
; File libgigedit.dll |
;File bin\686\libgigedit.dll |
276 |
|
Goto done |
277 |
|
|
278 |
|
done: |
279 |
SectionEnd |
SectionEnd |
280 |
|
|
281 |
Section "libgig 3.2.1" Seclibgig |
Section "libgig 3.2.1" Seclibgig |
282 |
|
DetailPrint "Installing libgig binaries ..." |
283 |
; We make this a mandatory component |
; We make this a mandatory component |
284 |
SectionIn RO |
SectionIn RO |
285 |
; Set output path to the installation directory. |
; Set output path to the installation directory. |
286 |
SetOutPath $INSTDIR |
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 |
; Files to install |
293 |
; File libgig.dll |
|
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 ... |
; As this is a mandatory component, we misuse it to install the uninstaller as well ... |
321 |
; Write the uninstall keys for Windows |
; Write the uninstall keys for Windows |
322 |
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "DisplayName" "LinuxSampler 2007-12-05" |
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"' |
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "UninstallString" '"$INSTDIR\uninstall.exe"' |
324 |
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "NoModify" 1 |
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "NoModify" 1 |
325 |
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "NoRepair" 1 |
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "NoRepair" 1 |
329 |
SectionEnd |
SectionEnd |
330 |
|
|
331 |
Section "libsndfile 1.0.17" Seclibsndfile |
Section "libsndfile 1.0.17" Seclibsndfile |
332 |
|
DetailPrint "Installing libsndfile binaries ..." |
333 |
; We make this a mandatory component |
; We make this a mandatory component |
334 |
SectionIn RO |
SectionIn RO |
335 |
; Set output path to the installation directory. |
; Set output path to the installation directory. |
336 |
SetOutPath $INSTDIR |
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 |
; Files to install |
344 |
; File libsndfile-1.dll |
|
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 |
SectionEnd |
355 |
|
|
356 |
Section "Start Menu Shortcuts" SecShortcuts |
Section "Start Menu Shortcuts" SecShortcuts |
357 |
CreateDirectory "$SMPROGRAMS\LinuxSampler" |
CreateDirectory "$SMPROGRAMS\LinuxSampler" |
358 |
|
|
359 |
CreateShortCut "$SMPROGRAMS\LinuxSampler\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 |
CreateShortCut "$SMPROGRAMS\LinuxSampler\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 |
360 |
CreateShortCut "$SMPROGRAMS\LinuxSampler\LinuxSampler (backend).lnk" "$INSTDIR\linuxsampler.exe" "" "$INSTDIR\linuxsampler.exe" 0 |
|
361 |
CreateShortCut "$SMPROGRAMS\LinuxSampler\JSampler Fantasia (frontend).lnk" "$INSTDIR\jjjjjsampler.exe" "" "$INSTDIR\jjjjjsampler.exe" 0 |
StrCmp $installingLinuxSampler '1' 0 +2 |
362 |
CreateShortCut "$SMPROGRAMS\LinuxSampler\QSampler (frontend).lnk" "$INSTDIR\qsampler.exe" "" "$INSTDIR\qsampler.exe" 0 |
CreateShortCut "$SMPROGRAMS\LinuxSampler\LinuxSampler 0.5.1 (backend).lnk" "$INSTDIR\linuxsampler.exe" "" "$INSTDIR\linuxsampler.exe" 0 |
363 |
CreateShortCut "$SMPROGRAMS\LinuxSampler\gigedit (stand alone).lnk" "$INSTDIR\gigedit.exe" "" "$INSTDIR\gigedit.exe" 0 |
|
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 |
SectionEnd |
373 |
|
|
374 |
;-------------------------------- |
;-------------------------------- |
380 |
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" |
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" |
381 |
; Remove files and uninstaller |
; Remove files and uninstaller |
382 |
Delete $INSTDIR\*.* |
Delete $INSTDIR\*.* |
383 |
|
Delete $INSTDIR\plugins\*.* |
384 |
; Remove shortcuts, if any |
; Remove shortcuts, if any |
385 |
Delete "$SMPROGRAMS\LinuxSampler\*.*" |
Delete "$SMPROGRAMS\LinuxSampler\*.*" |
386 |
; Remove directories used |
; Remove directories used |
387 |
RMDir "$SMPROGRAMS\LinuxSampler" |
RMDir "$SMPROGRAMS\LinuxSampler" |
388 |
|
RMDir "$INSTDIR\plugins" |
389 |
RMDir "$INSTDIR" |
RMDir "$INSTDIR" |
390 |
SectionEnd |
SectionEnd |
391 |
|
|