-
-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathmain.wxs
310 lines (280 loc) · 17.2 KB
/
main.wxs
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
304
305
306
307
308
309
310
<?xml version="1.0" encoding="utf-8" ?>
<!--
Installer uses the following icons licensed under the MIT license:
* "assets\exclamation.ico" from https://icons.getbootstrap.com/icons/exclamation-circle/
* "assets\information.ico" from https://icons.getbootstrap.com/icons/info-circle/
* "assets\new.ico" from https://icons.getbootstrap.com/icons/folder-plus/
* "assets\up.ico" from https://icons.getbootstrap.com/icons/folder-symlink/
The project logo is based on the "Fox SVG Vector" icon and the community-introduced PWA logo:
* https://www.svgrepo.com/svg/40267/fox (CC0)
* https://github.com/webmaxru/progressive-web-apps-logo (CC0)
Firefox and the Firefox logo are trademarks of the Mozilla Foundation in the U.S. and other countries.
This project is not affiliated with Mozilla Foundation in any way.
-->
<!--
Important: Generate UserChrome component group before running cargo wix!
$ heat dir userchrome -o packages/wix/userchrome.wxs -scom -srd -sreg -gg -cg UserChrome -dr UserChromeDir -var wix.UserChromeSource
-->
<?if $(sys.BUILDARCH) = x64 or $(sys.BUILDARCH) = arm64 ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?else ?>
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
<?endif ?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product
Id="*"
UpgradeCode="E1CD921B-369E-47CB-AD2E-3BCA94142512"
Name="PWAsForFirefox"
Manufacturer="filips"
Version="$(var.Version)"
Language="1033"
Codepage="1252"
>
<!-- Installer package that installs PWAsForFirefox native components -->
<Package
Id="*"
Keywords="PWAsForFirefox Installer"
Description="The native part of the PWAsForFirefox project"
Manufacturer="filips"
InstallerVersion="500"
Languages="1033"
SummaryCodepage="1252"
Compressed="yes"
/>
<!-- Handle removing old version when upgrading -->
<MajorUpgrade Schedule="afterInstallInitialize" DowngradeErrorMessage="A newer version of [ProductName] is already installed. Setup will now exit." />
<!-- Apparently needed for WiX to work -->
<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" DiskPrompt="CD-ROM #1" />
<Property Id="DiskPrompt" Value="PWAsForFirefox Installation [1]" />
<!-- Define all directories and components -->
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="$(var.PlatformProgramFilesFolder)" Name="PFiles">
<Directory Id="APPLICATIONFOLDER" Name="FirefoxPWA">
<!-- Contains the license file -->
<Component Id="License" Guid="B0F7D2BD-47D2-44DE-9F9F-AE5D5CEFE760">
<File
Id="LicenseFile"
Name="LICENSE"
Source="LICENSE"
DiskId="1"
KeyPath="yes"
/>
</Component>
<!-- Contains the native app manifest for communication with the extension -->
<Component Id="Manifest" Guid="44990C1D-C76C-4CFC-8A36-B94CFD277910">
<File
Id="ManifestFile"
Name="firefoxpwa.json"
Source="manifests/windows.json"
DiskId="1"
KeyPath="yes"
/>
<RegistryKey Root="HKMU" Key="SOFTWARE\Mozilla\NativeMessagingHosts\firefoxpwa">
<RegistryValue Type="string" Value="[#ManifestFile]" />
</RegistryKey>
</Component>
<!-- Contains the main console program -->
<Component Id="MainBinary" Guid="711E74CE-248B-48FA-B4B3-BD46B748DB46">
<File
Id="MainBinaryFile"
Name="firefoxpwa.exe"
Source="$(var.CargoTargetBinDir)\firefoxpwa.exe"
DiskId="1"
KeyPath="yes"
/>
</Component>
<!-- Contains the connector program for the extension -->
<Component Id="ConnectorBinary" Guid="1FEAF44F-C68F-46C6-93A7-AB3278FEFCBB">
<File
Id="ConnectorBinaryFile"
Name="firefoxpwa-connector.exe"
Source="$(var.CargoTargetBinDir)\firefoxpwa-connector.exe"
DiskId="1"
KeyPath="yes"
/>
</Component>
<!-- Contains all shell completions for the console program -->
<!-- Users can manually add them to their shells if they want -->
<Directory Id="CompletionsDir" Name="completions">
<Component Id="BashCompletions" Guid="5E35D355-756E-4E0F-9F99-20F4E21534B2">
<File
Id="BashCompletionsFile"
Name="firefoxpwa.bash"
Source="$(var.CargoTargetBinDir)\completions\firefoxpwa.bash"
DiskId="1"
KeyPath="yes"
/>
</Component>
<Component Id="ElvishCompletions" Guid="336E7C03-E919-47EA-A206-A8FD0D9441A9">
<File
Id="ElvishCompletionsFile"
Name="firefoxpwa.elv"
Source="$(var.CargoTargetBinDir)\completions\firefoxpwa.elv"
DiskId="1"
KeyPath="yes"
/>
</Component>
<Component Id="FishCompletions" Guid="FF7D9ACA-FDC9-44EF-8204-905EAA8B2BA0">
<File
Id="FishCompletionsFile"
Name="firefoxpwa.fish"
Source="$(var.CargoTargetBinDir)\completions\firefoxpwa.fish"
DiskId="1"
KeyPath="yes"
/>
</Component>
<Component Id="PowerShellCompletions" Guid="352140E6-2977-4AF4-AB26-8FDF771A8B2E">
<File
Id="PowerShellCompletionsFile"
Name="_firefoxpwa.ps1"
Source="$(var.CargoTargetBinDir)\completions\_firefoxpwa.ps1"
DiskId="1"
KeyPath="yes"
/>
</Component>
<Component Id="ZshCompletions" Guid="60CDAC18-2A12-48FB-89EF-E4C293081307">
<File
Id="ZshCompletionsFile"
Name="_firefoxpwa"
Source="$(var.CargoTargetBinDir)\completions\_firefoxpwa"
DiskId="1"
KeyPath="yes"
/>
</Component>
</Directory>
<!-- Directory where UserChrome modifications are stored -->
<!-- All files are added by a component group that needs to be manually generated by running heat before building the installer -->
<Directory Id="UserChromeDir" Name="userchrome" />
<!-- Adds installation directory to the PATH environment variable -->
<!-- We need two components to support both per-user and per-machine installs -->
<Component Id="PathEntryUser" Guid="20C5BA9A-0C8E-4974-9E43-7B3BBC7165EF">
<Condition>MSIINSTALLPERUSER = 1</Condition>
<CreateFolder />
<Environment
Id="PathUser"
Name="PATH"
Value="[APPLICATIONFOLDER]"
Part="last"
Action="set"
Permanent="yes"
System="no"
/>
</Component>
<Component Id="PathEntryMachine" Guid="BC3E15AF-181A-4160-9ACD-F7A39583872A">
<Condition>NOT MSIINSTALLPERUSER = 1</Condition>
<CreateFolder />
<Environment
Id="PathMachine"
Name="PATH"
Value="[APPLICATIONFOLDER]"
Part="last"
Action="set"
Permanent="yes"
System="yes"
/>
</Component>
<!-- Stores installation directory and version in known registry location so the program can read it -->
<!-- Also marks binaries as a host processes for a better integration with the taskbar -->
<Component Id="RegistryEntries" Guid="C0B6535A-9A56-411E-B8D5-F1Ee901Ec440">
<RegistryKey Root="HKMU" Key="Software\filips\FirefoxPWA">
<RegistryValue Type="string" Name="Path" Value="[APPLICATIONFOLDER]" KeyPath="yes" />
<RegistryValue Type="string" Name="Version" Value="$(var.Version)" />
</RegistryKey>
<RegistryKey Root="HKCR" Key="Applications\firefoxpwa.exe">
<RegistryValue Type="string" Name="IsHostApp" Value="" />
<RegistryValue Type="string" Name="NoOpenWith" Value="" />
</RegistryKey>
<RegistryKey Root="HKCR" Key="Applications\firefoxpwa-connector.exe">
<RegistryValue Type="string" Name="IsHostApp" Value="" />
<RegistryValue Type="string" Name="NoOpenWith" Value="" />
</RegistryKey>
</Component>
</Directory>
</Directory>
</Directory>
<!-- Everything is packed into the same feature -->
<Feature
Id="Binaries"
Level="1"
Title="PWAsForFirefox"
Description="Installs the native part of the PWAsForFirefox project"
ConfigurableDirectory="APPLICATIONFOLDER"
Display="expand"
AllowAdvertise="no"
Absent="disallow"
>
<ComponentRef Id="RegistryEntries" />
<ComponentRef Id="PathEntryUser" />
<ComponentRef Id="PathEntryMachine" />
<ComponentRef Id="License" />
<ComponentRef Id="Manifest" />
<ComponentRef Id="MainBinary" />
<ComponentRef Id="ConnectorBinary" />
<ComponentRef Id="BashCompletions" />
<ComponentRef Id="ElvishCompletions" />
<ComponentRef Id="FishCompletions" />
<ComponentRef Id="PowerShellCompletions" />
<ComponentRef Id="ZshCompletions" />
<ComponentGroupRef Id="UserChrome" />
</Feature>
<!-- Configure info that are shown on Windows ARP page -->
<Icon Id="ProductICO" SourceFile="packages\wix\assets\product.ico" />
<Property Id="ARPPRODUCTICON" Value="ProductICO" />
<Property Id="ARPHELPLINK" Value="https://pwasforfirefox.filips.si/" />
<Property Id="ARPURLINFOABOUT" Value="https://pwasforfirefox.filips.si/" />
<Property Id="ARPURLUPDATEINFO" Value="https://github.com/filips123/PWAsForFirefox/releases" />
<SetProperty Id="ARPINSTALLLOCATION" Value="[APPLICATIONFOLDER]" After="CostFinalize" />
<!-- Configure license, images and icons that are displayed in installer -->
<WixVariable Id="WixUILicenseRtf" Value="packages\wix\assets\license.rtf" />
<WixVariable Id="WixUIBannerBmp" Value="packages\wix\assets\banner.png" />
<WixVariable Id="WixUIDialogBmp" Value="packages\wix\assets\dialog.png" />
<WixVariable Id="WixUIExclamationIco" Value="packages\wix\assets\exclamation.ico" />
<WixVariable Id="WixUIInfoIco" Value="packages\wix\assets\information.ico" />
<WixVariable Id="WixUINewIco" Value="packages\wix\assets\new.ico" />
<WixVariable Id="WixUIUpIco" Value="packages\wix\assets\up.ico" />
<!-- Configure WiX to support per-user and per-machine installs -->
<WixVariable Id="WixUISupportPerUser" Value="1" />
<WixVariable Id="WixUISupportPerMachine" Value="1" />
<Property Id="WIXUI_INSTALLDIR" Value="APPLICATIONFOLDER" />
<Property Id="MSIINSTALLPERUSER" Secure="yes" />
<Property Id="ALLUSERS" Value="2" Secure="yes" />
<!-- Configure default installation folders for per-user and per-machine installs -->
<Property Id="ApplicationFolderName" Value="FirefoxPWA" />
<CustomAction Id="SetDefaultPerUserFolder" Property="WixPerUserFolder" Value="[LocalAppDataFolder]Programs\[ApplicationFolderName]\" Execute="immediate" />
<CustomAction Id="SetDefaultPerMachineFolder" Property="WixPerMachineFolder" Value="[$(var.PlatformProgramFilesFolder)][ApplicationFolderName]\" Execute="immediate" />
<CustomAction Id="SetPerUserFolder" Property="APPLICATIONFOLDER" Value="[WixPerUserFolder]" Execute="immediate" />
<CustomAction Id="SetPerMachineFolder" Property="APPLICATIONFOLDER" Value="[WixPerMachineFolder]" Execute="immediate" />
<Property Id="WixAppFolder" Value="WixPerMachineFolder" />
<!-- Configure execute and UI sequences to set the correct directory -->
<InstallExecuteSequence>
<Custom Action="SetDefaultPerUserFolder" Before="CostFinalize" />
<Custom Action="SetDefaultPerMachineFolder" After="SetDefaultPerUserFolder" />
<Custom Action="SetPerUserFolder" After="SetDefaultPerMachineFolder">ACTION="INSTALL" AND APPLICATIONFOLDER="" AND (ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged)))</Custom>
<Custom Action="SetPerMachineFolder" After="SetPerUserFolder">ACTION="INSTALL" AND APPLICATIONFOLDER="" AND (ALLUSERS=1 OR (ALLUSERS=2 AND Privileged))</Custom>
</InstallExecuteSequence>
<InstallUISequence>
<Custom Action="SetDefaultPerUserFolder" Before="CostFinalize" />
<Custom Action="SetDefaultPerMachineFolder" After="SetDefaultPerUserFolder" />
<Custom Action="SetPerUserFolder" After="SetDefaultPerMachineFolder">ACTION="INSTALL" AND APPLICATIONFOLDER="" AND (ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged)))</Custom>
<Custom Action="SetPerMachineFolder" After="SetPerUserFolder">ACTION="INSTALL" AND APPLICATIONFOLDER="" AND (ALLUSERS=1 OR (ALLUSERS=2 AND Privileged))</Custom>
</InstallUISequence>
<!-- Modify the UI to allow the user to customize installation scope and directory -->
<UI>
<UIRef Id="WixUI_InstallDir" />
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="InstallScopeDlg">LicenseAccepted = "1"</Publish>
<Publish Dialog="InstallScopeDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
<Publish Dialog="InstallScopeDlg" Control="Next" Property="WixAppFolder" Value="WixPerUserFolder" Order="1">NOT Privileged</Publish>
<Publish Dialog="InstallScopeDlg" Control="Next" Property="ALLUSERS" Value="{}" Order="2">WixAppFolder = "WixPerUserFolder"</Publish>
<Publish Dialog="InstallScopeDlg" Control="Next" Property="ALLUSERS" Value="1" Order="2">WixAppFolder = "WixPerMachineFolder"</Publish>
<Publish Dialog="InstallScopeDlg" Control="Next" Property="MSIINSTALLPERUSER" Value="1" Order="3">WixAppFolder = "WixPerUserFolder"</Publish>
<Publish Dialog="InstallScopeDlg" Control="Next" Property="MSIINSTALLPERUSER" Value="{}" Order="3">WixAppFolder = "WixPerMachineFolder"</Publish>
<Publish Dialog="InstallScopeDlg" Control="Next" Property="APPLICATIONFOLDER" Value="[WixPerUserFolder]" Order="4">WixAppFolder = "WixPerUserFolder"</Publish>
<Publish Dialog="InstallScopeDlg" Control="Next" Property="APPLICATIONFOLDER" Value="[WixPerMachineFolder]" Order="4">WixAppFolder = "WixPerMachineFolder"</Publish>
<Publish Dialog="InstallScopeDlg" Control="Next" Event="DoAction" Value="FindRelatedProducts" Order="5">1</Publish>
<Publish Dialog="InstallScopeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg" Order="6">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="InstallScopeDlg">1</Publish>
</UI>
<!-- Needed so UserChrome component group can properly determine the correct source directory -->
<WixVariable Id="UserChromeSource" Value="userchrome" />
</Product>
</Wix>