31 |
|
|
32 |
; Java Runtime Environment, needed for JSampler |
; Java Runtime Environment, needed for JSampler |
33 |
!define JRE_VERSION "1.6" |
!define JRE_VERSION "1.6" |
34 |
!define JRE_URL "http://javadl.sun.com/webapps/download/AutoDL?BundleId=11292" |
!define JRE_32_URL "http://javadl.sun.com/webapps/download/AutoDL?BundleId=29220" |
35 |
|
!define JRE_64_URL "http://javadl.sun.com/webapps/download/AutoDL?BundleId=29222" |
36 |
|
|
37 |
; The default installation directory |
; The default installation directory |
38 |
InstallDir "$PROGRAMFILES64\LinuxSampler" |
InstallDir "$PROGRAMFILES64\LinuxSampler" |
39 |
|
|
40 |
!define DEFAULT_VST_DIR "$PROGRAMFILES\Steinberg\VstPlugins" |
!define DEFAULT_VST_DIR "$PROGRAMFILES64\Steinberg\VstPlugins" |
41 |
|
|
42 |
; Get installation folder from registry if available |
; Get installation folder from registry if available |
43 |
InstallDirRegKey HKLM "Software\LinuxSampler" "Main Directory" |
InstallDirRegKey HKLM "Software\LinuxSampler" "Main Directory" |
65 |
!define BIN_TYPE_686SSE "686 SSE" |
!define BIN_TYPE_686SSE "686 SSE" |
66 |
!define BIN_TYPE_686 "686" |
!define BIN_TYPE_686 "686" |
67 |
|
|
68 |
|
Var /GLOBAL binType |
69 |
|
|
70 |
;-------------------------------- |
;-------------------------------- |
71 |
; Pages |
; Pages |
72 |
|
|
93 |
StrCpy $installingJSampler "0" |
StrCpy $installingJSampler "0" |
94 |
StrCpy $installingQSampler "0" |
StrCpy $installingQSampler "0" |
95 |
StrCpy $installinggigedit "0" |
StrCpy $installinggigedit "0" |
|
|
|
|
Call DetectSystemType |
|
96 |
FunctionEnd |
FunctionEnd |
97 |
|
|
98 |
; detects CPU capabilities, determmines which native binary type to install |
; detects CPU capabilities, determmines which native binary type to install |
99 |
; and selects the appropriate windows registry view (32 bit or 64 bit) |
; and selects the appropriate windows registry view (32 bit or 64 bit) |
100 |
Function DetectSystemType |
!macro DetectSystemType un |
101 |
Var /GLOBAL binType |
Function ${un}DetectSystemType |
|
|
|
102 |
; check if this is a 64 bit windows |
; check if this is a 64 bit windows |
103 |
System::Call "kernel32::GetCurrentProcess() i .s" |
System::Call "kernel32::GetCurrentProcess() i .s" |
104 |
System::Call "kernel32::IsWow64Process(i s, *i .r0)" |
System::Call "kernel32::IsWow64Process(i s, *i .r0)" |
126 |
|
|
127 |
DetectSystemDone: |
DetectSystemDone: |
128 |
FunctionEnd |
FunctionEnd |
129 |
|
!macroend |
130 |
|
!insertmacro DetectSystemType "" |
131 |
|
!insertmacro DetectSystemType "un." |
132 |
|
|
133 |
; 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 |
134 |
; download and install gtkmm now from the internet. |
; download and install gtkmm now from the internet. |
164 |
|
|
165 |
; Downloads and launches the JRE installer from the internet |
; Downloads and launches the JRE installer from the internet |
166 |
Function GetJRE |
Function GetJRE |
167 |
MessageBox MB_OK "JSampler requires Java ${JRE_VERSION}, it will now \ |
Var /GLOBAL jreUri |
|
be downloaded and installed" |
|
168 |
|
|
169 |
StrCpy $2 "$TEMP\Java Runtime Environment.exe" |
StrCmp $binType BIN_TYPE_64BIT 0 +3 |
170 |
nsisdl::download /TIMEOUT=30000 ${JRE_URL} $2 |
StrCpy $jreUri ${JRE_64_URL} |
171 |
Pop $R0 ;Get the return value |
Goto +2 |
172 |
StrCmp $R0 "success" +3 |
StrCpy $jreUri ${JRE_32_URL} |
173 |
MessageBox MB_OK "Download failed: $R0" |
|
174 |
Quit |
DetailPrint "Downloading JRE from: $jreUri" |
175 |
ExecWait $2 |
|
176 |
Delete $2 |
MessageBox MB_OK "JSampler requires Java ${JRE_VERSION}, it will now \ |
177 |
|
be downloaded and installed" |
178 |
|
|
179 |
|
StrCpy $2 "$TEMP\Java Runtime Environment.exe" |
180 |
|
nsisdl::download /TIMEOUT=30000 "$jreUri" $2 |
181 |
|
Pop $R0 ; Get the return value |
182 |
|
StrCmp $R0 "success" +3 |
183 |
|
MessageBox MB_OK "Download failed: $R0" |
184 |
|
Quit |
185 |
|
ExecWait $2 |
186 |
|
Delete $2 |
187 |
FunctionEnd |
FunctionEnd |
188 |
|
|
189 |
; Checks if the JRE is already installed, if not it will download and install it from the internet |
; Checks if the JRE is already installed, if not it will download and install it from the internet |
192 |
"CurrentVersion" |
"CurrentVersion" |
193 |
StrCmp $2 ${JRE_VERSION} done |
StrCmp $2 ${JRE_VERSION} done |
194 |
|
|
195 |
|
StrCmp $binType BIN_TYPE_64BIT 0 downloadjre |
196 |
|
|
197 |
|
; on 64 bit systems also check the 32 bit view of the registry, maybe |
198 |
|
; a 32 bit JRE was already installed |
199 |
|
SetRegView 32 |
200 |
|
ReadRegStr $3 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" \ |
201 |
|
"CurrentVersion" |
202 |
|
SetRegView 64 ; restore 64 bit view |
203 |
|
StrCmp $3 ${JRE_VERSION} done |
204 |
|
|
205 |
|
downloadjre: |
206 |
Call GetJRE |
Call GetJRE |
207 |
|
|
208 |
done: |
done: |
238 |
|
|
239 |
;-------------------------------- |
;-------------------------------- |
240 |
|
|
241 |
; primer things to do |
; primer things to do (before installing, not called on uninstall) |
242 |
Section "" |
Section "" |
243 |
|
Call DetectSystemType |
244 |
Call DetectVstPath |
Call DetectVstPath |
245 |
SectionEnd |
SectionEnd |
246 |
|
|
530 |
SectionEnd |
SectionEnd |
531 |
|
|
532 |
Section "Start Menu Shortcuts" SecShortcuts |
Section "Start Menu Shortcuts" SecShortcuts |
533 |
|
Var /GLOBAL javawbin |
534 |
|
|
535 |
; Switch system variables to 'all users', to ensure we create the start |
; Switch system variables to 'all users', to ensure we create the start |
536 |
; menu shortcuts for all users and not just for the current user. |
; menu shortcuts for all users and not just for the current user. |
537 |
SetShellVarContext all |
SetShellVarContext all |
538 |
|
|
539 |
|
; try to resolve the full qualified path of the javaw binary |
540 |
|
ClearErrors |
541 |
|
SearchPath $javawbin javaw.exe |
542 |
|
IfErrors 0 javawDetected |
543 |
|
ClearErrors |
544 |
|
; if all fails, simply use SYSDIR (which should work almost always anyway) |
545 |
|
DetailPrint "WRN: Could not resolve javaw.exe path, using SYSDIR." |
546 |
|
StrCpy $javawbin "$SYSDIR\javaw.exe" |
547 |
|
javawDetected: |
548 |
|
|
549 |
CreateDirectory "$SMPROGRAMS\LinuxSampler" |
CreateDirectory "$SMPROGRAMS\LinuxSampler" |
550 |
|
|
551 |
CreateShortCut "$SMPROGRAMS\LinuxSampler\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 |
CreateShortCut "$SMPROGRAMS\LinuxSampler\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 |
554 |
CreateShortCut "$SMPROGRAMS\LinuxSampler\LinuxSampler 0.5.1.12cvs (stand alone backend).lnk" "$INSTDIR\linuxsampler.exe" "" "$INSTDIR\linuxsampler.exe" 0 |
CreateShortCut "$SMPROGRAMS\LinuxSampler\LinuxSampler 0.5.1.12cvs (stand alone backend).lnk" "$INSTDIR\linuxsampler.exe" "" "$INSTDIR\linuxsampler.exe" 0 |
555 |
|
|
556 |
StrCmp $installingJSampler '1' 0 +2 |
StrCmp $installingJSampler '1' 0 +2 |
557 |
CreateShortCut '$SMPROGRAMS\LinuxSampler\JSampler Fantasia 0.8a-cvs6 (frontend).lnk' 'javaw' '-jar "$INSTDIR\Fantasia-0.8a-cvs6.jar"' '$INSTDIR\jsampler.ico' 0 |
CreateShortCut '$SMPROGRAMS\LinuxSampler\JSampler Fantasia 0.8a-cvs6 (frontend).lnk' '$javawbin' '-jar "$INSTDIR\Fantasia-0.8a-cvs6.jar"' '$INSTDIR\jsampler.ico' 0 |
558 |
|
|
559 |
StrCmp $installingQSampler '1' 0 +2 |
StrCmp $installingQSampler '1' 0 +2 |
560 |
CreateShortCut "$SMPROGRAMS\LinuxSampler\QSampler 0.2.1.26 (frontend).lnk" "$INSTDIR\qsampler.exe" "" "$INSTDIR\qsampler.ico" 0 |
CreateShortCut "$SMPROGRAMS\LinuxSampler\QSampler 0.2.1.26 (frontend).lnk" "$INSTDIR\qsampler.exe" "" "$INSTDIR\qsampler.ico" 0 |
570 |
Section "Uninstall" |
Section "Uninstall" |
571 |
Var /GLOBAL vstdir |
Var /GLOBAL vstdir |
572 |
|
|
573 |
|
Call un.DetectSystemType |
574 |
|
|
575 |
DetailPrint "Removing LinuxSampler directory from PATH variable ..." |
DetailPrint "Removing LinuxSampler directory from PATH variable ..." |
576 |
${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$INSTDIR" |
${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$INSTDIR" |
577 |
|
|