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.

100 lines
3.3KB

  1. !include "MUI2.nsh"
  2. Name "VCV Rack ${VERSION}"
  3. OutFile "installer.exe"
  4. SetCompressor /solid "lzma"
  5. CRCCheck On
  6. ; Default installation folder
  7. InstallDir "$PROGRAMFILES\VCV\Rack"
  8. ; Get installation folder from registry if available
  9. InstallDirRegKey HKLM "Software\VCV\Rack" ""
  10. ; Request admin permissions so we can install to Program Files and add a registry entry
  11. RequestExecutionLevel admin
  12. ; MUI pages
  13. !define MUI_ICON "icon.ico"
  14. !define MUI_HEADERIMAGE
  15. ;!define MUI_HEADERIMAGE_BITMAP "installer-banner.bmp" ; 150x57
  16. ;!define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\win.bmp" ; 164x314
  17. ;!define MUI_UNWELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\win.bmp" ; 164x314
  18. !define MUI_COMPONENTSPAGE_NODESC
  19. !insertmacro MUI_PAGE_COMPONENTS
  20. !insertmacro MUI_PAGE_DIRECTORY
  21. !insertmacro MUI_PAGE_INSTFILES
  22. !define MUI_FINISHPAGE_RUN "$INSTDIR\Rack.exe"
  23. !define MUI_FINISHPAGE_RUN_TEXT "Launch VCV Rack"
  24. !insertmacro MUI_PAGE_FINISH
  25. !insertmacro MUI_UNPAGE_CONFIRM
  26. !insertmacro MUI_UNPAGE_INSTFILES
  27. !insertmacro MUI_LANGUAGE "English"
  28. ; Sections
  29. Section "VCV Rack" VCV_RACK_SECTION
  30. SectionIn RO
  31. SetOutPath "$INSTDIR"
  32. File /r "dist\Rack\*"
  33. ; Store installation folder
  34. WriteRegStr HKLM "Software\VCV\Rack" "" "$INSTDIR"
  35. ; Write uninstaller info
  36. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "DisplayName" "VCV Rack"
  37. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "DisplayIcon" '"$INSTDIR\Rack.exe"'
  38. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "DisplayVersion" "${VERSION}"
  39. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "UninstallString" '"$INSTDIR\Uninstall.exe"'
  40. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "QuietUninstallString" '"$INSTDIR\Uninstall.exe" /S'
  41. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "InstallLocation" '"$INSTDIR"'
  42. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "Publisher" "VCV"
  43. SectionGetSize ${VCV_RACK_SECTION} $0
  44. WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "EstimatedSize" $0
  45. WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "NoModify" 1
  46. WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "NoRepair" 1
  47. ; Create uninstaller
  48. WriteUninstaller "$INSTDIR\Uninstall.exe"
  49. ; Associate file type
  50. WriteRegStr HKLM "Software\Classes\.vcv" "" "VCVRack.Patch"
  51. WriteRegStr HKLM "Software\Classes\VCVRack.Patch" "" "VCV Rack Patch"
  52. WriteRegStr HKLM "Software\Classes\VCVRack.Patch\shell\open\command" "" '"$INSTDIR\Rack.exe" "%1"'
  53. ; Create shortcuts
  54. CreateDirectory "$SMPROGRAMS"
  55. CreateShortcut "$SMPROGRAMS\VCV Rack.lnk" "$INSTDIR\Rack.exe"
  56. SectionEnd
  57. Section "Uninstall"
  58. Delete "$INSTDIR\Uninstall.exe"
  59. Delete "$INSTDIR\*"
  60. RMDir /r "$INSTDIR\res"
  61. RMDir "$INSTDIR"
  62. RMDir "$INSTDIR\.."
  63. Delete "$SMPROGRAMS\VCV Rack.lnk"
  64. DeleteRegKey HKLM "Software\VCV\Rack"
  65. DeleteRegKey /ifempty HKLM "Software\VCV"
  66. DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack"
  67. DeleteRegKey HKLM "Software\Classes\.vcv"
  68. DeleteRegKey HKLM "Software\Classes\VCVRack.Patch"
  69. SectionEnd
  70. ; Functions