/[svn]/misc/trunk/win32_installer/linuxsampler_all.nsi
ViewVC logotype

Diff of /misc/trunk/win32_installer/linuxsampler_all.nsi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1900 by schoenebeck, Mon May 11 19:50:03 2009 UTC revision 1926 by schoenebeck, Thu Jul 2 16:11:49 2009 UTC
# Line 21  SetCompressor lzma Line 21  SetCompressor lzma
21  !include "MUI.nsh"  !include "MUI.nsh"
22  !include "EnvVarUpdate.nsh"  !include "EnvVarUpdate.nsh"
23    
24  !define RELEASE_DATE "20090511"  !define RELEASE_DATE "20090623"
25    
26  ; The name of the installer  ; The name of the installer
27  Name "LinuxSampler (${RELEASE_DATE})"  Name "LinuxSampler (${RELEASE_DATE})"
# Line 31  OutFile "linuxsampler_${RELEASE_DATE}_se Line 31  OutFile "linuxsampler_${RELEASE_DATE}_se
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=31621"
35    !define JRE_64_URL "http://javadl.sun.com/webapps/download/AutoDL?BundleId=31623"
36    
37  ; The default installation directory  ; The default installation directory
38  InstallDir $PROGRAMFILES\LinuxSampler  InstallDir "$PROGRAMFILES64\LinuxSampler"
39    
40    !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 HKCU "Software\LinuxSampler" ""  InstallDirRegKey HKLM "Software\LinuxSampler" "Main Directory"
44    
45  ;--------------------------------  ;--------------------------------
46  ;Interface Settings  ;Interface Settings
# Line 62  VIAddVersionKey /LANG=${LANG_ENGLISH} "F Line 65  VIAddVersionKey /LANG=${LANG_ENGLISH} "F
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    
# Line 90  Function .onInit Line 95  Function .onInit
95    StrCpy $installinggigedit "0"    StrCpy $installinggigedit "0"
96  FunctionEnd  FunctionEnd
97    
98  ; detects CPU capabilities and determmines which native binary type to install  ; detects CPU capabilities, determmines which native binary type to install
99  Function DetectSystemType  ; and selects the appropriate windows registry view (32 bit or 64 bit)
100    Var /GLOBAL binType  !macro DetectSystemType un
101    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)"
105    IntCmp $0 0 not64bit    IntCmp $0 0 not64bit
106    StrCpy $binType BIN_TYPE_64BIT    StrCpy $binType BIN_TYPE_64BIT
107    DetailPrint "64 bit Windows detected."    DetailPrint "64 bit Windows detected."
108      SetRegView 64
109    Goto DetectSystemDone    Goto DetectSystemDone
110    
111    not64bit: ; a 32 bit system    not64bit: ; a 32 bit system
112    
113      SetRegView 32
114    
115    ; check if CPU supports SSE    ; check if CPU supports SSE
116    cpudesc::tell    cpudesc::tell
117    Pop $0                     ; full identification string in $0    Pop $0                     ; full identification string in $0
# Line 118  Function DetectSystemType Line 126  Function DetectSystemType
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.
# Line 153  FunctionEnd Line 164  FunctionEnd
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
# Line 172  Function DetectJRE Line 192  Function DetectJRE
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:
# Line 199  Function DetectVstPath Line 230  Function DetectVstPath
230    noRegistryKeyExists:    noRegistryKeyExists:
231    ClearErrors    ClearErrors
232    DetailPrint "No VST plugin directory defined in registry."    DetailPrint "No VST plugin directory defined in registry."
233    StrCpy $vstPluginPath "$PROGRAMFILES\Steinberg\VstPlugins"    StrCpy $vstPluginPath "${DEFAULT_VST_DIR}"
234    
235    done:    done:
236    DetailPrint "Using the following as VST plugin directory: $vstPluginPath"    DetailPrint "Using the following as VST plugin directory: $vstPluginPath"
# Line 207  FunctionEnd Line 238  FunctionEnd
238    
239  ;--------------------------------  ;--------------------------------
240    
241  ; primer things to do  ; primer things to do (before installing, not called on uninstall)
242  Section ""  Section ""
243    Call DetectSystemType    Call DetectSystemType
244    Call DetectVstPath    Call DetectVstPath
# Line 232  Section "LinuxSampler 0.5.1.12cvs" SecLi Line 263  Section "LinuxSampler 0.5.1.12cvs" SecLi
263    linuxsampler64:    linuxsampler64:
264    File bin\64\linuxsampler.exe    File bin\64\linuxsampler.exe
265    File bin\64\liblinuxsampler-1.dll    File bin\64\liblinuxsampler-1.dll
266      File bin\64\libsqlite3-0.dll
267    SetOutPath $vstPluginPath    SetOutPath $vstPluginPath
268    File bin\64\LinuxSampler.dll    File bin\64\LinuxSampler.dll
269    Goto done    Goto done
# Line 239  Section "LinuxSampler 0.5.1.12cvs" SecLi Line 271  Section "LinuxSampler 0.5.1.12cvs" SecLi
271    linuxsampler686sse:    linuxsampler686sse:
272    File bin\686sse\linuxsampler.exe    File bin\686sse\linuxsampler.exe
273    File bin\686sse\liblinuxsampler-1.dll    File bin\686sse\liblinuxsampler-1.dll
274      File bin\686\libsqlite3-0.dll
275    SetOutPath $vstPluginPath    SetOutPath $vstPluginPath
276    File bin\686sse\LinuxSampler.dll    File bin\686sse\LinuxSampler.dll
277    Goto done    Goto done
# Line 246  Section "LinuxSampler 0.5.1.12cvs" SecLi Line 279  Section "LinuxSampler 0.5.1.12cvs" SecLi
279    linuxsampler686:    linuxsampler686:
280    File bin\686\linuxsampler.exe    File bin\686\linuxsampler.exe
281    File bin\686\liblinuxsampler-1.dll    File bin\686\liblinuxsampler-1.dll
282      File bin\686\libsqlite3-0.dll
283    SetOutPath $vstPluginPath    SetOutPath $vstPluginPath
284    File bin\686\LinuxSampler.dll    File bin\686\LinuxSampler.dll
285    Goto done    Goto done
# Line 253  Section "LinuxSampler 0.5.1.12cvs" SecLi Line 287  Section "LinuxSampler 0.5.1.12cvs" SecLi
287    done:    done:
288  SectionEnd  SectionEnd
289    
290  Section "JSampler 'Fantasia' 0.8a-cvs6" SecJSampler  Section "JSampler 'Fantasia' 0.8a-cvs8" SecJSampler
291    DetailPrint "Installing JSampler binaries ..."    DetailPrint "Installing JSampler binaries ..."
292    ; make sure JRE is installed    ; make sure JRE is installed
293    Call DetectJRE    Call DetectJRE
# Line 261  Section "JSampler 'Fantasia' 0.8a-cvs6" Line 295  Section "JSampler 'Fantasia' 0.8a-cvs6"
295    ; Set output path to the installation directory.    ; Set output path to the installation directory.
296    SetOutPath $INSTDIR    SetOutPath $INSTDIR
297    ; Files to install    ; Files to install
298    File bin\Fantasia-0.8a-cvs6.jar    File bin\Fantasia-0.8a-cvs8.jar
299    File jsampler.ico    File jsampler.ico
300  SectionEnd  SectionEnd
301    
# Line 452  Section "libgig 3.2.1.x (cvs2009-05-03)" Line 486  Section "libgig 3.2.1.x (cvs2009-05-03)"
486    
487    done:    done:
488    
489    ; As this is a mandatory component, we add the common binary directory    ; As this is a mandatory component, we misuse is for the following
490    ; of LinuxSampler and friends to the system's PATH variable here ...    ; common tasks as well ...
491    
492      ; Add LinuxSampler and friends to the system's PATH variable
493    ${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$INSTDIR"    ${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$INSTDIR"
494    
   ; As this is a mandatory component, we misuse it to install the uninstaller as well ...  
495    ; Write the uninstall keys for Windows    ; Write the uninstall keys for Windows
496    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "DisplayName" "LinuxSampler ${RELEASE_DATE}"    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "DisplayName" "LinuxSampler ${RELEASE_DATE}"
497    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "UninstallString" '"$INSTDIR\uninstall.exe"'    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "UninstallString" '"$INSTDIR\uninstall.exe"'
498    WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "NoModify" 1    WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "NoModify" 1
499    WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "NoRepair" 1    WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "NoRepair" 1
500    WriteUninstaller "uninstall.exe"    WriteUninstaller "uninstall.exe"
501    ;Store installation folder  
502    WriteRegStr HKCU "Software\LinuxSampler" "" $INSTDIR    ; Store installation folders
503      WriteRegStr HKLM "Software\LinuxSampler" "Main Directory" $INSTDIR
504      WriteRegStr HKLM "Software\LinuxSampler" "VST Directory" $vstPluginPath
505    
506      ; Just for info, store the release date as well
507      WriteRegStr HKLM "Software\LinuxSampler" "Release Date" ${RELEASE_DATE}
508  SectionEnd  SectionEnd
509    
510  Section "libsndfile 1.0.19" Seclibsndfile  Section "libsndfile 1.0.19" Seclibsndfile
# Line 493  Section "libsndfile 1.0.19" Seclibsndfil Line 533  Section "libsndfile 1.0.19" Seclibsndfil
533  SectionEnd  SectionEnd
534    
535  Section "Start Menu Shortcuts" SecShortcuts  Section "Start Menu Shortcuts" SecShortcuts
536      Var /GLOBAL javawbin
537    
538      ; Switch system variables to 'all users', to ensure we create the start
539      ; menu shortcuts for all users and not just for the current user.
540      SetShellVarContext all
541    
542      ; try to resolve the full qualified path of the javaw binary
543      ClearErrors
544      SearchPath $javawbin javaw.exe
545      IfErrors 0 javawDetected
546      ClearErrors
547      ; if all fails, simply use SYSDIR (which should work almost always anyway)
548      DetailPrint "WRN: Could not resolve javaw.exe path, using SYSDIR."
549      StrCpy $javawbin "$SYSDIR\javaw.exe"
550      javawDetected:
551    
552    CreateDirectory "$SMPROGRAMS\LinuxSampler"    CreateDirectory "$SMPROGRAMS\LinuxSampler"
553    
554    CreateShortCut "$SMPROGRAMS\LinuxSampler\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0    CreateShortCut "$SMPROGRAMS\LinuxSampler\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
555    
556    StrCmp $installingLinuxSampler '1' 0 +2    StrCmp $installingLinuxSampler '1' 0 +2
557    CreateShortCut "$SMPROGRAMS\LinuxSampler\LinuxSampler 0.5.1 (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
558    
559    StrCmp $installingJSampler '1' 0 +2    StrCmp $installingJSampler '1' 0 +2
560    CreateShortCut '$SMPROGRAMS\LinuxSampler\JSampler Fantasia 0.8a (frontend).lnk' 'javaw' '-jar "$INSTDIR\Fantasia-0.8a.jar"' '$INSTDIR\jsampler.ico' 0    CreateShortCut '$SMPROGRAMS\LinuxSampler\JSampler Fantasia 0.8a-cvs8 (frontend).lnk' '$javawbin' '-jar "$INSTDIR\Fantasia-0.8a-cvs8.jar"' '$INSTDIR\jsampler.ico' 0
561    
562    StrCmp $installingQSampler '1' 0 +2    StrCmp $installingQSampler '1' 0 +2
563    CreateShortCut "$SMPROGRAMS\LinuxSampler\QSampler 0.2.1 (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
564    
565    StrCmp $installinggigedit '1' 0 +2    StrCmp $installinggigedit '1' 0 +2
566    CreateShortCut "$SMPROGRAMS\LinuxSampler\gigedit 0.1.1 (stand alone).lnk" "$INSTDIR\gigedit.exe" "" "$INSTDIR\gigedit.exe" 0    CreateShortCut "$SMPROGRAMS\LinuxSampler\gigedit 0.1.1.x cvs2009-05-10 (stand alone).lnk" "$INSTDIR\gigedit.exe" "" "$INSTDIR\gigedit.exe" 0
567  SectionEnd  SectionEnd
568    
569  ;--------------------------------  ;--------------------------------
# Line 515  SectionEnd Line 571  SectionEnd
571  ; Uninstaller  ; Uninstaller
572    
573  Section "Uninstall"  Section "Uninstall"
574      Var /GLOBAL vstdir
575    
576      Call un.DetectSystemType
577    
578    DetailPrint "Removing LinuxSampler directory from PATH variable ..."    DetailPrint "Removing LinuxSampler directory from PATH variable ..."
579    ${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$INSTDIR"    ${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$INSTDIR"
580    
581      DetailPrint "Searching for VST plugin ..."
582      ClearErrors
583      ReadRegStr $0 HKLM "Software\LinuxSampler" "VST Directory"
584      IfErrors usedefaultvstdir 0
585      StrCpy $vstdir $0
586      DetailPrint "VST plugin location found in registry."
587      Goto vstdirDetected
588      usedefaultvstdir:
589      DetailPrint "WRN: No VST plugin location found in registry, trying default location."
590      ClearErrors
591      StrCpy $vstdir "${DEFAULT_VST_DIR}"
592      vstdirDetected:
593    
594    DetailPrint "Removing registry keys ..."    DetailPrint "Removing registry keys ..."
595    DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler"    DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler"
596      DeleteRegKey HKLM "Software\LinuxSampler"
597    
598    DetailPrint "Removing VST plugin ..."    ; Workaround for Vista and younger: switch system variables to 'all users'
599    Delete $vstPluginPath\LinuxSampler.dll    ; otherwise e.g. we couldn't delete start menu shortcuts below on those
600      ; systems, as those variables would point to the current user.
601      SetShellVarContext all
602    
603    DetailPrint "Removing shortcuts (if any) ..."    DetailPrint "Removing shortcuts (if any) from: $SMPROGRAMS ..."
604    Delete "$SMPROGRAMS\LinuxSampler\*.*"    Delete "$SMPROGRAMS\LinuxSampler\*.*"
605    
606      DetailPrint "Removing VST plugin from: $vstdir ..."
607      Delete "$vstdir\LinuxSampler.dll"
608    
609    DetailPrint "Removing directories used ..."    DetailPrint "Removing directories used ..."
610    RMDir "$SMPROGRAMS\LinuxSampler"    RMDir /r "$SMPROGRAMS\LinuxSampler"
611    RMDir /r "$INSTDIR"    RMDir /r "$INSTDIR"
612  SectionEnd  SectionEnd
613    
# Line 536  SectionEnd Line 615  SectionEnd
615  ;Descriptions  ;Descriptions
616    
617  ;Language strings  ;Language strings
618  LangString DESC_SecLinuxSampler ${LANG_ENGLISH} "Sampler backend (stand-alone application and VST plugin), 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."  LangString DESC_SecLinuxSampler ${LANG_ENGLISH} "Sampler backend (stand-alone and VST), 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."
619  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."  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."
620  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!"  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!"
621  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!"  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."
622  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."  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."
623  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."  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."
624  LangString DESC_SecShortcuts ${LANG_ENGLISH} "Installs start menu shortcuts for all applications."  LangString DESC_SecShortcuts ${LANG_ENGLISH} "Installs start menu shortcuts for all applications."

Legend:
Removed from v.1900  
changed lines
  Added in v.1926

  ViewVC Help
Powered by ViewVC