You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

128 lines
3.5KB

  1. !include "MUI2.nsh"
  2. Name "VCV Rack"
  3. OutFile "Rack-setup.exe"
  4. SetCompressor "bzip2"
  5. CRCCheck On
  6. ;Default installation folder
  7. InstallDir "$PROGRAMFILES\VCV"
  8. ;Get installation folder from registry if available
  9. InstallDirRegKey HKCU "Software\VCV Rack" ""
  10. ;Request admin permissions so we can install to Program Files and add a registry entry
  11. RequestExecutionLevel admin
  12. !define MUI_ICON "icon.ico"
  13. !define MUI_HEADERIMAGE
  14. !define MUI_HEADERIMAGE_BITMAP "installer-banner.bmp" ; 150x57
  15. ; !define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\win.bmp" ; 164x314
  16. ; !define MUI_UNWELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\win.bmp" ; 164x314
  17. !define MUI_COMPONENTSPAGE_NODESC
  18. ; Pages
  19. !insertmacro MUI_PAGE_COMPONENTS
  20. !insertmacro MUI_PAGE_DIRECTORY
  21. Var VST_64_DIR
  22. !define MUI_DIRECTORYPAGE_VARIABLE $VST_64_DIR
  23. !define MUI_DIRECTORYPAGE_TEXT_TOP "Bridge 64-bit VST plugin install directory"
  24. !define MUI_PAGE_CUSTOMFUNCTION_PRE VST_64_DIR_PRE
  25. !insertmacro MUI_PAGE_DIRECTORY
  26. Var VST_32_DIR
  27. !define MUI_DIRECTORYPAGE_VARIABLE $VST_32_DIR
  28. !define MUI_DIRECTORYPAGE_TEXT_TOP "Bridge 32-bit VST plugin install directory"
  29. !define MUI_PAGE_CUSTOMFUNCTION_PRE VST_32_DIR_PRE
  30. !insertmacro MUI_PAGE_DIRECTORY
  31. !insertmacro MUI_PAGE_INSTFILES
  32. !insertmacro MUI_UNPAGE_CONFIRM
  33. !insertmacro MUI_UNPAGE_INSTFILES
  34. !insertmacro MUI_LANGUAGE "English"
  35. ; Sections
  36. Section "VCV Rack" VCVRACK
  37. SectionIn RO
  38. SetOutPath "$INSTDIR"
  39. CreateDirectory $OUTDIR
  40. File /r /x "Bridge" "dist\Rack"
  41. ;Store installation folder
  42. WriteRegStr HKCU "Software\VCV Rack" "" $INSTDIR
  43. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "DisplayName" "VCV Rack"
  44. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "UninstallString" "$\"$INSTDIR\UninstallRack.exe$\""
  45. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "QuietUninstallString" "$\"$INSTDIR\UninstallRack.exe$\" /S"
  46. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "InstallLocation" "$\"$INSTDIR$\""
  47. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "Publisher" "VCV"
  48. ;Create uninstaller
  49. WriteUninstaller "$INSTDIR\UninstallRack.exe"
  50. ;Create shortcuts
  51. CreateDirectory "$SMPROGRAMS"
  52. ; Set working directory of shortcut
  53. SetOutPath "$INSTDIR\Rack"
  54. CreateShortcut "$SMPROGRAMS\VCV Rack.lnk" "$INSTDIR\Rack\Rack.exe"
  55. SectionEnd
  56. Section "Bridge 64-bit VST plugin" VST_64
  57. StrCpy $OUTDIR $VST_64_DIR
  58. CreateDirectory $OUTDIR
  59. File "dist\Rack\Bridge\VCV-Bridge-64.dll"
  60. File "dist\Rack\Bridge\VCV-Bridge-fx-64.dll"
  61. SectionEnd
  62. Section "Bridge 32-bit VST plugin" VST_32
  63. StrCpy $OUTDIR $VST_32_DIR
  64. CreateDirectory $OUTDIR
  65. File "dist\Rack\Bridge\VCV-Bridge-32.dll"
  66. File "dist\Rack\Bridge\VCV-Bridge-fx-32.dll"
  67. SectionEnd
  68. Section "Uninstall"
  69. RMDir /r "$INSTDIR\Rack"
  70. Delete "$INSTDIR\UninstallRack.exe"
  71. RMDir "$INSTDIR"
  72. Delete "$SMPROGRAMS\VCV Rack.lnk"
  73. DeleteRegKey /ifempty HKCU "Software\VCV Rack"
  74. DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack"
  75. SectionEnd
  76. ; Functions
  77. Function VST_64_DIR_PRE
  78. ${Unless} ${SectionIsSelected} ${VST_64}
  79. Abort
  80. ${EndUnless}
  81. FunctionEnd
  82. Function VST_32_DIR_PRE
  83. ${Unless} ${SectionIsSelected} ${VST_32}
  84. Abort
  85. ${EndUnless}
  86. FunctionEnd
  87. Function .onInit
  88. StrCpy $VST_64_DIR "$PROGRAMFILES\Steinberg\VSTPlugins"
  89. StrCpy $VST_32_DIR "$PROGRAMFILES (x86)\Steinberg\VSTPlugins"
  90. FunctionEnd