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.

90 lines
2.6KB

  1. !include "MUI2.nsh"
  2. Name "VCV Rack"
  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" "UninstallString" "$\"$INSTDIR\Uninstall.exe$\""
  39. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "QuietUninstallString" "$\"$INSTDIR\Uninstall.exe$\" \S"
  40. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "InstallLocation" "$\"$INSTDIR$\""
  41. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "Publisher" "VCV"
  42. SectionGetSize ${VCV_RACK_SECTION} $0
  43. WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "EstimatedSize" $0
  44. ; Create uninstaller
  45. WriteUninstaller "$INSTDIR\Uninstall.exe"
  46. ; Create shortcuts
  47. CreateDirectory "$SMPROGRAMS"
  48. CreateShortcut "$SMPROGRAMS\VCV Rack.lnk" "$INSTDIR\Rack.exe"
  49. SectionEnd
  50. Section "Uninstall"
  51. Delete "$INSTDIR\Uninstall.exe"
  52. Delete "$INSTDIR\*"
  53. RMDir /r "$INSTDIR\res"
  54. RMDir "$INSTDIR"
  55. RMDir "$INSTDIR\.."
  56. Delete "$SMPROGRAMS\VCV Rack.lnk"
  57. DeleteRegKey HKLM "Software\VCV\Rack"
  58. DeleteRegKey /ifempty HKLM "Software\VCV"
  59. DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack"
  60. SectionEnd
  61. ; Functions