forked from VCVRack/Rack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
installer.nsi
99 lines (70 loc) · 3.27 KB
/
installer.nsi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
!include "MUI2.nsh"
Name "VCV Rack ${VERSION}"
OutFile "installer.exe"
SetCompressor /solid "lzma"
CRCCheck On
; Default installation folder
InstallDir "$PROGRAMFILES\VCV\Rack"
; Get installation folder from registry if available
InstallDirRegKey HKLM "Software\VCV\Rack" ""
; Request admin permissions so we can install to Program Files and add a registry entry
RequestExecutionLevel admin
; MUI pages
!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_COMPONENTSPAGE_NODESC
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_RUN "$INSTDIR\Rack.exe"
!define MUI_FINISHPAGE_RUN_TEXT "Launch VCV Rack"
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
; Sections
Section "VCV Rack" VCV_RACK_SECTION
SectionIn RO
SetOutPath "$INSTDIR"
File /r "dist\Rack\*"
; Store installation folder
WriteRegStr HKLM "Software\VCV\Rack" "" "$INSTDIR"
; Write uninstaller info
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "DisplayName" "VCV Rack"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "DisplayIcon" '"$INSTDIR\Rack.exe"'
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "DisplayVersion" "${VERSION}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "UninstallString" '"$INSTDIR\Uninstall.exe"'
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "QuietUninstallString" '"$INSTDIR\Uninstall.exe" /S'
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "InstallLocation" '"$INSTDIR"'
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "Publisher" "VCV"
SectionGetSize ${VCV_RACK_SECTION} $0
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "EstimatedSize" $0
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "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\shell\open\command" "" '"$INSTDIR\Rack.exe" "%1"'
; Create shortcuts
CreateDirectory "$SMPROGRAMS"
CreateShortcut "$SMPROGRAMS\VCV Rack.lnk" "$INSTDIR\Rack.exe"
SectionEnd
Section "Uninstall"
Delete "$INSTDIR\Uninstall.exe"
Delete "$INSTDIR\*"
RMDir /r "$INSTDIR\res"
RMDir "$INSTDIR"
RMDir "$INSTDIR\.."
Delete "$SMPROGRAMS\VCV Rack.lnk"
DeleteRegKey HKLM "Software\VCV\Rack"
DeleteRegKey /ifempty HKLM "Software\VCV"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack"
DeleteRegKey HKLM "Software\Classes\.vcv"
DeleteRegKey HKLM "Software\Classes\VCVRack.Patch"
SectionEnd
; Functions