forked from VCVRack/Rack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
installer.nsi
88 lines (59 loc) · 2.76 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
!include "MUI2.nsh"
Name "VCV Rack"
OutFile "Rack-setup.exe"
SetCompressor "bzip2"
CRCCheck On
;Default installation folder
InstallDir "$PROGRAMFILES\VCV"
;Get installation folder from registry if available
InstallDirRegKey HKCU "Software\VCV Rack" ""
;Request application privileges for Windows Vista
RequestExecutionLevel admin
!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
; Pages
; !insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
;second directory selection
; Var DbInstDir
; !define MUI_PAGE_HEADER_SUBTEXT "Choose the folder in which to install the database."
; !define MUI_DIRECTORYPAGE_TEXT_TOP "The installer will install the database(s) in the following folder. To install in a differenct folder, click Browse and select another folder. Click Next to continue."
; !define MUI_DIRECTORYPAGE_VARIABLE $DbInstDir ; <= the other directory will be stored into that variable
; !insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
Section "!VCV Rack" VCVRACK
SetOutPath "$INSTDIR"
File /r "dist\Rack"
;Store installation folder
WriteRegStr HKCU "Software\VCV Rack" "" $INSTDIR
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "DisplayName" "VCV Rack"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "UninstallString" "$\"$INSTDIR\UninstallRack.exe$\""
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "QuietUninstallString" "$\"$INSTDIR\UninstallRack.exe$\" /S"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "InstallLocation" "$\"$INSTDIR$\""
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" "Publisher" "VCV"
;Create uninstaller
WriteUninstaller "$INSTDIR\UninstallRack.exe"
;Create shortcuts
CreateDirectory "$SMPROGRAMS"
; Set working directory of shortcut
SetOutPath "$INSTDIR\Rack"
CreateShortcut "$SMPROGRAMS\VCV Rack.lnk" "$INSTDIR\Rack\Rack.exe"
SectionEnd
; Section "VST Plugin" VST
; SectionEnd
Section "Uninstall"
RMDir /r "$INSTDIR\Rack"
Delete "$INSTDIR\UninstallRack.exe"
RMDir "$INSTDIR"
Delete "$SMPROGRAMS\VCV Rack.lnk"
DeleteRegKey /ifempty HKCU "Software\VCV Rack"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack"
SectionEnd