-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAcrylicSetup.nsi
156 lines (108 loc) · 4.19 KB
/
AcrylicSetup.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
;--------------------------------
; Include Modern UI
;--------------------------------
!include "MUI.nsh"
;--------------------------------
; General
;--------------------------------
Name "Acrylic DNS Proxy (2.2.0)"
OutFile "Acrylic.exe"
SetCompressor "lzma"
InstallDir "$PROGRAMFILES\Acrylic DNS Proxy"
RequestExecutionLevel admin
ShowInstDetails show
ShowUninstDetails show
;--------------------------------
; Pages
;--------------------------------
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "License.txt"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_TEXT "Please browse the online documentation from the Acrylic Start Menu for further informations about Acrylic configuration and startup options."
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
;--------------------------------
; Languages
;--------------------------------
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
; Sections
;--------------------------------
Section "Acrylic" SecMain
SetShellVarContext all
Call PerformInstallSystemChecks
SectionIn RO
SetOutPath "$INSTDIR"
File "AcrylicConfiguration.ini"
File "AcrylicHosts.txt"
File "AcrylicService.exe"
File "AcrylicConsole.exe"
File "AcrylicUI.exe.manifest"
File "AcrylicUI.exe"
File "License.txt"
File "ReadMe.txt"
File "InstallAcrylicService.bat"
File "StartAcrylicService.bat"
File "StopAcrylicService.bat"
File "RestartAcrylicService.bat"
File "PurgeAcrylicCacheData.bat"
File "ActivateAcrylicDebugLog.bat"
File "DeactivateAcrylicDebugLog.bat"
File "OpenAcrylicConfigurationFile.bat"
File "OpenAcrylicHostsFile.bat"
File "UninstallAcrylicService.bat"
WriteUninstaller "$INSTDIR\Uninstall.exe"
CreateDirectory "$SMPROGRAMS\Acrylic DNS Proxy"
CreateShortCut "$SMPROGRAMS\Acrylic DNS Proxy\Acrylic Home Page.lnk" "https://mayakron.altervista.org/support/acrylic/Home.htm"
CreateShortCut "$SMPROGRAMS\Acrylic DNS Proxy\Acrylic UI.lnk" "$INSTDIR\AcrylicUI.exe"
CreateShortCut "$SMPROGRAMS\Acrylic DNS Proxy\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
ExecWait "$INSTDIR\AcrylicUI.exe InstallAcrylicService"
SectionEnd
Section "Uninstall"
SetShellVarContext all
ExecWait "$INSTDIR\AcrylicUI.exe UninstallAcrylicService"
Delete "$SMPROGRAMS\Acrylic DNS Proxy\Acrylic Home Page.lnk"
Delete "$SMPROGRAMS\Acrylic DNS Proxy\Acrylic UI.lnk"
Delete "$SMPROGRAMS\Acrylic DNS Proxy\Uninstall.lnk"
RmDir "$SMPROGRAMS\Acrylic DNS Proxy"
Delete "$INSTDIR\AcrylicConfiguration.ini"
Delete "$INSTDIR\AcrylicHosts.txt"
Delete "$INSTDIR\AcrylicService.exe"
Delete "$INSTDIR\AcrylicConsole.exe"
Delete "$INSTDIR\AcrylicUI.exe.manifest"
Delete "$INSTDIR\AcrylicUI.exe"
Delete "$INSTDIR\AcrylicUI.ini"
Delete "$INSTDIR\License.txt"
Delete "$INSTDIR\ReadMe.txt"
Delete "$INSTDIR\InstallAcrylicService.bat"
Delete "$INSTDIR\StartAcrylicService.bat"
Delete "$INSTDIR\StopAcrylicService.bat"
Delete "$INSTDIR\RestartAcrylicService.bat"
Delete "$INSTDIR\PurgeAcrylicCacheData.bat"
Delete "$INSTDIR\ActivateAcrylicDebugLog.bat"
Delete "$INSTDIR\DeactivateAcrylicDebugLog.bat"
Delete "$INSTDIR\OpenAcrylicConfigurationFile.bat"
Delete "$INSTDIR\OpenAcrylicHostsFile.bat"
Delete "$INSTDIR\UninstallAcrylicService.bat"
Delete "$INSTDIR\AcrylicCache.dat"
Delete "$INSTDIR\AcrylicDebug.txt"
Delete "$INSTDIR\Uninstall.exe"
RmDir "$INSTDIR"
SectionEnd
;--------------------------------
; Functions
;--------------------------------
Function PerformInstallSystemChecks
DetailPrint "Performing system checks..."
IfFileExists "$INSTDIR\AcrylicService.exe" KO01
IfFileExists "$INSTDIR\AcrylicConsole.exe" KO01
Goto GOON
KO01:
MessageBox MB_OK|MB_ICONSTOP "An old version of Acrylic has been detected at the designated destination folder.$\n$\nYou must uninstall any old version of Acrylic before installing a new one. You may also want to backup your old AcrylicConfiguration.ini and AcrylicHosts.txt files, as the installation process will overwrite them with new content."
DetailPrint "Old version of Acrylic detected. Installation aborted."
Abort
GOON:
FunctionEnd