-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
qubes-tools.wxs
368 lines (317 loc) · 12.9 KB
/
qubes-tools.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
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
<?xml version='1.0' encoding='UTF-8'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' xmlns:iis='http://schemas.microsoft.com/wix/IIsExtension'>
<?ifdef env.MSIBUILD ?>
<?define MODULE_SUFFIX = $(env.MSIOS)$(env.MSIARCH)$(env.MSIBUILD)?>
<?else?>
<?define MODULE_SUFFIX = $(env.MSIOS)$(env.MSIARCH)?>
<?endif?>
<?if $(env.DDK_ARCH) = x64 ?>
<?define PFILESDIR = ProgramFiles64Folder ?>
<?else?>
<?define PFILESDIR = ProgramFilesFolder ?>
<?endif ?>
<?if $(env.WIN_BUILD_TYPE) = chk ?>
<?define DEBUG = Debug ?>
<?else?>
<?define DEBUG = '' ?>
<?endif ?>
<Product
Id='*'
Name='Qubes Windows Tools'
UpgradeCode='{FB972F47-0D68-43EF-9820-92FDEB51DCD5}'
Language='1033'
Codepage='1252'
Version='$(env.VERSION)'
Manufacturer='Invisible Things Lab'
>
<Package
Id='*'
Description='Qubes Windows Tools'
Manufacturer='Invisible Things Lab'
InstallerVersion='405'
Languages='1033'
Compressed='yes'
SummaryCodepage='1252'
/>
<Media Id='1' Cabinet='content.cab' EmbedCab='yes'/>
<MajorUpgrade
AllowSameVersionUpgrades='no'
DowngradeErrorMessage='A later version of [ProductName] is already installed. Setup will now exit.'
/>
<!-- Skip the license dialog: it's displayed by the bundle, so no need to have it here as well. -->
<UI>
<UIRef Id='WixUI_Mondo'/>
<Publish Dialog="WelcomeDlg"
Control="Next"
Event="NewDialog"
Value="CustomizeDlg"
Order="2">1</Publish>
<Publish Dialog="CustomizeDlg"
Control="Back"
Event="NewDialog"
Value="WelcomeDlg"
Order="2">1</Publish>
</UI>
<Property Id='SYSTEMSTARTOPTIONS'>
<RegistrySearch Id='SystemStartOptions'
Root='HKLM'
Key='SYSTEM\CurrentControlSet\Control'
Name='SystemStartOptions'
Type='raw'
/>
</Property>
<Directory Id='TARGETDIR' Name='SourceDir' DiskId='1'>
<Directory Id='$(var.PFILESDIR)'>
<Directory Id='ITLProgramFilesDir' Name='Invisible Things Lab'>
<Directory Id='INSTALLDIR' Name='Qubes Tools'>
<Directory Id='LogDir' Name='log'>
<Component Id='CreateLogDir' Guid='{61BC344A-BD13-4886-8DF8-007C40B2F31C}'>
<CreateFolder/>
</Component>
</Directory>
<Component Id='QubesRegistry'>
<RegistryKey Root='HKLM' Key='Software\Invisible Things Lab\Qubes Tools'>
<RegistryValue Type='string' Name='InstallDir' Value='[INSTALLDIR]'/>
<RegistryValue Type='string' Name='LogDir' Value='[INSTALLDIR]\log'/>
<RegistryValue Type='integer' Name='LogLevel' Value='2'/>
</RegistryKey>
<RegistryKey Root='HKLM' Key='SYSTEM\CurrentControlSet\Control\Session Manager\Debug Print Filter'>
<!-- Default debug print filter masks for drivers. Mostly useful to not spam a debugger when testing. 0x3f is all predefined levels. -->
<RegistryValue Type='integer' Name='IHVDRIVER' Value='3'/>
<RegistryValue Type='integer' Name='IHVVIDEO' Value='3'/>
</RegistryKey>
<Environment Id='QubesToolsEnv' Action='set' Name='QUBES_TOOLS' Part='all' Permanent='no' System='yes' Value='[INSTALLDIR]' />
</Component>
<Merge Id='XenBus' Language='1033' SourceFile='components/xenbus-$(var.MODULE_SUFFIX).msm'>
<ConfigurationData Name='ProductFolder' Value='INSTALLDIR'/>
</Merge>
<Merge Id='XenIface' Language='1033' SourceFile='components/xeniface-$(var.MODULE_SUFFIX).msm'>
<ConfigurationData Name='ProductFolder' Value='INSTALLDIR'/>
</Merge>
<Merge Id='XenNet' Language='1033' SourceFile='components/xennet-$(var.MODULE_SUFFIX).msm'>
<ConfigurationData Name='ProductFolder' Value='INSTALLDIR'/>
</Merge>
<Merge Id='XenVbd' Language='1033' SourceFile='components/xenvbd-$(var.MODULE_SUFFIX).msm'>
<ConfigurationData Name='ProductFolder' Value='INSTALLDIR'/>
</Merge>
<Merge Id='XenVif' Language='1033' SourceFile='components/xenvif-$(var.MODULE_SUFFIX).msm'>
<ConfigurationData Name='ProductFolder' Value='INSTALLDIR'/>
</Merge>
<Merge Id='WindowsUtils' Language='1033' SourceFile='components/windows-utils-$(var.MODULE_SUFFIX).msm' />
<Merge Id='CoreVchan' Language='1033' SourceFile='components/core-vchan-xen-$(var.MODULE_SUFFIX).msm' />
<Merge Id='CoreAgent' Language='1033' SourceFile='components/core-agent-windows-$(var.MODULE_SUFFIX).msm'>
<ConfigurationData Name='ProductFolder' Value='INSTALLDIR'/>
</Merge>
<Merge Id='CoreQubesDb' Language='1033' SourceFile='components/core-qubesdb-$(var.MODULE_SUFFIX).msm'>
<ConfigurationData Name='ProductFolder' Value='INSTALLDIR'/>
</Merge>
<Merge Id='GuiAgentWindows' Language='1033' SourceFile='components/gui-agent-windows-$(var.MODULE_SUFFIX).msm'>
<ConfigurationData Name='ProductFolder' Value='INSTALLDIR'/>
</Merge>
<Merge Id='MoveProfiles' Language='1033' SourceFile='components/move-profiles-$(var.MODULE_SUFFIX).msm'>
<ConfigurationData Name='ProductFolder' Value='INSTALLDIR'/>
</Merge>
<Component Id='DisableUac'>
<RegistryKey Root='HKLM' Key='Software\Microsoft\Windows\CurrentVersion\Policies\System'>
<RegistryValue Type='integer' Name='EnableLUA' Value='0'/>
</RegistryKey>
</Component>
<Directory Id='BinDir' Name='bin'>
<Component Id='PowerSettings'>
<File Id='power_settings.bat' Source='power_settings.bat' KeyPath='yes'/>
</Component>
</Directory>
<?ifdef env.CERT_PUBLIC_FILENAME?>
<Component Id='Cert' Guid='BBCBDD9E-3170-4FAD-9608-E591E4C2BBBE'>
<File Id='xen_pvdrivers_cert' Name='xen_pvdrivers_cert' DiskId='1' Source='$(env.CERT_PUBLIC_FILENAME)' />
<iis:Certificate Id='xen_pvdrivers_cert_root' Name='xen_pvdrivers_cert' Request='no' BinaryKey='xen_pvdrivers_cert' StoreLocation='localMachine' StoreName='root' Overwrite='no' />
<iis:Certificate Id='xen_pvdrivers_cert_trustedPublisher' Name='xen_pvdrivers_cert' Request='no' BinaryKey='xen_pvdrivers_cert' StoreLocation='localMachine' StoreName='trustedPublisher' Overwrite='no' />
</Component>
<?endif ?>
</Directory>
</Directory>
</Directory>
</Directory>
<?ifdef env.CERT_PUBLIC_FILENAME?>
<Binary Id='xen_pvdrivers_cert' SourceFile='$(env.CERT_PUBLIC_FILENAME)' />
<?endif ?>
<Binary Id='Uninstaller' SourceFile='bin\$(env.DDK_ARCH)\uninstaller.exe' />
<Binary Id='advertise_tools.exe' SourceFile='advertise-tools.exe' />
<CustomAction
Id='UninstallCleanup'
Return='check'
Impersonate='no'
Execute='deferred'
BinaryKey='Uninstaller'
ExeCommand=''
/>
<Property Id="CMD">
<DirectorySearch Id="SysDir" Path="[SystemFolder]" Depth="1">
<FileSearch Id="CmdExe" Name="cmd.exe" />
</DirectorySearch>
</Property>
<CustomAction
Id='SetPowerSettings'
Return='ignore'
Impersonate='no'
Execute='deferred'
Property='CMD'
ExeCommand='/c "[BinDir]\power_settings.bat"'
/>
<!-- This is here instead of in the qrexec module because on upgrade we need to run this
before the qrexec module is processed by MSI (restart after old version uninstall happens first). -->
<!-- 0 is the argument for advertising that tools are not installed. -->
<CustomAction
Id='UnadvertiseTools'
BinaryKey='advertise_tools.exe'
Return='ignore'
Execute='immediate'
Impersonate='yes'
ExeCommand='0'
/>
<InstallExecuteSequence>
<?ifdef env.CERT_PUBLIC_FILENAME?>
<Custom Action="InstallCertificates" Before='MsiProcessDrivers' />
<?endif ?>
<!-- Require reboot after install/uninstall. -->
<ScheduleReboot Before="InstallFinalize" />
<!-- Notify dom0 that tools are uninstalled on uninstall/upgrade
(upgrade requires an intermediate reboot and the tools are not functioning yet then). -->
<Custom Action='UnadvertiseTools' Before='RemoveExistingProducts'>REMOVE="ALL" OR WIX_UPGRADE_DETECTED</Custom>
<!-- Perform custom uninstall cleanup, needed for pvdrivers because MSI can't revert system changes done by driver coinstallers (like inserting device stack filters). -->
<Custom Action="UninstallCleanup" After="InstallInitialize">REMOVE="ALL" OR WIX_UPGRADE_DETECTED</Custom>
<!-- Force reboot immediately after uninstalling previous version on upgrade,
it's normally suppressed until after the new version is installed.
Do not reboot if we're already running after reboot. -->
<ForceReboot After="UninstallCleanup">WIX_UPGRADE_DETECTED AND NOT AFTERREBOOT</ForceReboot>
<!-- Run power settings update if the feature is being installed. -->
<Custom Action='SetPowerSettings' Before='InstallFinalize'><![CDATA[&PowerSettings=3]]></Custom>
</InstallExecuteSequence>
<Feature
Id='Complete'
AllowAdvertise='no'
Absent='disallow'
Display='expand'
Title='Qubes Windows Tools'
Description='Qubes Windows Tools'
ConfigurableDirectory='INSTALLDIR'
>
<Feature
Id='Common'
AllowAdvertise='no'
Absent='disallow'
Title='Shared components'
Description='Shared libraries for Qubes Windows Tools.'
>
<ComponentRef Id='QubesRegistry'/>
<ComponentRef Id='CreateLogDir'/>
<MergeRef Id='WindowsUtils'/>
<MergeRef Id='CoreVchan'/>
</Feature>
<Feature
Id='XenPvDrivers'
AllowAdvertise='no'
Absent='allow'
Title='Xen PV Drivers'
Description='Paravirtualization drivers for Xen.'
>
<Feature
Id='XenBase'
AllowAdvertise='no'
Absent='disallow'
Title='Base Xen PV Drivers'
Description='Xen paravirtual bus and interface drivers.'
>
<MergeRef Id='XenBus'/>
<MergeRef Id='XenIface'/>
</Feature>
<!-- 1 is default, 3 is typical, 1000 is full. -->
<Feature
Id='XenDisk'
AllowAdvertise='no'
Absent='allow'
Title='Xen PV Disk Drivers'
Description='Xen paravirtual disk drivers.'
Level='1001'
>
<MergeRef Id='XenVbd'/>
</Feature>
<Feature
Id='XenNetwork'
AllowAdvertise='no'
Absent='allow'
Title='Xen PV Network Drivers'
Description='Xen paravirtual network class and device drivers.'
>
<MergeRef Id='XenVif'/>
<MergeRef Id='XenNet'/>
</Feature>
</Feature>
<Feature
Id='CoreAgent'
AllowAdvertise='no'
Absent='allow'
Title='Qubes Core Agent'
Description='Core services of Qubes Windows Tools. Contains Qubes RPC Agent and basic services like file copy, clipboard handling, etc.'
>
<MergeRef Id='CoreQubesDb'/>
<MergeRef Id='CoreAgent'/>
</Feature>
<Feature
Id='MoveProfiles'
AllowAdvertise='no'
Absent='allow'
Title='Move user profiles'
Description='Moves user profiles directory (c:\Users) to the HVM&s private disk (private.img).'>
<MergeRef Id='MoveProfiles'/>
</Feature>
<Feature
Id='GuiAgentWindows'
AllowAdvertise='no'
Absent='allow'
Title='Qubes GUI Agent'
Description='Windows Agent for seamless GUI integration. This feature requires Windows 7 and testsigning enabled.'
>
<Condition Level="0">
<!-- Windows 8+ not supported yet -->
<![CDATA[(VersionNT >= 602) OR NOT (SYSTEMSTARTOPTIONS >< "TESTSIGNING")]]>
</Condition>
<?ifdef env.CERT_PUBLIC_FILENAME?>
<ComponentRef Id='Cert'/>
<?endif ?>
<MergeRef Id='GuiAgentWindows'/>
</Feature>
<Feature
Id='GuiAgentWindowsUnavailable'
AllowAdvertise='no'
Absent='allow'
Title='(unavailable) Qubes GUI Agent'
Description='Windows Agent for seamless GUI integration. This feature requires Windows 7 and testsigning enabled.'
Level='0'
>
<Condition Level="1001">
<!-- Windows 8+ not supported yet -->
<![CDATA[(VersionNT >= 602) OR NOT (SYSTEMSTARTOPTIONS >< "TESTSIGNING")]]>
</Condition>
</Feature>
<Feature
Id='DisableUac'
AllowAdvertise='no'
Absent='allow'
Title='Disable UAC'
Description='Disable User Account Control.'
>
<ComponentRef Id='DisableUac'/>
</Feature>
<Feature
Id='PowerSettings'
AllowAdvertise='no'
Absent='allow'
Title='Update Windows power settings'
Description='Sets the active Windows power scheme to High Performance and disables automatic sleep/hibernation.'
>
<ComponentRef Id='PowerSettings'/>
</Feature>
</Feature>
</Product>
</Wix>