Skip to content

Commit e7dc805

Browse files
authored
Merge pull request #7 from fengxx/feature/manifest
add manifest for requireAdministr User Account Control(UAC)
2 parents 797a16f + 4cf774a commit e7dc805

3 files changed

Lines changed: 19 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ root@WSL ~ # ip link
2929
6: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
3030
link/ether 00:15:5d:f3:58:46 brd ff:ff:ff:ff:ff:ff
3131
root@WSL ~ # # Assume that we have a virtual switch named "New Virtual Switch" in Hyper-V Manager
32-
root@WSL ~ # /mnt/c/some/random/path/WSLAttachSwitch.exe "New Virtual Switch"
32+
root@WSL ~ # cmd.exe /c "c:\some\random\path\WSLAttachSwitch.exe" "New Virtual Switch"
3333
root@WSL ~ # # Now we have a new interface "eth1"
3434
root@WSL ~ # ip link
3535
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000

WSLAttachSwitch.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
<HttpActivityPropagationSupport>false</HttpActivityPropagationSupport>
2121
<InvariantGlobalization>true</InvariantGlobalization>
2222
</PropertyGroup>
23-
23+
<PropertyGroup>
24+
<ApplicationManifest>WSLAttachSwitch.manifest</ApplicationManifest>
25+
</PropertyGroup>
2426
<ItemGroup>
2527
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
2628
</ItemGroup>

WSLAttachSwitch.manifest

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
3+
<assemblyIdentity type="win32" version="1.0.0.0" name="WSLAttachSwitch" />
4+
<description>Attach hyperv switch</description>
5+
<!-- Identify the application security requirements. -->
6+
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
7+
<security>
8+
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
9+
<requestedExecutionLevel
10+
level="requireAdministrator"
11+
uiAccess="false"/>
12+
</requestedPrivileges>
13+
</security>
14+
</trustInfo>
15+
</assembly>

0 commit comments

Comments
 (0)