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.

126 lines
3.4KB

  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 VST 64-bit 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 VST 32-bit 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 VST 64-bit plugin" VST_64
  57. StrCpy $OUTDIR $VST_64_DIR
  58. CreateDirectory $OUTDIR
  59. File "dist\Rack\Bridge\VCV-Bridge-64.dll"
  60. SectionEnd
  61. Section "Bridge VST 32-bit plugin" VST_32
  62. StrCpy $OUTDIR $VST_32_DIR
  63. CreateDirectory $OUTDIR
  64. File "dist\Rack\Bridge\VCV-Bridge-32.dll"
  65. SectionEnd
  66. Section "Uninstall"
  67. RMDir /r "$INSTDIR\Rack"
  68. Delete "$INSTDIR\UninstallRack.exe"
  69. RMDir "$INSTDIR"
  70. Delete "$SMPROGRAMS\VCV Rack.lnk"
  71. DeleteRegKey /ifempty HKCU "Software\VCV Rack"
  72. DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack"
  73. SectionEnd
  74. ; Functions
  75. Function VST_64_DIR_PRE
  76. ${Unless} ${SectionIsSelected} ${VST_64}
  77. Abort
  78. ${EndUnless}
  79. FunctionEnd
  80. Function VST_32_DIR_PRE
  81. ${Unless} ${SectionIsSelected} ${VST_32}
  82. Abort
  83. ${EndUnless}
  84. FunctionEnd
  85. Function .onInit
  86. StrCpy $VST_64_DIR "$PROGRAMFILES\Steinberg\VSTPlugins"
  87. StrCpy $VST_32_DIR "$PROGRAMFILES (x86)\Steinberg\VSTPlugins"
  88. FunctionEnd