-
Notifications
You must be signed in to change notification settings - Fork 15
/
installer-script.bat
303 lines (237 loc) · 12 KB
/
installer-script.bat
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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
# ===================================================================
# This NSIS Script has been generated by SFX Tool
# Version 1.01
# Written by MuldeR ([email protected])
# Visit http://mulder.at.gg for further information!
#
# This application is based on NSIS v2.11 by Nullsoft
# ===================================================================
# -------------------------------------------------------------------
# Set Working Directory
# -------------------------------------------------------------------
!cd "C:\Program Files (x86)\MuldeR's Freeware\SFX Tool v1.01\Resources"
# -------------------------------------------------------------------
# Define Variables
# -------------------------------------------------------------------
var STARTMENU_FOLDER
# -------------------------------------------------------------------
# Choosing Compressor
# -------------------------------------------------------------------
SetCompressor LZMA
SetCompressorDictSize 32
SetCompress Auto
SetDatablockOptimize On
# -------------------------------------------------------------------
# SFX Definitions
# -------------------------------------------------------------------
!define SFX_AppID "{8FAB6A39-YAKD-49A0-BFBC-2675716E90E0}"; a unique ID for your SFX (It's real GUID)
!define SFX_BaseDir "C:\Program Files (x86)\MuldeR's Freeware\SFX Tool v1.01"; the SFX Tool install folder - do NOT edit!
!define SFX_Title "Yet Another Key Displayer"; the installer title
!define SFX_InstallDir "$PROGRAMFILES\Yet Another Key Displayer"; the *default* destination directory
!define SFX_OutFile "C:\Users\Jagailo\Desktop\YAKD 1.4 installer.exe"; the file to save the installer EXE to
!define SFX_IconFile "WinXP"; the installer icon
!define SFX_HeaderImage "Win"; the herader image
!define SFX_WizardImage "NSIS"; the wizard image
# -------------------------------------------------------------------
# Reserve Files
# -------------------------------------------------------------------
ReserveFile "Plugins\InstallOptions.dll"
ReserveFile "Plugins\LangDLL.dll"
ReserveFile "Plugins\StartMenu.dll"
ReserveFile "Plugins\UserInfo.dll"
ReserveFile "Contrib\Graphics\Wizard\${SFX_WizardImage}.bmp"
ReserveFile "Contrib\Graphics\Header\${SFX_HeaderImage}.bmp"
ReserveFile "Contrib\Graphics\Header\${SFX_HeaderImage}-R.bmp"
ReserveFile "Contrib\Modern UI\ioSpecial.ini"
# -------------------------------------------------------------------
# General Settings
# -------------------------------------------------------------------
XPStyle On
CRCCheck Force
ShowInstDetails Show
ShowUninstDetails Show
BrandingText "SFX Tool v1.01, NSIS v2.11"
Name "${SFX_Title}"
OutFile "${SFX_OutFile}"
InstallDir "${SFX_InstallDir}"
InstallDirRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SFX_AppID}" "InstallDirectory"
# -------------------------------------------------------------------
# Modern Interface Settings
# -------------------------------------------------------------------
!include "MUI.nsh"
!define MUI_ICON "Contrib\Graphics\Icons\${SFX_IconFile}-Install.ico"
!define MUI_WELCOMEFINISHPAGE_BITMAP "Contrib\Graphics\Wizard\${SFX_WizardImage}.bmp"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "Contrib\Graphics\Header\${SFX_HeaderImage}.bmp"
!define MUI_HEADERIMAGE_BITMAP_RTL "Contrib\Graphics\Header\${SFX_HeaderImage}-R.bmp"
!define MUI_ABORTWARNING
!define MUI_WELCOMEPAGE_TITLE_3LINES
!define MUI_FINISHPAGE_TITLE_3LINES
!define MUI_FINISHPAGE_NOAUTOCLOSE
!define MUI_LANGDLL_REGISTRY_ROOT "HKLM"
!define MUI_LANGDLL_REGISTRY_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SFX_AppID}"
!define MUI_LANGDLL_REGISTRY_VALUENAME "InstallLanguage"
!define MUI_LANGDLL_ALWAYSSHOW
!define MUI_FINISHPAGE_RUN "$INSTDIR\YAKD.exe"
!define MUI_FINISHPAGE_RUN_PARAMETERS ""
!define MUI_FINISHPAGE_LINK "https://github.com/Jagailo/YetAnotherKeyDisplayer"
!define MUI_FINISHPAGE_LINK_LOCATION "https://github.com/Jagailo/YetAnotherKeyDisplayer"
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SFX_AppID}"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "StartmenuFolder"
!define MUI_LICENSEPAGE_RADIOBUTTONS
!define MUI_UNICON "Contrib\Graphics\Icons\${SFX_IconFile}-Uninstall.ico"
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "Contrib\Graphics\Wizard\${SFX_WizardImage}.bmp"
!define MUI_UNFINISHPAGE_NOAUTOCLOSE
!define MUI_UNABORTWARNING
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "C:\Users\Jagailo\Documents\YetAnotherKeyDisplayer\LICENSE"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
# -------------------------------------------------------------------
# Multi-Language Support
# -------------------------------------------------------------------
!insertmacro MUI_LANGUAGE "English"
# -------------------------------------------------------------------
# Install Files Section
# -------------------------------------------------------------------
Section
SetOutPath "$INSTDIR"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\cs-CZ\Xceed.Wpf.AvalonDock.resources.dll"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\de\Xceed.Wpf.AvalonDock.resources.dll"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\es\Xceed.Wpf.AvalonDock.resources.dll"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\fr\Xceed.Wpf.AvalonDock.resources.dll"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\hu\Xceed.Wpf.AvalonDock.resources.dll"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\it\Xceed.Wpf.AvalonDock.resources.dll"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\ja-JP\Xceed.Wpf.AvalonDock.resources.dll"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\Newtonsoft.Json.dll"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\Newtonsoft.Json.xml"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\nl-BE\Xceed.Wpf.AvalonDock.resources.dll"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\pt-BR\Xceed.Wpf.AvalonDock.resources.dll"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\ro\Xceed.Wpf.AvalonDock.resources.dll"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\RTSSSharedMemoryNET.dll"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\RTSSSharedMemoryNET.xml"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\ru\Xceed.Wpf.AvalonDock.resources.dll"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\SharpVectors.Converters.Wpf.dll"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\SharpVectors.Converters.Wpf.xml"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\SharpVectors.Core.dll"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\SharpVectors.Core.xml"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\SharpVectors.Css.dll"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\SharpVectors.Css.xml"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\SharpVectors.Dom.dll"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\SharpVectors.Dom.xml"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\SharpVectors.Model.dll"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\SharpVectors.Model.xml"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\SharpVectors.Rendering.Gdi.dll"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\SharpVectors.Rendering.Gdi.xml"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\SharpVectors.Rendering.Wpf.dll"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\SharpVectors.Rendering.Wpf.xml"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\SharpVectors.Runtime.Wpf.dll"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\SharpVectors.Runtime.Wpf.xml"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\sv\Xceed.Wpf.AvalonDock.resources.dll"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\Xceed.Wpf.AvalonDock.dll"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\Xceed.Wpf.AvalonDock.Themes.Aero.dll"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\Xceed.Wpf.AvalonDock.Themes.Metro.dll"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\Xceed.Wpf.AvalonDock.Themes.VS2010.dll"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\Xceed.Wpf.Toolkit.dll"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\YAKD.exe"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\YAKD.exe.config"
File /r "C:\Users\Jagailo\Desktop\YAKD 1.4\zh-Hans\Xceed.Wpf.AvalonDock.resources.dll"
SectionEnd
# -------------------------------------------------------------------
# Create Uninstaller Section
# -------------------------------------------------------------------
Section
SetOutPath "$INSTDIR"
WriteUninstaller "$INSTDIR\Uninstall.exe"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SFX_AppID}" "DisplayName" "${SFX_Title}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SFX_AppID}" "DisplayIcon" "$\"$INSTDIR\Uninstall.exe$\""
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SFX_AppID}" "UninstallString" "$\"$INSTDIR\Uninstall.exe$\""
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SFX_AppID}" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SFX_AppID}" "NoRepair" 1
SectionEnd
# -------------------------------------------------------------------
# Startmenu Section
# -------------------------------------------------------------------
Section
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
SetShellVarContext all
CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\YAKD.lnk" "$INSTDIR\YAKD.exe"
SetShellVarContext current
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
# -------------------------------------------------------------------
# Desktop Section
# -------------------------------------------------------------------
Section
SetShellVarContext all
CreateShortCut "$DESKTOP\YAKD.lnk" "$INSTDIR\YAKD.exe"
SetShellVarContext current
SectionEnd
# -------------------------------------------------------------------
# Registry Section
# -------------------------------------------------------------------
Section
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SFX_AppID}" "" "${SFX_Title}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SFX_AppID}" "InstallDirectory" "$INSTDIR"
SectionEnd
# -------------------------------------------------------------------
# Initialization Functions
# -------------------------------------------------------------------
Function .onInit
InitPluginsDir
ClearErrors
UserInfo::GetName
IfErrors RunTheInstaller
Pop $0
UserInfo::GetAccountType
Pop $1
StrCmp $1 "Admin" RunTheInstaller
StrCmp $1 "Power" RunTheInstaller
MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "The user $\"$0$\" is not allowed to install this application.$\nPlease ask your administrator's permission !!!"
Quit
RunTheInstaller:
!insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd
# -------------------------------------------------------------------
# Uninstaller Section
# -------------------------------------------------------------------
Section "Uninstall"
RMDir /r "$INSTDIR"
!insertmacro MUI_STARTMENU_GETFOLDER Application $R0
SetShellVarContext all
RMDir /r "$SMPROGRAMS\$R0"
SetShellVarContext current
SetShellVarContext all
Delete "$DESKTOP\YAKD.lnk"
SetShellVarContext current
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SFX_AppID}"
SectionEnd
# -------------------------------------------------------------------
# Uninstaller Initialization Function
# -------------------------------------------------------------------
Function un.onInit
InitPluginsDir
ClearErrors
UserInfo::GetName
IfErrors RunTheUninstaller
Pop $0
UserInfo::GetAccountType
Pop $1
StrCmp $1 "Admin" RunTheUninstaller
StrCmp $1 "Power" RunTheUninstaller
MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "The user $\"$0$\" is not allowed to uninstall this application.$\nPlease ask your administrator's permission !!!"
Quit
RunTheUninstaller:
!insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd
# ===================================================================
# End of File
# ===================================================================