-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathpackage.wix.in
More file actions
689 lines (587 loc) · 40.2 KB
/
package.wix.in
File metadata and controls
689 lines (587 loc) · 40.2 KB
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
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Package Name="Windows Subsystem for Linux" Language="1033" InstallerVersion="500" Version="${PACKAGE_VERSION}" Manufacturer="Microsoft Corporation" UpgradeCode="6D5B792B-1EDC-4DE9-8EAD-201B820F8E82" Scope="perMachine" Compressed="${COMPRESS_PACKAGE}">
<MajorUpgrade AllowDowngrades="yes" Disallow="no" />
<MediaTemplate EmbedCab="yes" />
<StandardDirectory Id="ProgramFiles64Folder">
<Directory Id="INSTALLDIR" Name="WSL">
<Directory Id="TOOLSFOLDER" Name="tools" />
<Directory Id="LIBFOLDER" Name="lib" />
<?if "${WSL_BUILD_WSL_SETTINGS}" = "true" ?>
<Directory Id="WSLSETTINGS" Name="wslsettings"/>
<?endif?>
</Directory>
</StandardDirectory>
<Icon Id="wsl.ico" SourceFile="${CMAKE_SOURCE_DIR}/images/wsl.ico"/>
<Property Id="ARPPRODUCTICON" Value="wsl.ico"/>
<DirectoryRef Id="INSTALLDIR">
<Component Id="wsl" Guid="F0C8D6BA-1502-41E7-BF72-D93DFA134730" UninstallWhenSuperseded="yes" DisableRegistryReflection="yes" Bitness="always64">
<RemoveFile Id="CleanUpWSLShortCut" Directory="ProgramMenuFolder" Name="WSL" On="uninstall"/>
<File Id="wsl.exe" Name="wsl.exe" Source="${PACKAGE_INPUT_DIR}/wsl.exe" KeyPath="yes">
<Shortcut Id="WSLShortcut" Name="WSL" Description="Windows Subsystem for Linux" Arguments="--cd ~" Advertise="yes" Directory="ProgramMenuFolder" Icon="wsl.ico">
<ShortcutProperty Key="System.AppUserModel.ID" Value="Microsoft.WSL"/>
<ShortcutProperty Key="System.AppUserModel.ToastActivatorCLSID" Value="{2B9C59C3-98F1-45C8-B87B-12AE3C7927E8}"/>
</Shortcut>
</File>
<File Id="wslg.exe" Name="wslg.exe" Source="${PACKAGE_INPUT_DIR}/wslg.exe" />
<File Id="wslc.exe" Name="wslc.exe" Source="${PACKAGE_INPUT_DIR}/wslc.exe" />
<File Id="wslc" Name="wslc" Source="${CMAKE_SOURCE_DIR}/src/windows/wslc/wslc" />
<File Id="wslhost.exe" Name="wslhost.exe" Source="${PACKAGE_INPUT_DIR}/wslhost.exe" />
<File Id="wslrelay.exe" Name="wslrelay.exe" Source="${PACKAGE_INPUT_DIR}/wslrelay.exe" />
<File Id="wslserviceproxystub.dll" Name="wslserviceproxystub.dll" Source="${PACKAGE_INPUT_DIR}/wslserviceproxystub.dll" />
<File Id="wsldeps.dll" Name="wsldeps.dll" Source="${PACKAGE_INPUT_DIR}/wsldeps.dll" />
<?if "${WSL_BUILD_WSL_SETTINGS}" = "true" ?>
<File Id="libwsl.dll" Name="libwsl.dll" Source="${PACKAGE_INPUT_DIR}/libwsl.dll" />
<?endif?>
<?if "${WSL_DEV_BINARY_PATH}" = "" ?>
<File Id="system.vhd" Source="${WSLG_SOURCE_DIR}/${TARGET_PLATFORM}/system.vhd"/>
<?endif?>
<!-- Add INSTALLDIR to system PATH to make wslc.exe and other CLI tools accessible. -->
<!-- NOTE:
- Permanent="no" ensures this PATH entry is removed when the MSI is uninstalled.
- If INSTALLDIR is manually moved or deleted after installation (outside of MSI),
the PATH entry will become stale until uninstall or manual correction.
- This behavior is intentional and currently implemented as a convenience until
we can deploy these CLI tools (e.g. wslc.exe) to a stable system location
such as System32, or offer an installer option to skip PATH modification. -->
<Environment Id="PATH" Name="PATH" Value="[INSTALLDIR]" Permanent="no" Part="last" Action="set" System="yes" />
<!-- Installation folder -->
<RegistryKey Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss\MSI">
<RegistryValue Name="InstallLocation" Value="[INSTALLDIR]" Type="string" />
<RegistryValue Name="ProductCode" Value="[ProductCode]" Type="string" />
<RegistryValue Name="Version" Value="${PACKAGE_VERSION}" Type="string" />
</RegistryKey>
<!-- DCAT registration -->
<RegistryKey Root="HKLM" Key="${DCAT_REGISTRATION_KEY}">
<RegistryValue Name="Version" Value="${PACKAGE_VERSION}" Type="string" />
</RegistryKey>
</Component>
<Component Id="explorerplan9shortcut" Guid="{93CBFF23-A04C-4344-A332-238CE5B97AED}" UninstallWhenSuperseded="yes" DisableRegistryReflection="yes" Bitness="always64">
<!-- Explorer extensions -->
<RegistryKey Root="HKLM" Key="SOFTWARE\Classes\CLSID\{B2B4A4D1-2754-4140-A2EB-9A76D9D7CDC6}">
<RegistryValue Value="Linux" Type="string"/>
<RegistryValue Name="SortOrderIndex" Value="119" Type="integer"/>
<!--0x77-->
<RegistryValue Name="System.IsPinnedToNameSpaceTree" Value="1" Type="integer"/>
<RegistryKey Key="DefaultIcon">
<RegistryValue Value="[System64Folder]wsl.exe,-1" Type="string"/>
</RegistryKey>
<RegistryKey Key="InProcServer32">
<RegistryValue Value="[System64Folder]windows.storage.dll" Type="string"/>
</RegistryKey>
<RegistryKey Key="ShellFolder">
<RegistryValue Name="Attributes" Value="2692743245" Type="integer"/>
<!--0xa080004d"-->
<RegistryValue Name="FolderValueFlags" Value="40" Type="integer"/>
<!--0x28-->
</RegistryKey>
<RegistryKey Key="Instance">
<RegistryValue Name="CLSID" Value="{4FE04BFD-85B9-49DD-B914-F4C9556B9DA6}" Type="string"/>
<RegistryKey Key="InitPropertyBag">
<RegistryValue Name="DisplayType" Value="2" Type="integer"/>
<RegistryValue Name="EnumObjectsTelemetryValue" Value="WSL" Type="string"/>
<RegistryValue Name="Provider" Value="Plan 9 Network Provider" Type="string"/>
<RegistryValue Name="ResName" Value="\\wsl.localhost" Type="string"/>
</RegistryKey>
</RegistryKey>
</RegistryKey>
<RegistryKey Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel">
<RegistryValue Name="{B2B4A4D1-2754-4140-A2EB-9A76D9D7CDC6}" Value="1" Type="integer"/>
</RegistryKey>
<RegistryKey Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{B2B4A4D1-2754-4140-A2EB-9A76D9D7CDC6}">
<RegistryValue Value="Linux" Type="string"/>
</RegistryKey>
<RegistryKey Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\IdListAliasTranslations\WSL">
<RegistryValue Name="Target" Value="::{B2B4A4D1-2754-4140-A2EB-9A76D9D7CDC6}" Type="string"/>
<RegistryValue Name="Source" Value="\\wsl.localhost" Type="string"/>
</RegistryKey>
<RegistryKey Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\IdListAliasTranslations\WSLLegacy">
<RegistryValue Name="Target" Value="::{B2B4A4D1-2754-4140-A2EB-9A76D9D7CDC6}" Type="string"/>
<RegistryValue Name="Source" Value="\\wsl$" Type="string"/>
</RegistryKey>
</Component>
<Component Id="explorershell" Guid="{93CBFF23-A04C-4344-A332-238CE5B97AEC}" UninstallWhenSuperseded="yes" DisableRegistryReflection="yes" Bitness="always64">
<?foreach PATH in SOFTWARE\Classes\Directory\shell\WSL;SOFTWARE\Classes\Directory\Background\shell\WSL;SOFTWARE\Classes\Drive\shell\WSL?>
<RegistryKey Root="HKLM" Key="$(var.PATH)">
<RegistryValue Value="@wsl.exe,-2" Type="string"/>
<RegistryValue Name="Extended" Value="" Type="string"/>
<RegistryValue Name="NoWorkingDirectory" Value="" Type="string"/>
<RegistryKey Key="command">
<RegistryValue Value='wsl.exe --cd "%V"' Type="string"/>
</RegistryKey>
</RegistryKey>
<?endforeach?>
<ProgId Id="WSLDistributionTar" Description="WSL tar distribution" Icon="wsl.exe">
<Extension Id="wsl">
<Verb Id="open" Command="open" TargetFile="wsl.exe" Argument="--install --prompt-before-exit --from-file "%1"" />
</Extension>
</ProgId>
</Component>
<Component Id="wslservice" Guid="F0C8D6BA-1502-41E7-BF72-D93DFA134735" UninstallWhenSuperseded="yes" DisableRegistryReflection="yes" Bitness="always64">
<!-- WslServiceProxyStub -->
<RegistryKey Root="HKCR" Key="Interface\{38541BDC-F54F-4CEB-85D0-37F0F3D2617E}">
<RegistryValue Value="ILxssUserSession" Type="string" />
<RegistryKey Key="ProxyStubClsid32">
<RegistryValue Value="{4EA0C6DD-E9FF-48E7-994E-13A31D10DC60}" Type="string" />
</RegistryKey>
</RegistryKey>
<!-- WSLServiceProxyStub. -->
<RegistryKey Root="HKCR" Key="CLSID\{4EA0C6DD-E9FF-48E7-994E-13A31D10DC60}">
<RegistryValue Value="PSFactoryBuffer" Type="string" />
<RegistryKey Key="InProcServer32">
<RegistryValue Value="[INSTALLDIR]wslserviceproxystub.dll" Type="string" />
<RegistryValue Name="ThreadingModel" Value="Both" Type="string" />
</RegistryKey>
</RegistryKey>
<!-- ILxssUserSession -->
<RegistryKey Root="HKCR" Key="AppID\{370121D2-AA7E-4608-A86D-0BBAB9DA1A60}">
<!-- O:BAG:BAD:(A;;CCDCSW;;;AU)(A;;CCDCSW;;;PS)(A;;CCDCSW;;;SY) -->
<RegistryValue Name="AccessPermission" Value="${DCOM_PERMISSION}" Type="binary" />
<RegistryValue Name="LaunchPermission" Value="${DCOM_PERMISSION}" Type="binary" />
<RegistryValue Name="LocalService" Value="WSLService" Type="string" />
</RegistryKey>
<!-- WslSupport + LxssUserSession -->
<RegistryKey Root="HKCR" Key="CLSID\{a9b7a1b9-0671-405c-95f1-e0612cb4ce7e}">
<RegistryValue Name="AppId" Value="{370121D2-AA7E-4608-A86D-0BBAB9DA1A60}" Type="string" />
<RegistryValue Value="LxssUserSession" Type="string" />
</RegistryKey>
<!-- Notification server -->
<RegistryKey Root="HKCR" Key="CLSID\{2B9C59C3-98F1-45C8-B87B-12AE3C7927E8}\LocalServer32">
<RegistryValue Value='"[INSTALLDIR]wslhost.exe"' Type="string" />
</RegistryKey>
<!-- wsldevicehost.dll -->
<RegistryKey Root="HKCR" Key="AppID\{17696EAC-9568-4CF5-BB8C-82515AAD6C09}">
<RegistryValue Name="DllSurrogate" Value="" Type="string" />
<RegistryValue Name="AppIDFlags" Value="2048" Type="integer" />
<!-- O:BAG:BAD:(A;;CCDCSW;;;AU)(A;;CCDCSW;;;PS)(A;;CCDCSW;;;SY) -->
<RegistryValue Name="AccessPermission" Value="${DCOM_PERMISSION}" Type="binary" />
<RegistryValue Name="LaunchPermission" Value="${DCOM_PERMISSION}" Type="binary" />
</RegistryKey>
<!-- WslDeviceHost_VirtioPmem -->
<RegistryKey Root="HKCR" Key="CLSID\{ABB755FC-1B86-4255-83E2-E5787ABCF6C2}">
<RegistryValue Value="WslDeviceHost_VirtioPmem" Type="string" />
<RegistryValue Name="AppId" Value="{17696EAC-9568-4CF5-BB8C-82515AAD6C09}" Type="string"/>
<RegistryKey Key="InProcServer32">
<RegistryValue Value="[INSTALLDIR]wsldevicehost.dll" Type="string" />
<RegistryValue Name="ThreadingModel" Value="Both" Type="string" />
</RegistryKey>
</RegistryKey>
<!-- WslDeviceHost_VirtioFs (admin) -->
<RegistryKey Root="HKCR" Key="CLSID\{7e6ad219-d1b3-42d5-b8ee-d96324e64ff6}">
<RegistryValue Value="WslDeviceHost_VirtioFs_Admin" Type="string"/>
<RegistryValue Name="AppId" Value="{17696EAC-9568-4CF5-BB8C-82515AAD6C09}" Type="string"/>
<RegistryKey Key="InProcServer32">
<RegistryValue Value="[INSTALLDIR]wsldevicehost.dll" Type="string"/>
<RegistryValue Name="ThreadingModel" Value="Both" Type="string"/>
</RegistryKey>
</RegistryKey>
<!-- WslDeviceHost_VirtioFs -->
<RegistryKey Root="HKCR" Key="CLSID\{60285AE6-AAF3-4456-B444-A6C2D0DEDA38}">
<RegistryValue Value="WslDeviceHost_VirtioFs" Type="string" />
<RegistryValue Name="AppId" Value="{17696EAC-9568-4CF5-BB8C-82515AAD6C09}" Type="string" />
<RegistryKey Key="InProcServer32">
<RegistryValue Value="[INSTALLDIR]wsldevicehost.dll" Type="string" />
<RegistryValue Name="ThreadingModel" Value="Both" Type="string" />
</RegistryKey>
</RegistryKey>
<!-- WslDeviceHost_VirtioNet -->
<RegistryKey Root="HKCR" Key="CLSID\{16479D2E-F0C3-4DBA-BF7A-04FFF0892B07}">
<RegistryValue Value="WslDeviceHost_Net" Type="string" />
<RegistryValue Name="AppId" Value="{17696EAC-9568-4CF5-BB8C-82515AAD6C09}" Type="string" />
<RegistryKey Key="InProcServer32">
<RegistryValue Value="[INSTALLDIR]wsldevicehost.dll" Type="string" />
<RegistryValue Name="ThreadingModel" Value="Both" Type="string" />
</RegistryKey>
</RegistryKey>
<!-- Session 0 service -->
<File Id="wslservice.exe" Source="${PACKAGE_INPUT_DIR}/wslservice.exe" KeyPath="yes" />
<ServiceInstall Name="WSLService" DisplayName="WSL Service" Description="WSL Service" Start="auto" Type="ownProcess" ErrorControl="normal" Account="LocalSystem" Vital="yes" Interactive="no" />
<!-- The service is stopped on uninstall and upgrade.
N.B. It shouldn't be started on install because it will fail to start if the OC is missing,
which would fail the install. -->
<ServiceControl Id="StopService" Stop="both" Remove="uninstall" Name="WSLService" Wait="yes" />
<File Id="wsldevicehost.dll" Source="${WSL_DEVICE_HOST_SOURCE_DIR}/bin/${TARGET_PLATFORM}/wsldevicehost.dll" />
<!-- WSLC COM app - activated through WSLService -->
<RegistryKey Root="HKCR" Key="AppID\{E9B79997-57E3-4201-AECC-6A464E530DD2}">
<!-- O:BAG:BAD:(A;;CCDCSW;;;AU)(A;;CCDCSW;;;PS)(A;;CCDCSW;;;SY) -->
<RegistryValue Name="AccessPermission" Value="${DCOM_PERMISSION}" Type="binary" />
<RegistryValue Name="LaunchPermission" Value="${DCOM_PERMISSION}" Type="binary" />
<RegistryValue Name="LocalService" Value="WSLService" Type="string" />
</RegistryKey>
<!-- WSLCContainer -->
<RegistryKey Root="HKCR" Key="CLSID\{B1F1C4E3-C225-4CAE-AD8A-34C004DE1AE4}">
<RegistryValue Name="AppId" Value="{E9B79997-57E3-4201-AECC-6A464E530DD2}" Type="string" />
<RegistryValue Value="WSLCContainer" Type="string" />
</RegistryKey>
<!-- WSLCProcess -->
<RegistryKey Root="HKCR" Key="CLSID\{AFBEA6D6-D8A4-4F81-8FED-F947EB74B33B}">
<RegistryValue Name="AppId" Value="{E9B79997-57E3-4201-AECC-6A464E530DD2}" Type="string" />
<RegistryValue Value="WSLCProcess" Type="string" />
</RegistryKey>
<!-- WSLCSessionManager -->
<RegistryKey Root="HKCR" Key="CLSID\{a9b7a1b9-0671-405c-95f1-e0612cb4ce8f}">
<RegistryValue Name="AppId" Value="{E9B79997-57E3-4201-AECC-6A464E530DD2}" Type="string" />
<RegistryValue Value="WSLCSessionManager" Type="string" />
</RegistryKey>
<!-- WSLCSessionFactory - COM server in per-user process -->
<RegistryKey Root="HKCR" Key="AppID\{1FAB86C3-F4DF-4271-8E63-6F071C4F708A}">
<!-- O:BAG:BAD:(A;;CCDCSW;;;AU)(A;;CCDCSW;;;PS)(A;;CCDCSW;;;SY) -->
<RegistryValue Name="AccessPermission" Value="${DCOM_PERMISSION}" Type="binary" />
<RegistryValue Name="LaunchPermission" Value="${DCOM_PERMISSION}" Type="binary" />
</RegistryKey>
<RegistryKey Root="HKCR" Key="CLSID\{9FCD2067-9FC6-4EFA-9EB0-698169EBF7D3}">
<RegistryValue Name="AppId" Value="{1FAB86C3-F4DF-4271-8E63-6F071C4F708A}" Type="string" />
<RegistryValue Value="WSLCSessionFactory" Type="string" />
<RegistryKey Key="LocalServer32">
<RegistryValue Value='"[INSTALLDIR]wslcsession.exe"' Type="string" />
</RegistryKey>
</RegistryKey>
<!-- IWSLCSessionManager-->
<RegistryKey Root="HKCR" Key="Interface\{82A7ABC8-6B50-43FC-AB96-15FBBE7E8760}">
<RegistryValue Value="IWSLCSessionManager" Type="string" />
<RegistryKey Key="ProxyStubClsid32">
<RegistryValue Value="{4EA0C6DD-E9FF-48E7-994E-13A31D10DC60}" Type="string" />
</RegistryKey>
</RegistryKey>
<!-- IWSLCContainer-->
<RegistryKey Root="HKCR" Key="Interface\{7577FE8D-DE85-471E-B870-11669986F332}">
<RegistryValue Value="IWSLCContainer" Type="string" />
<RegistryKey Key="ProxyStubClsid32">
<RegistryValue Value="{4EA0C6DD-E9FF-48E7-994E-13A31D10DC60}" Type="string" />
</RegistryKey>
</RegistryKey>
<!-- IWSLCProcess-->
<RegistryKey Root="HKCR" Key="Interface\{1AD163CD-393D-4B33-83A2-8A3F3F23E608}">
<RegistryValue Value="IWSLCProcess" Type="string" />
<RegistryKey Key="ProxyStubClsid32">
<RegistryValue Value="{4EA0C6DD-E9FF-48E7-994E-13A31D10DC60}" Type="string" />
</RegistryKey>
</RegistryKey>
<!-- ITerminationCallback-->
<RegistryKey Root="HKCR" Key="Interface\{7BC4E198-6531-4FA6-ADE2-5EF3D2A04DFE}">
<RegistryValue Value="ITerminationCallback" Type="string" />
<RegistryKey Key="ProxyStubClsid32">
<RegistryValue Value="{4EA0C6DD-E9FF-48E7-994E-13A31D10DC60}" Type="string" />
</RegistryKey>
</RegistryKey>
<!-- IProgressCallback-->
<RegistryKey Root="HKCR" Key="Interface\{5038842F-53DB-4F30-A6D0-A41B02C94AC1}">
<RegistryValue Value="IProgressCallback" Type="string" />
<RegistryKey Key="ProxyStubClsid32">
<RegistryValue Value="{4EA0C6DD-E9FF-48E7-994E-13A31D10DC60}" Type="string" />
</RegistryKey>
</RegistryKey>
<!-- IWSLCSession-->
<RegistryKey Root="HKCR" Key="Interface\{EF0661E4-6364-40EA-B433-E2FDF11F3519}">
<RegistryValue Value="IWSLCSession" Type="string" />
<RegistryKey Key="ProxyStubClsid32">
<RegistryValue Value="{4EA0C6DD-E9FF-48E7-994E-13A31D10DC60}" Type="string" />
</RegistryKey>
</RegistryKey>
<!-- IWSLCSessionReference-->
<RegistryKey Root="HKCR" Key="Interface\{B3A72F48-9D15-4E8A-A621-7C3E84F09B52}">
<RegistryValue Value="IWSLCSessionReference" Type="string" />
<RegistryKey Key="ProxyStubClsid32">
<RegistryValue Value="{4EA0C6DD-E9FF-48E7-994E-13A31D10DC60}" Type="string" />
</RegistryKey>
</RegistryKey>
<!-- IWSLCSessionFactory-->
<RegistryKey Root="HKCR" Key="Interface\{C4E8F291-3B5D-4A7C-9E12-8F6A4D2B7C91}">
<RegistryValue Value="IWSLCSessionFactory" Type="string" />
<RegistryKey Key="ProxyStubClsid32">
<RegistryValue Value="{4EA0C6DD-E9FF-48E7-994E-13A31D10DC60}" Type="string" />
</RegistryKey>
</RegistryKey>
<!-- IWSLCVirtualMachine-->
<RegistryKey Root="HKCR" Key="Interface\{B5E2D8F1-9A3C-4E6B-8D1F-7C4A2E9B6D3A}">
<RegistryValue Value="IWSLCVirtualMachine" Type="string" />
<RegistryKey Key="ProxyStubClsid32">
<RegistryValue Value="{4EA0C6DD-E9FF-48E7-994E-13A31D10DC60}" Type="string" />
</RegistryKey>
</RegistryKey>
<File Id="wslcsession.exe" Source="${BIN}/wslcsession.exe" />
</Component>
<Component Id="wslg" Guid="F0C8D6BA-1502-41E7-BF72-D93DFA134731" UninstallWhenSuperseded="yes" DisableRegistryReflection="yes" Bitness="always64">
<?if "${WSL_DEV_BINARY_PATH}" = "" ?>
<File Id="msrdc.exe" Source="${MSRDC_SOURCE_DIR}/${TARGET_PLATFORM}/msrdc.exe" />
<File Id="wslg.rdp" Source="${WSLG_SOURCE_DIR}/wslg.rdp" />
<File Id="wslg_desktop.rdp" Source="${WSLG_SOURCE_DIR}/wslg_desktop.rdp" />
<File Id="rdclientax.dll" Source="${MSRDC_SOURCE_DIR}/${TARGET_PLATFORM}/rdclientax.dll" />
<File Id="rdpnanoTransport.dll" Source="${MSRDC_SOURCE_DIR}/${TARGET_PLATFORM}/rdpnanoTransport.dll" />
<File Id="RdpWinStlHelper.dll" Source="${MSRDC_SOURCE_DIR}/${TARGET_PLATFORM}/RdpWinStlHelper.dll" />
<?endif?>
<File Id="${WSLG_TS_PLUGIN_DLL}" Source="${PACKAGE_INPUT_DIR}/${WSLG_TS_PLUGIN_DLL}" />
<!-- MSRDC Plugin registration -->
<RegistryKey Root="HKLM" Key="SOFTWARE\Microsoft\Terminal Server Client\Default\OptionalAddIns\WSLDVC_PACKAGE">
<RegistryValue Name="Name" Value="[INSTALLDIR]WSLDVCPlugin.dll" Type="string" />
</RegistryKey>
</Component>
<?if "${WSL_DEV_BINARY_PATH}" = "" ?>
<Component Id="msal" Guid="F0C8D6BA-1502-41E7-BF72-D93DFA134734" UninstallWhenSuperseded="yes" DisableRegistryReflection="yes" Bitness="always64">
<File Id="msal.wsl.proxy.exe" Source="${MSAL_SOURCE_DIR}/${TARGET_PLATFORM}/msal.wsl.proxy.exe" />
</Component>
<?endif?>
</DirectoryRef>
<?if "${WSL_DEV_BINARY_PATH}" = "" ?>
<DirectoryRef Id="LIBFOLDER">
<Component Id="directx" Guid="F0C8D6BA-1502-41E7-BF72-D93DFA134732" Bitness="always64" UninstallWhenSuperseded="yes">
<File Id="libd3d12.so" Source="${DIRECT3D_SOURCE_DIR}/lib/${TARGET_PLATFORM}/libd3d12.so" />
<File Id="libd3d12core.so" Source="${DIRECT3D_SOURCE_DIR}/lib/${TARGET_PLATFORM}/libd3d12core.so" />
<File Id="libdxcore.so" Source="${DXCORE_SOURCE_DIR}/lib/libdxcore.so" />
</Component>
</DirectoryRef>
<?endif?>
<DirectoryRef Id="TOOLSFOLDER">
<Component Id="tools" Guid="F0C8D6BA-1502-41E7-BF72-D93DFA134733" Bitness="always64" UninstallWhenSuperseded="yes">
<File Id="init" Source="${BIN}/init" Checksum="yes" />
<File Id="initrd.img" Source="${BIN}/initrd.img" Checksum="yes" />
<File Id="bsdtar" Source="${BSDTARD_SOURCE_DIR}/${TARGET_PLATFORM}/bsdtar"/>
<?if "${WSL_DEV_BINARY_PATH}" = "" ?>
<File Id="kernel" Source="${KERNEL_SOURCE_DIR}/bin/${TARGET_PLATFORM}/kernel"/>
<File Id="modules.vhd" Source="${KERNEL_SOURCE_DIR}/bin/${TARGET_PLATFORM}/modules.vhd"/>
<?endif?>
</Component>
</DirectoryRef>
<?if "${WSL_DEV_BINARY_PATH}" = "" ?>
<ComponentGroup Id="msrdc_localization" Directory="INSTALLDIR" Source="${MSRDC_SOURCE_DIR}/${TARGET_PLATFORM}">
<Component Id="msrdc_mui" Guid="EDBB5FC5-058D-45D7-BB03-FB1337B3B577" Bitness="always64" UninstallWhenSuperseded="yes" />
<Files Include="**.mui" />
</ComponentGroup>
<?endif?>
<?if "${WSL_BUILD_WSL_SETTINGS}" = "true" ?>
<ComponentGroup Id="wslsettings" Directory="WSLSETTINGS" Source="${BIN}/wslsettings">
<Component Id="wslsettingsnonserver" Guid="AB166073-8855-492B-95C8-C6E5939B66A5" Bitness="always64" DisableRegistryReflection="yes" UninstallWhenSuperseded="yes" Condition="MsiNTProductType = 1">
<RemoveFile Id="CleanUpWSLSettingsShortCutNonServer" Directory="ProgramMenuFolder" Name="WSLSettings" On="uninstall"/>
<File Id="wslsettings.exe_nonserver" Source="${PACKAGE_INPUT_DIR}/wslsettings/wslsettings.exe" KeyPath="yes" ShortName="kyk8fs6a.exe">
<Shortcut Id="WSLSettingsShortcutNonServer" Name="WSL Settings" Description="Windows Subsystem for Linux Settings" Advertise="yes" Directory="ProgramMenuFolder" Icon="wsl.ico">
<ShortcutProperty Key="System.AppUserModel.IsSystemComponent" Value="true"/>
</Shortcut>
</File>
<!-- Protocol registration -->
<RegistryKey Root="HKLM" Key="Software">
<RegistryKey Key="Classes">
<RegistryKey Key="wsl-settings">
<RegistryValue Value="URL:wsl-settings" Type="string" />
<RegistryValue Name="URL Protocol" Value="" Type="string" />
</RegistryKey>
<RegistryKey Key="[WSLSETTINGSPROGID]">
<RegistryKey Key="Application">
<RegistryValue Name="ApplicationName" Value="WSL Settings" Type="string" />
</RegistryKey>
<RegistryKey Key="shell\open\command">
<RegistryValue Value='"[WSLSETTINGS]wslsettings.exe" "----ms-protocol:%1"' Type="string" />
</RegistryKey>
</RegistryKey>
</RegistryKey>
<RegistryKey Key="Microsoft\WindowsAppRuntimeApplications\[WSLSETTINGSAPPID]\Capabilities\UrlAssociations">
<RegistryValue Name="wsl-settings" Value="[WSLSETTINGSPROGID]" Type="string" />
</RegistryKey>
<RegistryKey Key="RegisteredApplications">
<RegistryValue Name="[WSLSETTINGSAPPID]" Value="Software\Microsoft\WindowsAppRuntimeApplications\[WSLSETTINGSAPPID]\Capabilities" Type="string" />
</RegistryKey>
</RegistryKey>
</Component>
<Component Id="wslsettingsserver" Guid="EE2D69A0-4F55-4EC5-9576-4FAD70BC798E" Bitness="always64" DisableRegistryReflection="yes" UninstallWhenSuperseded="yes" Condition="MsiNTProductType > 1">
<RemoveFile Id="CleanUpWSLSettingsShortCutServer" Directory="ProgramMenuFolder" Name="WSLSettings" On="uninstall"/>
<File Id="wslsettings.exe_server" Source="${PACKAGE_INPUT_DIR}/wslsettings/wslsettings.exe" KeyPath="yes" ShortName="kyk8fs6b.exe">
<Shortcut Id="WSLSettingsShortcutServer" Name="WSL Settings" Description="Windows Subsystem for Linux Settings" Advertise="yes" Directory="ProgramMenuFolder" Icon="wsl.ico"/>
</File>
<!-- Protocol registration -->
<RegistryKey Root="HKLM" Key="Software">
<RegistryKey Key="Classes">
<RegistryKey Key="wsl-settings">
<RegistryValue Value="URL:wsl-settings" Type="string" />
<RegistryValue Name="URL Protocol" Value="" Type="string" />
</RegistryKey>
<RegistryKey Key="[WSLSETTINGSPROGID]">
<RegistryKey Key="Application">
<RegistryValue Name="ApplicationName" Value="WSL Settings" Type="string" />
</RegistryKey>
<RegistryKey Key="shell\open\command">
<RegistryValue Value='"[WSLSETTINGS]wslsettings.exe" "----ms-protocol:%1"' Type="string" />
</RegistryKey>
</RegistryKey>
</RegistryKey>
<RegistryKey Key="Microsoft\WindowsAppRuntimeApplications\[WSLSETTINGSAPPID]\Capabilities\UrlAssociations">
<RegistryValue Name="wsl-settings" Value="[WSLSETTINGSPROGID]" Type="string" />
</RegistryKey>
<RegistryKey Key="RegisteredApplications">
<RegistryValue Name="[WSLSETTINGSAPPID]" Value="Software\Microsoft\WindowsAppRuntimeApplications\[WSLSETTINGSAPPID]\Capabilities" Type="string" />
</RegistryKey>
</RegistryKey>
</Component>
<File Id="wslsettings.dll" Source="${PACKAGE_INPUT_DIR}/wslsettings/wslsettings.dll"/>
<Files Include="*.dll">
<Exclude Files="wslsettings.dll" />
</Files>
<Files Include="*.exe">
<Exclude Files="wslsettings.exe" />
</Files>
<Files Include="**/*.gif"/>
<Files Include="**/*.ico"/>
<Files Include="**/*.mui"/>
<Files Include="**/*.png"/>
<Files Include="*.json"/>
<Files Include="*.pri"/>
<Files Include="*.winmd"/>
<Files Include="**/*.xbf"/>
</ComponentGroup>
<?endif?>
<Feature Id="WSL" Title="Windows Subsystem for Linux" Level="1">
<ComponentRef Id="wsl" />
<ComponentRef Id="wslservice" />
<ComponentRef Id="wslg" />
<ComponentRef Id="tools" />
<ComponentRef Id="explorershell" />
<ComponentRef Id="explorerplan9shortcut" />
<?if "${WSL_DEV_BINARY_PATH}" = "" ?>
<ComponentRef Id="msal" />
<ComponentGroupRef Id="msrdc_localization" />
<ComponentRef Id="directx" />
<?endif?>
<?if "${WSL_BUILD_WSL_SETTINGS}" = "true" ?>
<ComponentGroupRef Id="wslsettings" />
<?endif?>
</Feature>
<Binary Id="wslinstall.dll" SourceFile="${PACKAGE_INPUT_DIR}/wslinstall.dll" />
<Binary Id="msixpackage" SourceFile="${PACKAGE_INPUT_DIR}/gluepackage.msix"/>
<CustomAction Id="ValidateInstall"
Impersonate="no"
BinaryRef="wslinstall.dll"
DllEntry="WslValidateInstallation"
Return="check"
Execute="deferred"
/>
<CustomAction Id="FinalizeInstall"
Impersonate="no"
BinaryRef="wslinstall.dll"
DllEntry="WslFinalizeInstallation"
Return="check"
Execute="deferred"
/>
<CustomAction Id="DeprovisionMsix"
Impersonate="no"
BinaryRef="wslinstall.dll"
DllEntry="DeprovisionMsix"
Return="check"
Execute="deferred"
/>
<CustomAction Id="RemoveMsixAsSystem"
Impersonate="no"
BinaryRef="wslinstall.dll"
DllEntry="RemoveMsixAsSystem"
Return="check"
Execute="deferred"
/>
<CustomAction Id="RemoveMsixAsUser"
Impersonate="yes"
BinaryRef="wslinstall.dll"
DllEntry="RemoveMsixAsUser"
Return="check"
Execute="deferred"
/>
<CustomAction Id="InstallMsix"
Impersonate="no"
BinaryRef="wslinstall.dll"
DllEntry="InstallMsix"
Return="check"
Execute="deferred"
/>
<CustomAction Id="InstallMsixAsUser"
Impersonate="yes"
BinaryRef="wslinstall.dll"
DllEntry="InstallMsixAsUser"
Return="check"
Execute="deferred"
/>
<CustomAction Id="CleanExplorerState"
Impersonate="no"
BinaryRef="wslinstall.dll"
DllEntry="CleanExplorerState"
Return="check"
Execute="deferred"
/>
<CustomAction Id="CleanMsixState"
Impersonate="no"
BinaryRef="wslinstall.dll"
DllEntry="CleanMsixState"
Return="check"
Execute="deferred"
/>
<CustomAction Id="RegisterLspCategories"
Impersonate="no"
BinaryRef="wslinstall.dll"
DllEntry="RegisterLspCategories"
Return="check"
Execute="deferred"
/>
<CustomAction Id="RemoveRegistryKeyProtections"
Impersonate="no"
BinaryRef="wslinstall.dll"
DllEntry="RemoveRegistryKeyProtections"
Return="check"
Execute="deferred"
/>
<CustomAction Id="UnregisterLspCategories"
Impersonate="no"
BinaryRef="wslinstall.dll"
DllEntry="UnregisterLspCategories"
Return="check"
Execute="deferred"
/>
<CustomAction Id="InstallMsix.SetProperty" Return="check" Property="InstallMsix" Value='[DATABASE]' Execute='immediate' />
<CustomAction Id="CalculateWslSettingsProtocolIds" Impersonate="no" BinaryRef="wslinstall.dll" DllEntry="CalculateWslSettingsProtocolIds" Return="check" Execute='immediate' />
<!-- See https://learn.microsoft.com/en-us/windows/win32/msi/examples-of-conditional-statement-syntax -->
<InstallExecuteSequence>
<Custom Action="ValidateInstall" After="InstallInitialize" Condition="(not INSTALLED) and (not SKIPVALIDATION = 1)" />
<!-- Must run before InstallServices or else we'll fail if wslservice already exists.
Covers cases where:
- The MSI package is installed for the first time and the old MSIX needs to be removed
- The MSI package is uninstalled and the glue MSIX must be removed
Must also run before CreateShortcuts since there might be an old MSIX shortcut that conflicts with ours.
Also, this action must not run during upgrades
since upgrades start by first uninstalling the package, this isn't run if UPGRADINGPRODUCTCODE is set in the 'removing' MSI process.
In this path, only the installing MSI process should run this action.
We use 'BindImage' since its just before 'CreateShortcuts' in the install sequence
-->
<Custom Action="DeprovisionMsix" After="BindImage" Condition='((not INSTALLED) or (REMOVE~="ALL")) and (not UPGRADINGPRODUCTCODE) and (not SKIPMSIX = 1)'/>
<!-- We need to remove the MSIX both as user and as system to work around a race condition in MSIX -->
<Custom Action="RemoveMsixAsUser" After="DeprovisionMsix" Condition='((not INSTALLED) or (REMOVE~="ALL")) and (not UPGRADINGPRODUCTCODE) and (not SKIPMSIX = 1)'/>
<Custom Action="RemoveMsixAsSystem" After="RemoveMsixAsUser" Condition='((not INSTALLED) or (REMOVE~="ALL")) and (not UPGRADINGPRODUCTCODE) and (not SKIPMSIX = 1)'/>
<!-- This needs to run before the MSI logic tries to write the registry or create shortcuts-->
<Custom Action="CleanMsixState" After="RemoveMsixAsSystem" Condition='((not INSTALLED) or (not REMOVE~="ALL")) and (not UPGRADINGPRODUCTCODE)' />
<!-- This is needed to remove the SFGAO_NONENUMERATED flag from the explorer keys, which can prevent the WSL icon from being visible -->
<Custom Action="CleanExplorerState" Before="WriteRegistryValues" Condition='((not REMOVE~="ALL") or WIX_UPGRADE_DETECTED) and (not UPGRADINGPRODUCTCODE)' />
<!-- This needs to run before the registry is written since it removes registry protections that prevents MSI from writing to the registry key -->
<Custom Action="RemoveRegistryKeyProtections" After="CleanExplorerState" Condition='((not REMOVE~="ALL") or WIX_UPGRADE_DETECTED) and (not UPGRADINGPRODUCTCODE)' />
<!-- Runs during first install and upgrade
This action must not run if UPGRADINGPRODUCTCODE is set because it should only run during the second sequence
Note: versions < 2.0.2 pass REINSTALL=ALL which sets REMOVE=ALL.
Use WIX_UPGRADE_DETECTED to cover this scenario since it's always set when a previous build is installed.
-->
<Custom Action="InstallMsix.SetProperty" After="CleanMsixState" Condition='((not REMOVE~="ALL") or WIX_UPGRADE_DETECTED) and (not UPGRADINGPRODUCTCODE) and (not SKIPMSIX = 1)' />
<Custom Action="InstallMsix" After="InstallMsix.SetProperty" Condition='((not REMOVE~="ALL") or WIX_UPGRADE_DETECTED) and (not UPGRADINGPRODUCTCODE) and (not SKIPMSIX = 1)' />
<Custom Action="InstallMsixAsUser" After="InstallMsix" Condition='((not REMOVE~="ALL") or WIX_UPGRADE_DETECTED) and (not UPGRADINGPRODUCTCODE) and (not SKIPMSIX = 1)' />
<!-- This needs to run after the registry is written because this action needs to read the install path -->
<Custom Action="RegisterLspCategories" After="WriteRegistryValues" Condition='((not REMOVE~="ALL") or WIX_UPGRADE_DETECTED) and (not UPGRADINGPRODUCTCODE) and (not SKIPLSP = 1)' />
<!-- This needs to run before the registry is cleared because this action needs to read the install path.
This actions runs on uninstallation and upgrade. -->
<Custom Action="UnregisterLspCategories" Before="RemoveRegistryValues" Condition='(REMOVE~="ALL") and (not UPGRADINGPRODUCTCODE) and (not SKIPLSP = 1)' />
<?if "${WSL_BUILD_WSL_SETTINGS}" = "true" ?>
<!-- This needs to run before the registry is written because this action calculates registry key names and values -->
<Custom Action="CalculateWslSettingsProtocolIds" Before="WriteRegistryValues" Condition='(not REMOVE~="ALL")' />
<?endif?>
<Custom Action="FinalizeInstall" After="PublishFeatures"/>
</InstallExecuteSequence>
<!-- Don't show a 'Modify' button in settings since there is nothing to modify -->
<Property Id="ARPNOMODIFY" Value="yes" Secure="yes" />
<Property Id="ARPSYSTEMCOMPONENT" Value="yes" Secure="yes" />
<!-- Setting REINSTALLMODE to AMUS will force all re-installed components to re-install all files, registry keys and shortcuts.
This is useful during downgrades since components with KeyPath set will not removed if their KeyPath points to valid file / registry key.
-->
<Property Id="REINSTALLMODE" Value="AMUS" Secure="yes" />
<!-- Force all applications to exit during upgrade.
See: https://learn.microsoft.com/en-us/windows/win32/msi/msirmshutdown
-->
<Property Id="MSIRMSHUTDOWN" Value="1" Secure="yes" />
</Package>
</Wix>