Last active
March 23, 2020 22:22
-
-
Save kant2002/08de74e8849b0d5b1cfa6a714aca891f to your computer and use it in GitHub Desktop.
Package UEFI application in VHDX
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Target Name="GenerateVirtuaDisk" AfterTargets="Publish"> | |
<PropertyGroup> | |
<VHD>$(MSBuildProjectDirectory)\$(NativeOutputPath)seesharpsnake.vhdx</VHD> | |
<CreatePartitionCommand> | |
create vdisk file=$(VHD) maximum=40 | |
select vdisk file=$(VHD) | |
attach vdisk | |
convert gpt | |
create partition efi | |
format quick fs=fat32 label="System" | |
assign letter="X" | |
exit | |
</CreatePartitionCommand> | |
<CreatePartitionCommand2> | |
select vdisk file=$(VHD) | |
select partition 1 | |
remove letter=X | |
detach vdisk | |
exit | |
</CreatePartitionCommand2> | |
</PropertyGroup> | |
<Delete Files="$(VHD)" /> | |
<WriteLinesToFile File="$(NativeOutputPath)diskpart1.txt" Overwrite="true" Lines="$(CreatePartitionCommand)" /> | |
<WriteLinesToFile File="$(NativeOutputPath)diskpart2.txt" Overwrite="true" Lines="$(CreatePartitionCommand2)" /> | |
<Exec Command="diskpart /s "$(MSBuildProjectDirectory)\$(NativeOutputPath)diskpart1.txt"" /> | |
<Copy SourceFiles="$(MSBuildProjectDirectory)\$(NativeOutputPath)$(TargetName)$(NativeBinaryExt)" DestinationFiles="X:\EFI\BOOT\BOOTX64.efi" /> | |
<Exec Command="diskpart /s "$(MSBuildProjectDirectory)\$(NativeOutputPath)diskpart2.txt"" /> | |
</Target> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment