-
Notifications
You must be signed in to change notification settings - Fork 16
/
MakefileCfgClient.mak
205 lines (171 loc) · 8.84 KB
/
MakefileCfgClient.mak
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
#
# eduVPN - VPN for education and research
#
# Copyright: 2017-2024 The Commons Conservancy
# SPDX-License-Identifier: GPL-3.0+
#
# WiX parameters
WIX_CANDLE_FLAGS_CFG_CLIENT=$(WIX_CANDLE_FLAGS_CFG) \
-dClientTarget="$(CLIENT_TARGET)" \
-dClientTitle="$(CLIENT_TITLE)" \
-dClientUpgradeCode="$(CLIENT_UPGRADE_CODE)" \
-dClientAboutUri="$(CLIENT_ABOUT_URI)" \
-dClientUrn="$(CLIENT_URN)" \
-dClientId="$(CLIENT_ID)" \
-dIDS_CLIENT_PREFIX="$(IDS_CLIENT_PREFIX)"
######################################################################
# Setup
######################################################################
!IF "$(CFG)" == "$(SETUP_CFG)"
SetupBoot :: \
"bin\$(CFG)\x86\Engine_$(CLIENT_TARGET)Client_$(VERSION)$(CFG_TARGET).exe"
"bin\$(CFG)\x86\Engine_$(CLIENT_TARGET)Client_$(VERSION)$(CFG_TARGET).exe" : \
"bin\$(CFG)\$(CLIENT_TARGET)Client_$(VERSION)$(CFG_TARGET).exe"
"$(WIX)bin\insignia.exe" $(WIX_INSIGNIA_FLAGS) -ib $** -o $@
SetupSignBoot : "bin\$(CFG)\x86\Engine_$(CLIENT_TARGET)Client_$(VERSION)$(CFG_TARGET).exe"
Clean ::
-if exist "bin\$(CFG)\x86\Engine_$(CLIENT_TARGET)Client_*.exe" del /f /q "bin\$(CFG)\x86\Engine_$(CLIENT_TARGET)Client_*.exe"
SetupExe :: \
"bin\Setup\$(CLIENT_TARGET)Client_$(VERSION)$(CFG_TARGET).exe"
"bin\Setup\$(CLIENT_TARGET)Client_$(VERSION)$(CFG_TARGET).exe" : \
"bin\$(CFG)\$(CLIENT_TARGET)Client_$(VERSION)$(CFG_TARGET).exe" \
"bin\$(CFG)\x86\Engine_$(CLIENT_TARGET)Client_$(VERSION)$(CFG_TARGET).exe"
"$(WIX)bin\insignia.exe" $(WIX_INSIGNIA_FLAGS) -ab "bin\$(CFG)\x86\Engine_$(CLIENT_TARGET)Client_$(VERSION)$(CFG_TARGET).exe" "bin\$(CFG)\$(CLIENT_TARGET)Client_$(VERSION)$(CFG_TARGET).exe" -o $@
SetupSignExe : "bin\Setup\$(CLIENT_TARGET)Client_$(VERSION)$(CFG_TARGET).exe"
Clean ::
-if exist "bin\Setup\$(CLIENT_TARGET)Client_*.exe" del /f /q "bin\Setup\$(CLIENT_TARGET)Client_*.exe"
-if exist "bin\Setup\$(CLIENT_TARGET)Client_*.msi" del /f /q "bin\Setup\$(CLIENT_TARGET)Client_*.msi"
!ENDIF
!IF "$(CFG)" == "Release"
Publish :: \
"bin\Setup\$(CLIENT_TARGET)Client_$(VERSION)$(CFG_TARGET).exe" \
"bin\Setup\$(CLIENT_TARGET).windows.json" \
"bin\Setup\winget-manifests\s\SURF\$(CLIENT_TARGET)Client\$(VERSION)" \
"bin\Setup\winget-manifests\s\SURF\$(CLIENT_TARGET)Client\$(VERSION)\SURF.$(CLIENT_TARGET)Client.installer.yaml" \
"bin\Setup\winget-manifests\s\SURF\$(CLIENT_TARGET)Client\$(VERSION)\SURF.$(CLIENT_TARGET)Client.locale.en-US.yaml" \
"bin\Setup\winget-manifests\s\SURF\$(CLIENT_TARGET)Client\$(VERSION)\SURF.$(CLIENT_TARGET)Client.yaml"
!IFDEF VIRUSTOTALAPIKEY
PublishVTUpload :: \
"bin\Setup\$(CLIENT_TARGET)Client_$(VERSION)$(CFG_TARGET).vtanalysis"
PublishVTJoin ::
cscript.exe "bin\VirusTotal.wsf" $(CSCRIPT_FLAGS) //Job:JoinAnalysis "bin\Setup\$(CLIENT_TARGET)Client_$(VERSION)$(CFG_TARGET).vtanalysis"
!ENDIF
"bin\Setup\$(CLIENT_TARGET)Client_$(VERSION)$(CFG_TARGET).vtanalysis" : "bin\Setup\$(CLIENT_TARGET)Client_$(VERSION)$(CFG_TARGET).exe"
Clean ::
-if exist "bin\Setup\$(CLIENT_TARGET)Client_*$(CFG_TARGET).vtanalysis" del /f /q "bin\Setup\$(CLIENT_TARGET)Client_*$(CFG_TARGET).vtanalysis"
"bin\Setup\$(CLIENT_TARGET).windows.json" : "bin\Setup\$(CLIENT_TARGET)Client_$(VERSION)$(CFG_TARGET).exe"
move /y << "$(@:"=).tmp" > NUL
{"arguments": "/install",
"uri": [ "https://github.com/Amebis/eduVPN/releases/download/$(VERSION)/$(CLIENT_TARGET)Client_$(VERSION)$(CFG_TARGET).exe" ],
"version": "$(VERSION)",
"changelog_uri": "https://github.com/Amebis/eduVPN/blob/master/CHANGES.md",
<<NOKEEP
for /f %%a in ('CertUtil.exe -hashfile $** SHA256 ^| findstr /r "^[0-9a-f]*$$"') do @echo "hash-sha256": "%%a"}>> "$(@:"=).tmp"
move /y "$(@:"=).tmp" $@ > NUL
"bin\Setup\winget-manifests\s\SURF\$(CLIENT_TARGET)Client" : "bin\Setup\winget-manifests\s\SURF"
if not exist $@ md $@
"bin\Setup\winget-manifests\s\SURF\$(CLIENT_TARGET)Client\$(VERSION)" : "bin\Setup\winget-manifests\s\SURF\$(CLIENT_TARGET)Client"
if not exist $@ md $@
"bin\Setup\winget-manifests\s\SURF\$(CLIENT_TARGET)Client\$(VERSION)\SURF.$(CLIENT_TARGET)Client.installer.yaml" : \
"bin\Setup\$(CLIENT_TARGET)Client_$(VERSION)$(CFG_TARGET)_ARM64.msi" \
"bin\Setup\$(CLIENT_TARGET)Client_$(VERSION)$(CFG_TARGET)_x64.msi" \
"bin\Setup\$(CLIENT_TARGET)Client_$(VERSION)$(CFG_TARGET)_x86.msi"
move /y << "$(@:"=).tmp" > NUL
# Created using eduVPN build system
# yaml-language-server: $$schema=https://aka.ms/winget-manifest.installer.1.6.0.schema.json
PackageIdentifier: SURF.$(CLIENT_TARGET)Client
PackageVersion: $(VERSION)
Installers:
- Architecture: arm64
InstallerType: wix
InstallerUrl: https://github.com/Amebis/eduVPN/releases/download/$(VERSION)/$(CLIENT_TARGET)Client_$(VERSION)$(CFG_TARGET)_ARM64.msi
<<NOKEEP
for /f %%a in ('CertUtil.exe -hashfile "bin\Setup\$(CLIENT_TARGET)Client_$(VERSION)$(CFG_TARGET)_ARM64.msi" SHA256 ^| findstr /r "^[0-9a-f]*$$"') do @echo ^ ^ InstallerSha256: %%a>> "$(@:"=).tmp"
type << >> "$(@:"=).tmp"
AppsAndFeaturesEntries:
- ProductCode: '$(CLIENT_PRODUCT_CODE)'
DisplayName: $(CLIENT_TITLE) Client $(VERSION) ARM64
UpgradeCode: '$(CLIENT_UPGRADE_GUID_64)'
- Architecture: x64
InstallerType: wix
InstallerUrl: https://github.com/Amebis/eduVPN/releases/download/$(VERSION)/$(CLIENT_TARGET)Client_$(VERSION)$(CFG_TARGET)_x64.msi
<<NOKEEP
for /f %%a in ('CertUtil.exe -hashfile "bin\Setup\$(CLIENT_TARGET)Client_$(VERSION)$(CFG_TARGET)_x64.msi" SHA256 ^| findstr /r "^[0-9a-f]*$$"') do @echo ^ ^ InstallerSha256: %%a>> "$(@:"=).tmp"
type << >> "$(@:"=).tmp"
AppsAndFeaturesEntries:
- ProductCode: '$(CLIENT_PRODUCT_CODE)'
DisplayName: $(CLIENT_TITLE) Client $(VERSION) x64
UpgradeCode: '$(CLIENT_UPGRADE_GUID_64)'
- Architecture: x86
InstallerType: wix
InstallerUrl: https://github.com/Amebis/eduVPN/releases/download/$(VERSION)/$(CLIENT_TARGET)Client_$(VERSION)$(CFG_TARGET)_x86.msi
<<NOKEEP
for /f %%a in ('CertUtil.exe -hashfile "bin\Setup\$(CLIENT_TARGET)Client_$(VERSION)$(CFG_TARGET)_x86.msi" SHA256 ^| findstr /r "^[0-9a-f]*$$"') do @echo ^ ^ InstallerSha256: %%a>> "$(@:"=).tmp"
type << >> "$(@:"=).tmp"
AppsAndFeaturesEntries:
- ProductCode: '$(CLIENT_PRODUCT_CODE)'
DisplayName: $(CLIENT_TITLE) Client $(VERSION) x86
UpgradeCode: '$(CLIENT_UPGRADE_GUID_32)'
ManifestType: installer
ManifestVersion: 1.6.0
<<NOKEEP
move /y "$(@:"=).tmp" $@ > NUL
"bin\Setup\winget-manifests\s\SURF\$(CLIENT_TARGET)Client\$(VERSION)\SURF.$(CLIENT_TARGET)Client.locale.en-US.yaml" :
move /y << "$(@:"=).tmp" > NUL
# Created using eduVPN build system
# yaml-language-server: $$schema=https://aka.ms/winget-manifest.defaultLocale.1.6.0.schema.json
PackageIdentifier: SURF.$(CLIENT_TARGET)Client
PackageVersion: $(VERSION)
PackageLocale: en-US
Publisher: SURF
PublisherUrl: $(CLIENT_ABOUT_URI)
PackageName: $(CLIENT_TITLE) Client
License: GPL-3.0
ShortDescription: Access your institute's network or the Internet using an encrypted connection.
Tags:
- vpn
- eduvpn
ReleaseNotesUrl: https://github.com/Amebis/eduVPN/releases/tag/$(VERSION)
ManifestType: defaultLocale
ManifestVersion: 1.6.0
<<NOKEEP
move /y "$(@:"=).tmp" $@ > NUL
"bin\Setup\winget-manifests\s\SURF\$(CLIENT_TARGET)Client\$(VERSION)\SURF.$(CLIENT_TARGET)Client.yaml" :
move /y << "$(@:"=).tmp" > NUL
# Created using eduVPN build system
# yaml-language-server: $$schema=https://aka.ms/winget-manifest.version.1.6.0.schema.json
PackageIdentifier: SURF.$(CLIENT_TARGET)Client
PackageVersion: $(VERSION)
DefaultLocale: en-US
ManifestType: version
ManifestVersion: 1.6.0
<<NOKEEP
move /y "$(@:"=).tmp" $@ > NUL
!ENDIF
######################################################################
# Building
######################################################################
"bin\$(CFG)\$(CLIENT_TARGET).wixobj" : "eduVPN.wxs" "Makefile"
"$(WIX)bin\wixcop.exe" $(WIX_WIXCOP_FLAGS) "eduVPN.wxs"
"$(WIX)bin\candle.exe" $(WIX_CANDLE_FLAGS_CFG_CLIENT) -out $@ "eduVPN.wxs"
Clean ::
-if exist "bin\$(CFG)\$(CLIENT_TARGET).wixobj" del /f /q "bin\$(CFG)\$(CLIENT_TARGET).wixobj"
"bin\$(CFG)\$(CLIENT_TARGET)Client_$(VERSION)$(CFG_TARGET).exe" : \
"Install\eduVPN.wxl" \
"Install\thm.wxl" \
"Install\de\thm.wxl" \
"Install\es\thm.wxl" \
"Install\fr\thm.wxl" \
"Install\nl\thm.wxl" \
"Install\sl\thm.wxl" \
"Install\tr\thm.wxl" \
"Install\uk\thm.wxl" \
"Install\thm.xml" \
"Install\$(CLIENT_TARGET)\logo.png" \
"bin\$(CFG)\$(CLIENT_TARGET).wixobj" \
"bin\Setup\$(CLIENT_TARGET)Client_$(VERSION)$(CFG_TARGET)_x86.msi" \
"bin\Setup\$(CLIENT_TARGET)Client_$(VERSION)$(CFG_TARGET)_x64.msi" \
"bin\Setup\$(CLIENT_TARGET)Client_$(VERSION)$(CFG_TARGET)_ARM64.msi"
"$(WIX)bin\light.exe" $(WIX_LIGHT_FLAGS) -cultures:en -loc "Install\eduVPN.wxl" -out $@ "bin\$(CFG)\$(CLIENT_TARGET).wixobj"
Clean ::
-if exist "bin\$(CFG)\$(CLIENT_TARGET)Client_*.exe" del /f /q "bin\$(CFG)\$(CLIENT_TARGET)Client_*.exe"