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" |
92 |
StrCpy $installingQSampler "0" |
StrCpy $installingQSampler "0" |
93 |
StrCpy $installinggigedit "0" |
StrCpy $installinggigedit "0" |
94 |
|
|
95 |
|
; We call this here for the uninstaller, its also called in the "" |
96 |
|
; section (for installing) just for seeing the debug output, as ouput |
97 |
|
; this init handler wont make it into the "Details" list. |
98 |
Call DetectSystemType |
Call DetectSystemType |
99 |
FunctionEnd |
FunctionEnd |
100 |
|
|
165 |
|
|
166 |
; Downloads and launches the JRE installer from the internet |
; Downloads and launches the JRE installer from the internet |
167 |
Function GetJRE |
Function GetJRE |
168 |
MessageBox MB_OK "JSampler requires Java ${JRE_VERSION}, it will now \ |
Var /GLOBAL jreUri |
|
be downloaded and installed" |
|
169 |
|
|
170 |
StrCpy $2 "$TEMP\Java Runtime Environment.exe" |
StrCmp $binType BIN_TYPE_64BIT 0 +3 |
171 |
nsisdl::download /TIMEOUT=30000 ${JRE_URL} $2 |
StrCpy $jreUri JRE_64_URL |
172 |
Pop $R0 ;Get the return value |
Goto +2 |
173 |
StrCmp $R0 "success" +3 |
StrCpy $jreUri JRE_32_URL |
174 |
MessageBox MB_OK "Download failed: $R0" |
|
175 |
Quit |
MessageBox MB_OK "JSampler requires Java ${JRE_VERSION}, it will now \ |
176 |
ExecWait $2 |
be downloaded and installed" |
177 |
Delete $2 |
|
178 |
|
StrCpy $2 "$TEMP\Java Runtime Environment.exe" |
179 |
|
nsisdl::download /TIMEOUT=30000 $jreUri $2 |
180 |
|
Pop $R0 ; Get the return value |
181 |
|
StrCmp $R0 "success" +3 |
182 |
|
MessageBox MB_OK "Download failed: $R0" |
183 |
|
Quit |
184 |
|
ExecWait $2 |
185 |
|
Delete $2 |
186 |
FunctionEnd |
FunctionEnd |
187 |
|
|
188 |
; 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 |
191 |
"CurrentVersion" |
"CurrentVersion" |
192 |
StrCmp $2 ${JRE_VERSION} done |
StrCmp $2 ${JRE_VERSION} done |
193 |
|
|
194 |
|
StrCmp $binType BIN_TYPE_64BIT 0 downloadjre |
195 |
|
|
196 |
|
; on 64 bit systems also check the 32 bit view of the registry, maybe |
197 |
|
; a 32 bit JRE was already installed |
198 |
|
SetRegView 32 |
199 |
|
ReadRegStr $3 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" \ |
200 |
|
"CurrentVersion" |
201 |
|
SetRegView 64 ; restore 64 bit view |
202 |
|
StrCmp $3 ${JRE_VERSION} done |
203 |
|
|
204 |
|
downloadjre: |
205 |
Call GetJRE |
Call GetJRE |
206 |
|
|
207 |
done: |
done: |
239 |
|
|
240 |
; primer things to do |
; primer things to do |
241 |
Section "" |
Section "" |
242 |
|
Call DetectSystemType |
243 |
Call DetectVstPath |
Call DetectVstPath |
244 |
SectionEnd |
SectionEnd |
245 |
|
|
529 |
SectionEnd |
SectionEnd |
530 |
|
|
531 |
Section "Start Menu Shortcuts" SecShortcuts |
Section "Start Menu Shortcuts" SecShortcuts |
532 |
|
Var /GLOBAL javawbin |
533 |
|
|
534 |
; Switch system variables to 'all users', to ensure we create the start |
; Switch system variables to 'all users', to ensure we create the start |
535 |
; menu shortcuts for all users and not just for the current user. |
; menu shortcuts for all users and not just for the current user. |
536 |
SetShellVarContext all |
SetShellVarContext all |
537 |
|
|
538 |
|
; try to resolve the full qualified path of the javaw binary |
539 |
|
ClearErrors |
540 |
|
SearchPath $javawbin javaw.exe |
541 |
|
IfErrors 0 javawDetected |
542 |
|
ClearErrors |
543 |
|
; if all fails, simply use SYSDIR (which should work almost always anyway) |
544 |
|
DetailPrint "WRN: Could not resolve javaw.exe path, using SYSDIR." |
545 |
|
StrCpy $javawbin "$SYSDIR\javaw.exe" |
546 |
|
javawDetected: |
547 |
|
|
548 |
CreateDirectory "$SMPROGRAMS\LinuxSampler" |
CreateDirectory "$SMPROGRAMS\LinuxSampler" |
549 |
|
|
550 |
CreateShortCut "$SMPROGRAMS\LinuxSampler\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 |
CreateShortCut "$SMPROGRAMS\LinuxSampler\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 |
553 |
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 |
554 |
|
|
555 |
StrCmp $installingJSampler '1' 0 +2 |
StrCmp $installingJSampler '1' 0 +2 |
556 |
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 |
557 |
|
|
558 |
StrCmp $installingQSampler '1' 0 +2 |
StrCmp $installingQSampler '1' 0 +2 |
559 |
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 |