/[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 1921 by schoenebeck, Fri Jun 26 18:38:54 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 "20090512"
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 452  Section "libgig 3.2.1.x (cvs2009-05-03)" Line 483  Section "libgig 3.2.1.x (cvs2009-05-03)"
483    
484    done:    done:
485    
486    ; As this is a mandatory component, we add the common binary directory    ; As this is a mandatory component, we misuse is for the following
487    ; of LinuxSampler and friends to the system's PATH variable here ...    ; common tasks as well ...
488    
489      ; Add LinuxSampler and friends to the system's PATH variable
490    ${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$INSTDIR"    ${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$INSTDIR"
491    
   ; As this is a mandatory component, we misuse it to install the uninstaller as well ...  
492    ; Write the uninstall keys for Windows    ; Write the uninstall keys for Windows
493    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "DisplayName" "LinuxSampler ${RELEASE_DATE}"    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "DisplayName" "LinuxSampler ${RELEASE_DATE}"
494    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "UninstallString" '"$INSTDIR\uninstall.exe"'    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "UninstallString" '"$INSTDIR\uninstall.exe"'
495    WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "NoModify" 1    WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "NoModify" 1
496    WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "NoRepair" 1    WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "NoRepair" 1
497    WriteUninstaller "uninstall.exe"    WriteUninstaller "uninstall.exe"
498    ;Store installation folder  
499    WriteRegStr HKCU "Software\LinuxSampler" "" $INSTDIR    ; Store installation folders
500      WriteRegStr HKLM "Software\LinuxSampler" "Main Directory" $INSTDIR
501      WriteRegStr HKLM "Software\LinuxSampler" "VST Directory" $vstPluginPath
502    
503      ; Just for info, store the release date as well
504      WriteRegStr HKLM "Software\LinuxSampler" "Release Date" ${RELEASE_DATE}
505  SectionEnd  SectionEnd
506    
507  Section "libsndfile 1.0.19" Seclibsndfile  Section "libsndfile 1.0.19" Seclibsndfile
# Line 493  Section "libsndfile 1.0.19" Seclibsndfil Line 530  Section "libsndfile 1.0.19" Seclibsndfil
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
536      ; menu shortcuts for all users and not just for the current user.
537      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
552    
553    StrCmp $installingLinuxSampler '1' 0 +2    StrCmp $installingLinuxSampler '1' 0 +2
554    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
555    
556    StrCmp $installingJSampler '1' 0 +2    StrCmp $installingJSampler '1' 0 +2
557    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-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 (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
561    
562    StrCmp $installinggigedit '1' 0 +2    StrCmp $installinggigedit '1' 0 +2
563    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
564  SectionEnd  SectionEnd
565    
566  ;--------------------------------  ;--------------------------------
# Line 515  SectionEnd Line 568  SectionEnd
568  ; Uninstaller  ; Uninstaller
569    
570  Section "Uninstall"  Section "Uninstall"
571      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    
578      DetailPrint "Searching for VST plugin ..."
579      ClearErrors
580      ReadRegStr $0 HKLM "Software\LinuxSampler" "VST Directory"
581      IfErrors usedefaultvstdir 0
582      StrCpy $vstdir $0
583      DetailPrint "VST plugin location found in registry."
584      Goto vstdirDetected
585      usedefaultvstdir:
586      DetailPrint "WRN: No VST plugin location found in registry, trying default location."
587      ClearErrors
588      StrCpy $vstdir "${DEFAULT_VST_DIR}"
589      vstdirDetected:
590    
591    DetailPrint "Removing registry keys ..."    DetailPrint "Removing registry keys ..."
592    DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler"    DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler"
593      DeleteRegKey HKLM "Software\LinuxSampler"
594    
595    DetailPrint "Removing VST plugin ..."    ; Workaround for Vista and younger: switch system variables to 'all users'
596    Delete $vstPluginPath\LinuxSampler.dll    ; otherwise e.g. we couldn't delete start menu shortcuts below on those
597      ; systems, as those variables would point to the current user.
598      SetShellVarContext all
599    
600    DetailPrint "Removing shortcuts (if any) ..."    DetailPrint "Removing shortcuts (if any) from: $SMPROGRAMS ..."
601    Delete "$SMPROGRAMS\LinuxSampler\*.*"    Delete "$SMPROGRAMS\LinuxSampler\*.*"
602    
603      DetailPrint "Removing VST plugin from: $vstdir ..."
604      Delete "$vstdir\LinuxSampler.dll"
605    
606    DetailPrint "Removing directories used ..."    DetailPrint "Removing directories used ..."
607    RMDir "$SMPROGRAMS\LinuxSampler"    RMDir /r "$SMPROGRAMS\LinuxSampler"
608    RMDir /r "$INSTDIR"    RMDir /r "$INSTDIR"
609  SectionEnd  SectionEnd
610    
# Line 536  SectionEnd Line 612  SectionEnd
612  ;Descriptions  ;Descriptions
613    
614  ;Language strings  ;Language strings
615  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."
616  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."
617  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!"
618  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."
619  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."
620  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."
621  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.1921

  ViewVC Help
Powered by ViewVC