|
|
@@ -1,16 +1,21 @@ |
|
|
|
!include "MUI2.nsh" |
|
|
|
|
|
|
|
Name "VCV Rack ${VERSION}" |
|
|
|
OutFile "installer.exe" |
|
|
|
!define NAME_FULL "VCV Rack ${EDITION_NAME} ${VERSION}" |
|
|
|
!define NAME "VCV Rack ${EDITION} ${VERSION_MAJOR}" |
|
|
|
Name "${NAME_FULL}" |
|
|
|
SetCompressor /solid "lzma" |
|
|
|
SetCompressorDictSize 8 |
|
|
|
CRCCheck On |
|
|
|
|
|
|
|
; Default installation folder |
|
|
|
InstallDir "$PROGRAMFILES\VCV\Rack2" |
|
|
|
!define RACK_DIR "Rack${EDITION}${VERSION_MAJOR}" |
|
|
|
InstallDir "$PROGRAMFILES\VCV\${RACK_DIR}" |
|
|
|
|
|
|
|
; Get installation folder from registry if available |
|
|
|
InstallDirRegKey HKLM "Software\VCV\Rack2" "" |
|
|
|
!define INSTALL_REG "Software\VCV\Rack${EDITION}${VERSION_MAJOR}" |
|
|
|
InstallDirRegKey HKLM "${INSTALL_REG}" "" |
|
|
|
|
|
|
|
!define UNINSTALL_REG "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCVRack${EDITION}${VERSION_MAJOR}" |
|
|
|
|
|
|
|
; Request admin permissions so we can install to Program Files and add a registry entry |
|
|
|
RequestExecutionLevel admin |
|
|
@@ -21,8 +26,8 @@ RequestExecutionLevel admin |
|
|
|
!define MUI_ICON "icon.ico" |
|
|
|
;!define MUI_HEADERIMAGE |
|
|
|
;!define MUI_HEADERIMAGE_BITMAP "installer-banner.bmp" ; 150x57 |
|
|
|
;!define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\win.bmp" ; 164x314 |
|
|
|
;!define MUI_UNWELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\win.bmp" ; 164x314 |
|
|
|
;!define MUI_WELCOMEFINISHPAGE_BITMAP "$NSISDIR\Contrib\Graphics\Wizard\win.bmp" ; 164x314 |
|
|
|
;!define MUI_UNWELCOMEFINISHPAGE_BITMAP "$NSISDIR\Contrib\Graphics\Wizard\win.bmp" ; 164x314 |
|
|
|
|
|
|
|
!define MUI_COMPONENTSPAGE_NODESC |
|
|
|
;!insertmacro MUI_PAGE_COMPONENTS |
|
|
@@ -31,18 +36,32 @@ RequestExecutionLevel admin |
|
|
|
; This is necessary because the uninstaller removes the installation directory, which is dangerous for directories that existed before Rack was installed. |
|
|
|
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE directoryLeave |
|
|
|
Function directoryLeave |
|
|
|
IfFileExists "$INSTDIR" directoryExists directoryNotExists |
|
|
|
directoryExists: |
|
|
|
MessageBox MB_OK|MB_ICONSTOP "Cannot install to $INSTDIR. Folder already exists." |
|
|
|
StrCmp "$INSTDIR" "$PROGRAMFILES" directoryBad |
|
|
|
StrCmp "$INSTDIR" "$PROGRAMFILES32" directoryBad |
|
|
|
StrCmp "$INSTDIR" "$PROGRAMFILES64" directoryBad |
|
|
|
StrCmp "$INSTDIR" "$COMMONFILES" directoryBad |
|
|
|
StrCmp "$INSTDIR" "$COMMONFILES32" directoryBad |
|
|
|
StrCmp "$INSTDIR" "$COMMONFILES64" directoryBad |
|
|
|
StrCmp "$INSTDIR" "$DESKTOP" directoryBad |
|
|
|
StrCmp "$INSTDIR" "$WINDIR" directoryBad |
|
|
|
StrCmp "$INSTDIR" "$SYSDIR" directoryBad |
|
|
|
StrCmp "$INSTDIR" "$DOCUMENTS" directoryBad |
|
|
|
StrCmp "$INSTDIR" "$MUSIC" directoryBad |
|
|
|
StrCmp "$INSTDIR" "$PICTURES" directoryBad |
|
|
|
StrCmp "$INSTDIR" "$VIDEOS" directoryBad |
|
|
|
StrCmp "$INSTDIR" "$APPDATA" directoryBad |
|
|
|
StrCmp "$INSTDIR" "$LOCALAPPDATA" directoryBad |
|
|
|
Return |
|
|
|
directoryBad: |
|
|
|
MessageBox MB_OK|MB_ICONSTOP "Cannot install to $INSTDIR." |
|
|
|
Abort |
|
|
|
directoryNotExists: |
|
|
|
FunctionEnd |
|
|
|
!insertmacro MUI_PAGE_DIRECTORY |
|
|
|
|
|
|
|
!insertmacro MUI_PAGE_INSTFILES |
|
|
|
|
|
|
|
!define MUI_FINISHPAGE_RUN "$INSTDIR\Rack.exe" |
|
|
|
!define MUI_FINISHPAGE_RUN_TEXT "Launch VCV Rack" |
|
|
|
!define MUI_FINISHPAGE_RUN_TEXT "Launch ${NAME}" |
|
|
|
!insertmacro MUI_PAGE_FINISH |
|
|
|
|
|
|
|
; MUI uninstaller pages |
|
|
@@ -59,35 +78,35 @@ Section "Install" INSTALL_SECTION |
|
|
|
SectionIn RO |
|
|
|
SetOutPath "$INSTDIR" |
|
|
|
|
|
|
|
File /r "dist\Rack\*" |
|
|
|
File /r "dist\${RACK_DIR}\*" |
|
|
|
|
|
|
|
; Store installation folder |
|
|
|
WriteRegStr HKLM "Software\VCV\Rack2" "" "$INSTDIR" |
|
|
|
WriteRegStr HKLM "${INSTALL_REG}" "" "$INSTDIR" |
|
|
|
|
|
|
|
; Write uninstaller info |
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCVRack2" "DisplayName" "VCV Rack 2" |
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCVRack2" "DisplayIcon" '"$INSTDIR\Rack.exe"' |
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCVRack2" "DisplayVersion" "${VERSION}" |
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCVRack2" "UninstallString" '"$INSTDIR\Uninstall.exe"' |
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCVRack2" "QuietUninstallString" '"$INSTDIR\Uninstall.exe" /S' |
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCVRack2" "InstallLocation" '"$INSTDIR"' |
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCVRack2" "Publisher" "VCV" |
|
|
|
WriteRegStr HKLM "${UNINSTALL_REG}" "DisplayName" "${NAME}" |
|
|
|
WriteRegStr HKLM "${UNINSTALL_REG}" "DisplayIcon" '"$INSTDIR\Rack.exe"' |
|
|
|
WriteRegStr HKLM "${UNINSTALL_REG}" "DisplayVersion" "${VERSION}" |
|
|
|
WriteRegStr HKLM "${UNINSTALL_REG}" "UninstallString" '"$INSTDIR\Uninstall.exe"' |
|
|
|
WriteRegStr HKLM "${UNINSTALL_REG}" "QuietUninstallString" '"$INSTDIR\Uninstall.exe" /S' |
|
|
|
WriteRegStr HKLM "${UNINSTALL_REG}" "InstallLocation" '"$INSTDIR"' |
|
|
|
WriteRegStr HKLM "${UNINSTALL_REG}" "Publisher" "VCV" |
|
|
|
SectionGetSize ${INSTALL_SECTION} $0 |
|
|
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCVRack2" "EstimatedSize" $0 |
|
|
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCVRack2" "NoModify" 1 |
|
|
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCVRack2" "NoRepair" 1 |
|
|
|
WriteRegDWORD HKLM "${UNINSTALL_REG}" "EstimatedSize" $0 |
|
|
|
WriteRegDWORD HKLM "${UNINSTALL_REG}" "NoModify" 1 |
|
|
|
WriteRegDWORD HKLM "${UNINSTALL_REG}" "NoRepair" 1 |
|
|
|
|
|
|
|
; Create uninstaller |
|
|
|
WriteUninstaller "$INSTDIR\Uninstall.exe" |
|
|
|
|
|
|
|
; Associate file type |
|
|
|
WriteRegStr HKLM "Software\Classes\.vcv" "" "VCVRack.Patch" |
|
|
|
WriteRegStr HKLM "Software\Classes\VCVRack.Patch" "" "VCV Rack Patch" |
|
|
|
WriteRegStr HKLM "Software\Classes\VCVRack.Patch" "" "VCV Rack patch" |
|
|
|
WriteRegStr HKLM "Software\Classes\VCVRack.Patch\shell\open\command" "" '"$INSTDIR\Rack.exe" "%1"' |
|
|
|
|
|
|
|
; Create shortcuts |
|
|
|
CreateShortcut "$DESKTOP\VCV Rack 2.lnk" "$INSTDIR\Rack.exe" |
|
|
|
CreateShortcut "$SMPROGRAMS\VCV Rack 2.lnk" "$INSTDIR\Rack.exe" |
|
|
|
CreateShortcut "$DESKTOP\${NAME}.lnk" "$INSTDIR\Rack.exe" |
|
|
|
CreateShortcut "$SMPROGRAMS\${NAME}.lnk" "$INSTDIR\Rack.exe" |
|
|
|
SectionEnd |
|
|
|
|
|
|
|
|
|
|
@@ -97,12 +116,12 @@ Section "Uninstall" |
|
|
|
; Attempt to remove C:\Program Files\VCV if empty |
|
|
|
RMDir "$INSTDIR\.." |
|
|
|
|
|
|
|
Delete "$DESKTOP\VCV Rack 2.lnk" |
|
|
|
Delete "$SMPROGRAMS\VCV Rack 2.lnk" |
|
|
|
Delete "$DESKTOP\${NAME}.lnk" |
|
|
|
Delete "$SMPROGRAMS\${NAME}.lnk" |
|
|
|
|
|
|
|
DeleteRegKey HKLM "Software\VCV\Rack2" |
|
|
|
DeleteRegKey HKLM "${INSTALL_REG}" |
|
|
|
DeleteRegKey /ifempty HKLM "Software\VCV" |
|
|
|
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCVRack2" |
|
|
|
DeleteRegKey HKLM "${UNINSTALL_REG}" |
|
|
|
DeleteRegKey HKLM "Software\Classes\.vcv" |
|
|
|
DeleteRegKey HKLM "Software\Classes\VCVRack.Patch" |
|
|
|
SectionEnd |