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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
; Maolan DAW Installer
; Run with: makensis.exe installer.nsi
; Requires all binaries and DLLs to be staged in C:\maolan-staging\daw
Unicode true
!include "MUI2.nsh"
!include "LogicLib.nsh"
!ifndef MAOLAN_VERSION
!define MAOLAN_VERSION "0.2.1"
!endif
!ifndef MAOLAN_PRODUCT_VERSION
!define MAOLAN_PRODUCT_VERSION "${MAOLAN_VERSION}.0"
!endif
;--------------------------------
; General
;--------------------------------
Name "Maolan"
OutFile "maolan-setup.exe"
InstallDir "$LOCALAPPDATA\Maolan"
InstallDirRegKey HKCU "Software\Maolan" "InstallDir"
RequestExecutionLevel user
;--------------------------------
; Version Info
;--------------------------------
VIProductVersion "${MAOLAN_PRODUCT_VERSION}"
VIAddVersionKey "ProductName" "Maolan"
VIAddVersionKey "ProductVersion" "${MAOLAN_VERSION}"
VIAddVersionKey "FileVersion" "${MAOLAN_VERSION}"
VIAddVersionKey "FileDescription" "Maolan Digital Audio Workstation"
VIAddVersionKey "LegalCopyright" "BSD-2-Clause"
;--------------------------------
; Interface Settings
;--------------------------------
!define MUI_ABORTWARNING
!ifndef MAOLAN_ICON
!define MAOLAN_ICON "..\images\maolan-icon.ico"
!endif
!define MUI_ICON "${MAOLAN_ICON}"
!define MUI_UNICON "${MAOLAN_ICON}"
;--------------------------------
; Pages
;--------------------------------
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "LICENSE"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
;--------------------------------
; Languages
;--------------------------------
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
; Installer Sections
;--------------------------------
Section "Install"
SetOutPath "$INSTDIR"
; Copy all staged binaries and DLLs
File "C:\maolan-staging\daw\*.*"
; Run VC++ Redistributable installer
ExecWait '"$INSTDIR\vc_redist.x64.exe" /install /quiet /norestart' $0
Delete "$INSTDIR\vc_redist.x64.exe"
; Store installation folder
WriteRegStr HKCU "Software\Maolan" "InstallDir" $INSTDIR
; Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
; Add to Add/Remove Programs
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Maolan" \
"DisplayName" "Maolan"
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Maolan" \
"UninstallString" "$\"$INSTDIR\Uninstall.exe$\""
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Maolan" \
"DisplayVersion" "${MAOLAN_VERSION}"
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Maolan" \
"Publisher" "Maolan Team"
WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Maolan" \
"NoModify" 1
WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Maolan" \
"NoRepair" 1
; Create Start Menu shortcuts
CreateDirectory "$SMPROGRAMS\Maolan"
CreateShortcut "$SMPROGRAMS\Maolan\Maolan.lnk" "$INSTDIR\maolan.exe" "" "$INSTDIR\maolan.exe" 0
CreateShortcut "$SMPROGRAMS\Maolan\Maolan CLI.lnk" "$INSTDIR\maolan-cli.exe" "" "$INSTDIR\maolan-cli.exe" 0
CreateShortcut "$SMPROGRAMS\Maolan\Uninstall.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0
; Create desktop shortcut
CreateShortcut "$DESKTOP\Maolan.lnk" "$INSTDIR\maolan.exe" "" "$INSTDIR\maolan.exe" 0
SectionEnd
;--------------------------------
; Uninstaller Section
;--------------------------------
Section "Uninstall"
Delete "$INSTDIR\maolan.exe"
Delete "$INSTDIR\maolan-cli.exe"
Delete "$INSTDIR\maolan-plugin-host.exe"
Delete "$INSTDIR\avcodec-62.dll"
Delete "$INSTDIR\avdevice-62.dll"
Delete "$INSTDIR\avfilter-11.dll"
Delete "$INSTDIR\avformat-62.dll"
Delete "$INSTDIR\avutil-60.dll"
Delete "$INSTDIR\swresample-6.dll"
Delete "$INSTDIR\Uninstall.exe"
Delete "$SMPROGRAMS\Maolan\Maolan.lnk"
Delete "$SMPROGRAMS\Maolan\Maolan CLI.lnk"
Delete "$SMPROGRAMS\Maolan\Uninstall.lnk"
RMDir "$SMPROGRAMS\Maolan"
Delete "$DESKTOP\Maolan.lnk"
DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Maolan"
DeleteRegKey HKCU "Software\Maolan"
RMDir "$INSTDIR"
SectionEnd