/[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 1903 by schoenebeck, Tue May 12 20:24:46 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=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 $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 88  Function .onInit Line 91  Function .onInit
91    StrCpy $installingJSampler "0"    StrCpy $installingJSampler "0"
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
99  FunctionEnd  FunctionEnd
100    
101  ; detects CPU capabilities and determmines which native binary type to install  ; detects CPU capabilities, determmines which native binary type to install
102    ; and selects the appropriate windows registry view (32 bit or 64 bit)
103  Function DetectSystemType  Function DetectSystemType
104    Var /GLOBAL binType    Var /GLOBAL binType
105    
# Line 100  Function DetectSystemType Line 109  Function DetectSystemType
109    IntCmp $0 0 not64bit    IntCmp $0 0 not64bit
110    StrCpy $binType BIN_TYPE_64BIT    StrCpy $binType BIN_TYPE_64BIT
111    DetailPrint "64 bit Windows detected."    DetailPrint "64 bit Windows detected."
112      SetRegView 64
113    Goto DetectSystemDone    Goto DetectSystemDone
114    
115    not64bit: ; a 32 bit system    not64bit: ; a 32 bit system
116    
117      SetRegView 32
118    
119    ; check if CPU supports SSE    ; check if CPU supports SSE
120    cpudesc::tell    cpudesc::tell
121    Pop $0                     ; full identification string in $0    Pop $0                     ; full identification string in $0
# Line 153  FunctionEnd Line 165  FunctionEnd
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
# Line 172  Function DetectJRE Line 191  Function DetectJRE
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:
# Line 199  Function DetectVstPath Line 229  Function DetectVstPath
229    noRegistryKeyExists:    noRegistryKeyExists:
230    ClearErrors    ClearErrors
231    DetailPrint "No VST plugin directory defined in registry."    DetailPrint "No VST plugin directory defined in registry."
232    StrCpy $vstPluginPath "$PROGRAMFILES\Steinberg\VstPlugins"    StrCpy $vstPluginPath "${DEFAULT_VST_DIR}"
233    
234    done:    done:
235    DetailPrint "Using the following as VST plugin directory: $vstPluginPath"    DetailPrint "Using the following as VST plugin directory: $vstPluginPath"
# Line 452  Section "libgig 3.2.1.x (cvs2009-05-03)" Line 482  Section "libgig 3.2.1.x (cvs2009-05-03)"
482    
483    done:    done:
484    
485    ; As this is a mandatory component, we add the common binary directory    ; As this is a mandatory component, we misuse is for the following
486    ; of LinuxSampler and friends to the system's PATH variable here ...    ; common tasks as well ...
487    
488      ; Add LinuxSampler and friends to the system's PATH variable
489    ${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$INSTDIR"    ${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$INSTDIR"
490    
   ; As this is a mandatory component, we misuse it to install the uninstaller as well ...  
491    ; Write the uninstall keys for Windows    ; Write the uninstall keys for Windows
492    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "DisplayName" "LinuxSampler ${RELEASE_DATE}"    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "DisplayName" "LinuxSampler ${RELEASE_DATE}"
493    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "UninstallString" '"$INSTDIR\uninstall.exe"'    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "UninstallString" '"$INSTDIR\uninstall.exe"'
494    WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "NoModify" 1    WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "NoModify" 1
495    WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "NoRepair" 1    WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler" "NoRepair" 1
496    WriteUninstaller "uninstall.exe"    WriteUninstaller "uninstall.exe"
497    ;Store installation folder  
498    WriteRegStr HKCU "Software\LinuxSampler" "" $INSTDIR    ; Store installation folders
499      WriteRegStr HKLM "Software\LinuxSampler" "Main Directory" $INSTDIR
500      WriteRegStr HKLM "Software\LinuxSampler" "VST Directory" $vstPluginPath
501    
502      ; Just for info, store the release date as well
503      WriteRegStr HKLM "Software\LinuxSampler" "Release Date" ${RELEASE_DATE}
504  SectionEnd  SectionEnd
505    
506  Section "libsndfile 1.0.19" Seclibsndfile  Section "libsndfile 1.0.19" Seclibsndfile
# Line 493  Section "libsndfile 1.0.19" Seclibsndfil Line 529  Section "libsndfile 1.0.19" Seclibsndfil
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
535      ; menu shortcuts for all users and not just for the current user.
536      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
551    
552    StrCmp $installingLinuxSampler '1' 0 +2    StrCmp $installingLinuxSampler '1' 0 +2
553    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
554    
555    StrCmp $installingJSampler '1' 0 +2    StrCmp $installingJSampler '1' 0 +2
556    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
557    
558    StrCmp $installingQSampler '1' 0 +2    StrCmp $installingQSampler '1' 0 +2
559    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
560    
561    StrCmp $installinggigedit '1' 0 +2    StrCmp $installinggigedit '1' 0 +2
562    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
563  SectionEnd  SectionEnd
564    
565  ;--------------------------------  ;--------------------------------
# Line 515  SectionEnd Line 567  SectionEnd
567  ; Uninstaller  ; Uninstaller
568    
569  Section "Uninstall"  Section "Uninstall"
570      Var /GLOBAL vstdir
571    
572    DetailPrint "Removing LinuxSampler directory from PATH variable ..."    DetailPrint "Removing LinuxSampler directory from PATH variable ..."
573    ${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$INSTDIR"    ${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$INSTDIR"
574    
575      DetailPrint "Searching for VST plugin ..."
576      ClearErrors
577      ReadRegStr $0 HKLM "Software\LinuxSampler" "VST Directory"
578      IfErrors usedefaultvstdir 0
579      StrCpy $vstdir $0
580      DetailPrint "VST plugin location found in registry."
581      Goto vstdirDetected
582      usedefaultvstdir:
583      DetailPrint "WRN: No VST plugin location found in registry, trying default location."
584      ClearErrors
585      StrCpy $vstdir "${DEFAULT_VST_DIR}"
586      vstdirDetected:
587    
588    DetailPrint "Removing registry keys ..."    DetailPrint "Removing registry keys ..."
589    DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler"    DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\LinuxSampler"
590      DeleteRegKey HKLM "Software\LinuxSampler"
591    
592    DetailPrint "Removing VST plugin ..."    ; Workaround for Vista and younger: switch system variables to 'all users'
593    Delete $vstPluginPath\LinuxSampler.dll    ; otherwise e.g. we couldn't delete start menu shortcuts below on those
594      ; systems, as those variables would point to the current user.
595      SetShellVarContext all
596    
597    DetailPrint "Removing shortcuts (if any) ..."    DetailPrint "Removing shortcuts (if any) from: $SMPROGRAMS ..."
598    Delete "$SMPROGRAMS\LinuxSampler\*.*"    Delete "$SMPROGRAMS\LinuxSampler\*.*"
599    
600      DetailPrint "Removing VST plugin from: $vstdir ..."
601      Delete "$vstdir\LinuxSampler.dll"
602    
603    DetailPrint "Removing directories used ..."    DetailPrint "Removing directories used ..."
604    RMDir "$SMPROGRAMS\LinuxSampler"    RMDir /r "$SMPROGRAMS\LinuxSampler"
605    RMDir /r "$INSTDIR"    RMDir /r "$INSTDIR"
606  SectionEnd  SectionEnd
607    
# Line 536  SectionEnd Line 609  SectionEnd
609  ;Descriptions  ;Descriptions
610    
611  ;Language strings  ;Language strings
612  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."
613  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."
614  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!"
615  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."
616  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."
617  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."
618  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.1903

  ViewVC Help
Powered by ViewVC