-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNSIS_Setup.nsi
235 lines (211 loc) Β· 9.65 KB
/
NSIS_Setup.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
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
; Script generated by the HM NIS Edit Script Wizard.
; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "Q-Drive"
!define PRODUCT_VERSION "1.2.1"
!define PRODUCT_PUBLISHER "Endev"
!define PRODUCT_WEB_SITE "https://endev.at/p/q-drive"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\QDriveAutostart.exe"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
!define PRODUCT_STARTMENU_REGVAL "NSIS:StartMenuDir"
SetCompressor lzma
; MUI 1.67 compatible ------
!include "MUI.nsh"
; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "Content\QDriveLogo.ico"
!define MUI_UNICON "Content\QDriveUninstall.ico"
; Welcome page
!insertmacro MUI_PAGE_WELCOME
; License page
!insertmacro MUI_PAGE_LICENSE "LICENSE"
; Components page
!insertmacro MUI_PAGE_COMPONENTS
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Start menu page
var ICONS_GROUP
!define MUI_STARTMENUPAGE_NODISABLE
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "Q-Drive"
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${PRODUCT_STARTMENU_REGVAL}"
!insertmacro MUI_PAGE_STARTMENU Application $ICONS_GROUP
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!define MUI_FINISHPAGE_RUN "$INSTDIR\QDriveAutostart.exe"
!insertmacro MUI_PAGE_FINISH
; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES
; Language files
!insertmacro MUI_LANGUAGE "English"
; Reserve files
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
; MUI end ------
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "QDrive_Setup.exe"
InstallDir "$PROGRAMFILES\Endev\Q-Drive"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show
ShowUnInstDetails show
Section "Q-Drive Base" SEC01
SetOutPath "$INSTDIR"
SetOverwrite ifnewer
File "QDriveManager\bin\Release\BouncyCastle.Crypto.dll"
File "QDriveManager\bin\Release\EnvDTE.dll"
File "QDriveManager\bin\Release\Google.Protobuf.dll"
File "QDriveManager\bin\Release\K4os.Compression.LZ4.dll"
File "QDriveManager\bin\Release\K4os.Compression.LZ4.Streams.dll"
File "QDriveManager\bin\Release\K4os.Hash.xxHash.dll"
File "QDriveManager\bin\Release\MySql.Data.dll"
File "QDriveManager\bin\Release\QDriveLib.dll"
File "QDriveManager\bin\Release\QDriveLib.dll.config"
File "QDriveManager\bin\Release\Renci.SshNet.dll"
File "QDriveManager\bin\Release\stdole.dll"
File "QDriveManager\bin\Release\Syncfusion.Data.WinForms.dll"
File "QDriveManager\bin\Release\Syncfusion.Grid.Base.dll"
File "QDriveManager\bin\Release\Syncfusion.Grid.Windows.dll"
File "QDriveManager\bin\Release\Syncfusion.Grid.Windows.XmlSerializers.dll"
File "QDriveManager\bin\Release\Syncfusion.Licensing.dll"
File "QDriveManager\bin\Release\Syncfusion.Shared.Base.dll"
File "QDriveManager\bin\Release\Syncfusion.Shared.Windows.dll"
File "QDriveManager\bin\Release\Syncfusion.SpellChecker.Base.dll"
File "QDriveManager\bin\Release\Syncfusion.Tools.Base.dll"
File "QDriveManager\bin\Release\Syncfusion.Tools.Windows.dll"
File "QDriveManager\bin\Release\System.Buffers.dll"
File "QDriveManager\bin\Release\System.Data.SQLite.dll"
File "QDriveManager\bin\Release\System.Memory.dll"
File "QDriveManager\bin\Release\System.Numerics.Vectors.dll"
File "QDriveManager\bin\Release\System.Runtime.CompilerServices.Unsafe.dll"
File "QDriveManager\bin\Release\Ubiety.Dns.Core.dll"
File "QDriveManager\bin\Release\WrapMySQL.dll"
File "QDriveManager\bin\Release\WrapSQLBase.dll"
File "QDriveManager\bin\Release\WrapSQLite.dll"
SetOutPath "$INSTDIR\x64"
File "QDriveManager\bin\Release\x64\SQLite.Interop.dll"
SetOutPath "$INSTDIR\x86"
File "QDriveManager\bin\Release\x86\SQLite.Interop.dll"
SetOutPath "$INSTDIR"
File "QDriveManager\bin\Release\ZstdNet.dll"
SetOverwrite ifnewer
File "QDriveAutostart\bin\Release\QDriveAutostart.exe"
File "QDriveAutostart\bin\Release\QDriveAutostart.exe.config"
File "QDriveManager\bin\Release\QDriveManager.exe"
File "QDriveManager\bin\Release\QDriveManager.exe.config"
File "QDriveSetup\bin\Release\QDriveSetup.exe"
File "QDriveSetup\bin\Release\QDriveSetup.exe.config"
; Shortcuts
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Q-Drive.lnk" "$INSTDIR\QDriveAutostart.exe"
CreateDirectory "$INSTDIR"
CreateShortCut "$INSTDIR\Q-Drive.lnk" "$INSTDIR\QDriveAutostart.exe"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Q-Drive Manager.lnk" "$INSTDIR\QDriveManager.exe"
CreateShortCut "$DESKTOP\Q-Drive Manager.lnk" "$INSTDIR\QDriveManager.exe"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Q-Drive Setup.lnk" "$INSTDIR\QDriveSetup.exe"
; CreateShortCut "$SMSTARTUP\Q-Drive.lnk" "$INSTDIR\QDriveAutostart.exe"
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
Section "Q-Drive Admin Console" SEC02
File "QDriveAdminConsole\bin\Release\QDriveAdminConsole.exe"
File "QDriveAdminConsole\bin\Release\QDriveAdminConsole.exe.config"
; Shortcuts
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Q-Drive Admin Console.lnk" "$INSTDIR\QDriveAdminConsole.exe"
CreateShortCut "$DESKTOP\Q-Drive Admin Console.lnk" "$INSTDIR\QDriveAdminConsole.exe"
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
Section -AdditionalIcons
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk" "$INSTDIR\uninst.exe"
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
Section -Post
WriteUninstaller "$INSTDIR\uninst.exe"
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\QDriveAutostart.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\QDriveAutostart.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
SectionEnd
; Section descriptions
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SEC01} "Required. The Main Q-Drive Program and management tools"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC02} "Admin-Console for configuring QD-Online. Only required for network or system administrator."
!insertmacro MUI_FUNCTION_DESCRIPTION_END
Function un.onUninstSuccess
HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was uninstalled successfully."
FunctionEnd
Function un.onInit
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Do you want to uninstall $(^Name) and all of its components?" IDYES +2
Abort
FunctionEnd
Section Uninstall
!insertmacro MUI_STARTMENU_GETFOLDER "Application" $ICONS_GROUP
Delete "$INSTDIR\${PRODUCT_NAME}.url"
Delete "$INSTDIR\uninst.exe"
Delete "$INSTDIR\QDriveAdminConsole.exe"
Delete "$INSTDIR\QDriveAdminConsole.exe.config"
Delete "$INSTDIR\QDriveSetup.exe"
Delete "$INSTDIR\QDriveSetup.exe.config"
Delete "$INSTDIR\QDriveManager.exe"
Delete "$INSTDIR\QDriveManager.exe.config"
Delete "$INSTDIR\QDriveAutostart.exe"
Delete "$INSTDIR\QDriveAutostart.exe.config"
Delete "$INSTDIR\ZstdNet.dll"
Delete "$INSTDIR\x86\SQLite.Interop.dll"
Delete "$INSTDIR\x64\SQLite.Interop.dll"
Delete "$INSTDIR\Ubiety.Dns.Core.dll"
Delete "$INSTDIR\System.Runtime.CompilerServices.Unsafe.dll"
Delete "$INSTDIR\System.Numerics.Vectors.dll"
Delete "$INSTDIR\System.Memory.dll"
Delete "$INSTDIR\System.Data.SQLite.dll"
Delete "$INSTDIR\System.Buffers.dll"
Delete "$INSTDIR\Syncfusion.Tools.Windows.dll"
Delete "$INSTDIR\Syncfusion.Tools.Base.dll"
Delete "$INSTDIR\Syncfusion.SpellChecker.Base.dll"
Delete "$INSTDIR\Syncfusion.Shared.Windows.dll"
Delete "$INSTDIR\Syncfusion.Shared.Base.dll"
Delete "$INSTDIR\Syncfusion.Licensing.dll"
Delete "$INSTDIR\Syncfusion.Grid.Windows.XmlSerializers.dll"
Delete "$INSTDIR\Syncfusion.Grid.Windows.dll"
Delete "$INSTDIR\Syncfusion.Grid.Base.dll"
Delete "$INSTDIR\Syncfusion.Data.WinForms.dll"
Delete "$INSTDIR\stdole.dll"
Delete "$INSTDIR\Renci.SshNet.dll"
Delete "$INSTDIR\QDriveLib.dll.config"
Delete "$INSTDIR\QDriveLib.dll"
Delete "$INSTDIR\MySql.Data.dll"
Delete "$INSTDIR\K4os.Hash.xxHash.dll"
Delete "$INSTDIR\K4os.Compression.LZ4.Streams.dll"
Delete "$INSTDIR\K4os.Compression.LZ4.dll"
Delete "$INSTDIR\Google.Protobuf.dll"
Delete "$INSTDIR\EnvDTE.dll"
Delete "$INSTDIR\BouncyCastle.Crypto.dll"
Delete "$INSTDIR\WrapMySQL.dll"
Delete "$INSTDIR\WrapSQLBase.dll"
Delete "$INSTDIR\WrapSQLite.dll"
Delete "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Website.lnk"
Delete "$DESKTOP\Q-Drive Admin Console.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Q-Drive Admin Console.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Q-Drive Setup.lnk"
Delete "$DESKTOP\Q-Drive Manager.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Q-Drive Manager.lnk"
Delete "$INSTDIR\Q-Drive.lnk"
Delete "$SMPROGRAMS\$ICONS_GROUP\Q-Drive.lnk"
; Delete "$SMSTARTUP\Q-Drive.lnk"
RMDir "$SMPROGRAMS\$ICONS_GROUP"
RMDir "$INSTDIR\x86"
RMDir "$INSTDIR\x64"
RMDir "$INSTDIR"
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
SetAutoClose true
SectionEnd