forked from dorssel/usbipd-win
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWSL.wxs
65 lines (59 loc) · 2.76 KB
/
WSL.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
<?xml version="1.0" encoding="UTF-8"?>
<!--
SPDX-FileCopyrightText: 2024 Frans van Dorsselaer
SPDX-License-Identifier: GPL-3.0-only
-->
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Fragment>
<DirectoryRef Id="APPLICATIONFOLDER">
<!-- Windows uses uppercase spelling for folders related to WSL (and lowercase for files). -->
<Directory Id="WSL" Name="WSL" />
</DirectoryRef>
</Fragment>
<Fragment>
<DirectoryRef Id="WSL" FileSource="$(var.PublishDir)\WSL">
<Component Id="WSL_README.md">
<File Id="WSL_README.md" Name="README.md" />
</Component>
<Component Id="usbip">
<File Id="usbip" Name="usbip" />
</Component>
<Component Id="auto_attach.sh">
<File Id="auto_attach.sh" Name="auto-attach.sh" />
</Component>
</DirectoryRef>
<!--
This directory gets mounted within WSL, and Linux should not treat ordinary files as executable.
We want to inherit all rights + add a deny for execution of non-executable files.
WiX does not have tooling to add a "deny permission".
NOTE: Add the following for any non-executable files.
-->
<!--
<SetProperty
Id="FixExecutionRights_file.id"
Value=""[System64Folder]\icacls.exe" "[#file.id]" /deny "*S-1-1-0:(X)""
Sequence="execute" Before="FixExecutionRights_file.id" Condition="$file.id=3"
/>
<CustomAction Id="FixExecutionRights_file.id" BinaryRef="Wix4UtilCA_X64" DllEntry="WixQuietExec" Return="ignore" Impersonate="no" Execute="deferred" />
<InstallExecuteSequence>
<Custom Action="FixExecutionRights_file.id" Before="InstallFinalize" Condition="$file.id=3" />
</InstallExecuteSequence>
-->
<SetProperty
Id="FixExecutionRights_WSL_README.md"
Value=""[System64Folder]\icacls.exe" "[#WSL_README.md]" /deny "*S-1-1-0:(X)""
Sequence="execute" Before="FixExecutionRights_WSL_README.md" Condition="$WSL_README.md=3"
/>
<CustomAction Id="FixExecutionRights_WSL_README.md" BinaryRef="Wix4UtilCA_X64" DllEntry="WixQuietExec" Return="ignore" Impersonate="no" Execute="deferred" />
<InstallExecuteSequence>
<Custom Action="FixExecutionRights_WSL_README.md" After="InstallFiles" Condition="$WSL_README.md=3" />
</InstallExecuteSequence>
</Fragment>
<Fragment>
<ComponentGroup Id="WSL">
<ComponentRef Id="WSL_README.md" />
<ComponentRef Id="usbip" />
<ComponentRef Id="auto_attach.sh" />
</ComponentGroup>
</Fragment>
</Wix>