Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
An installer for the OpenXT Windows PV drivers and scripts to fetch &
build.

Signed-off-by: Troy Crosley <[email protected]>
  • Loading branch information
troyc committed May 14, 2020
0 parents commit d05dae0
Show file tree
Hide file tree
Showing 8 changed files with 338 additions and 0 deletions.
32 changes: 32 additions & 0 deletions BUILD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Building OpenXT Tools
=============================

Note that only xenbus, xenvusb, and xenusbdevice are built; the other drivers
use the binaries provided by the Xen Project.

First you'll need a device driver build environment for Windows 10. Happily
Microsoft has made this easy with the introduction of the 'EWDK'. This is an
ISO containing all the build environment you need (except for Wix, which is
included in the project).

The package should support building with the following EWDKs:

- EWDK for Windows 10, version 1903 with Visual Studio Build Tools 16.0
- EWDK for Windows 10, version 1809 with Visual Studio Build Tools 15.8.9

Once you have downloaded the ISO, open it and you should see a file called:

LaunchBuildEnv.cmd

Run this and it should give you a build environment command prompt. From
within this shell navigate to the root of your checked out repository
and run:

buildall.bat checked

Or, for a release build:

buildall.bat free



14 changes: 14 additions & 0 deletions buildall.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@echo off

set type=%1

for %%x in (xenbus, xenvusb, xenusbdevice) do (
pushd %%x
powershell ./build.ps1 %type%
popd
)

set type=%type:checked=Debug%
set type=%type:free=Release%

msbuild.exe -p:Configuration=%type% -p:Platform=x64
9 changes: 9 additions & 0 deletions externals.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
uri,outFile,sha256hash
https://xenbits.xenproject.org/pvdrivers/win/9.0.0/xenvkbd.tar,xenvkbd.tar,B4F82EE0B66EBD9C6599C017F9EF4B943A3A260D8D55A6E1FA060585A31AB589
https://xenbits.xenproject.org/pvdrivers/win/9.0.0/xenhid.tar,xenhid.tar,85A53CFD85BACC2B74E28464608E59C7BD7554F64A0BA0A4A8F47539B04CAD4F
https://xenbits.xenproject.org/pvdrivers/win/9.0.0/xencons.tar,xencons.tar,E03CE84B0B89F9AC595DC82AD8651C02347716510CCCADD1339AA2B90CAC2FE1
https://xenbits.xenproject.org/pvdrivers/win/9.0.0/xenvbd.tar,xenvbd.tar,CE23961AC45BCC40B7219FA8ED7F41AA9A76D5BCA5E8F0C88C5AF04ABFBAFBAB
https://xenbits.xenproject.org/pvdrivers/win/9.0.0/xennet.tar,xennet.tar,9D94C1EE04C82B4060A8D3E1301C3BECE46C440091B6512DE4DBE602FC298109
https://xenbits.xenproject.org/pvdrivers/win/9.0.0/xenvif.tar,xenvif.tar,CEF7366EF832CADB069EA57125FB3755B6B96A910F51A62E35C8D31012304788
https://xenbits.xenproject.org/pvdrivers/win/9.0.0/xeniface.tar,xeniface.tar,8A59A48A6D4E1F3CFBCC3B4165A1278B8FE4AF5A2D8B7C6DEC14D4B8DE65F19A
https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip,wix.zip,2C1888D5D1DBA377FC7FA14444CF556963747FF9A0A289A3599CF09DA03B9E2E
27 changes: 27 additions & 0 deletions fetch-externals.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
function expandArchive ($file) {
Write-Host "Expanding $file"
$fileExtension = $file.substring($file.length - 3, 3)
if ($fileExtension -eq "zip") {
Expand-Archive $file
} elseif ($fileExtension -eq "tar") {
tar xf $file
} else {
Write-Host "Unknown file ending: [$fileExtension]"
}
}

function fileDownloadAndValidate( $uri, $outFile, $sha256Hash ) {
Write-Host "Downloading $uri"
Invoke-WebRequest -Uri "$uri" -OutFile "$outFile"
$calculatedHash = ( Get-FileHash -Algorithm SHA256 $outFile ).Hash
if ($calculatedHash -ne "$sha256Hash") {
Write-Host "ERROR: Incorrect SHA256 hash of [$calculatedHash] for [$outFile]; expected [$sha256Hash]"
exit -1
}
}

$externals = Import-Csv "externals.csv"
$externals | ForEach-Object {
fileDownloadAndValidate $_.uri $_.outFile $_.sha256Hash
expandArchive $_.outFile
}
31 changes: 31 additions & 0 deletions installer.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29926.136
MinimumVisualStudioVersion = 10.0.40219.1
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "installer", "installer\installer.wixproj", "{F4AD33F1-6717-46D2-A5C2-8CC6B06A9B57}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F4AD33F1-6717-46D2-A5C2-8CC6B06A9B57}.Debug|x64.ActiveCfg = Debug|x64
{F4AD33F1-6717-46D2-A5C2-8CC6B06A9B57}.Debug|x64.Build.0 = Debug|x64
{F4AD33F1-6717-46D2-A5C2-8CC6B06A9B57}.Debug|x86.ActiveCfg = Debug|x86
{F4AD33F1-6717-46D2-A5C2-8CC6B06A9B57}.Debug|x86.Build.0 = Debug|x86
{F4AD33F1-6717-46D2-A5C2-8CC6B06A9B57}.Release|x64.ActiveCfg = Release|x64
{F4AD33F1-6717-46D2-A5C2-8CC6B06A9B57}.Release|x64.Build.0 = Release|x64
{F4AD33F1-6717-46D2-A5C2-8CC6B06A9B57}.Release|x86.ActiveCfg = Release|x86
{F4AD33F1-6717-46D2-A5C2-8CC6B06A9B57}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {55B5064E-42DA-44FB-A3ED-96EDCBC4B2C3}
EndGlobalSection
EndGlobal
76 changes: 76 additions & 0 deletions installer/installer.wixproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" InitialTargets="EnsureWixToolsetInstalled" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WixToolPath>..\wix\</WixToolPath>
<WixTargetsPath>$(WixToolPath)Wix.targets</WixTargetsPath>
<WixTasksPath>wixtasks.dll</WixTasksPath>
</PropertyGroup>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>3.10</ProductVersion>
<ProjectGuid>f4ad33f1-6717-46d2-a5c2-8cc6b06a9b57</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>OpenXT-Tools</OutputName>
<OutputType>Package</OutputType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>Debug</DefineConstants>
<CompilerAdditionalOptions>-ext WixDifxAppExtension</CompilerAdditionalOptions>
<LinkerAdditionalOptions>-ext WixDifxAppExtension</LinkerAdditionalOptions>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<CompilerAdditionalOptions>-ext WixDifxAppExtension</CompilerAdditionalOptions>
<LinkerAdditionalOptions>-ext WixDifxAppExtension</LinkerAdditionalOptions>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<DefineConstants>Debug</DefineConstants>
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Platform)\$(Configuration)\</IntermediateOutputPath>
<CompilerAdditionalOptions>-ext WixDifxAppExtension</CompilerAdditionalOptions>
<LinkerAdditionalOptions>-ext WixDifxAppExtension</LinkerAdditionalOptions>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Platform)\$(Configuration)\</IntermediateOutputPath>
<CompilerAdditionalOptions>-ext WixDifxAppExtension</CompilerAdditionalOptions>
<LinkerAdditionalOptions>-ext WixDifxAppExtension</LinkerAdditionalOptions>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<DefineConstants>Debug</DefineConstants>
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Platform)\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Platform)\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
<ItemGroup>
<Compile Include="installer.wxs" />
<WixLibrary Include="difxapp_x64">
<HintPath>$(WixExtDir)\difxapp_x64.wixlib</HintPath>
<Name>difxapp_x64</Name>
</WixLibrary>
<WixExtension Include="WixIIsExtension">
<HintPath>$(WixExtDir)\WixIIsExtension.dll</HintPath>
<Name>WixIIsExtension</Name>
</WixExtension>
</ItemGroup>
<Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets') " />
<Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' ">
<Error Text="The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/" />
</Target>
<!--
To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Wix.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
149 changes: 149 additions & 0 deletions installer/installer.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
<?xml version='1.0' encoding='utf-8'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'
xmlns:difx='http://schemas.microsoft.com/wix/DifxAppExtension'
xmlns:iis='http://schemas.microsoft.com/wix/IIsExtension'>

<?define DIR_XENBUS = $(var.SolutionDir)xenbus\xenbus\$(var.Platform)\ ?>
<?define DIR_XENCONS = $(var.SolutionDir)xencons\$(var.Platform)\ ?>
<?define DIR_XENIFACE = $(var.SolutionDir)xeniface\$(var.Platform)\ ?>
<?define DIR_XENHID = $(var.SolutionDir)xenhid\$(var.Platform)\ ?>
<?define DIR_XENVKBD = $(var.SolutionDir)xenvkbd\$(var.Platform)\ ?>
<?define DIR_XENVIF = $(var.SolutionDir)xenvif\$(var.Platform)\ ?>
<?define DIR_XENNET = $(var.SolutionDir)xennet\$(var.Platform)\ ?>
<?define DIR_XENVBD = $(var.SolutionDir)xenvbd\$(var.Platform)\ ?>
<?define DIR_XENVUSB = $(var.SolutionDir)xenvusb\xenvusb\$(var.Platform)\ ?>
<?define DIR_XENUSBDEVICE = $(var.SolutionDir)xenusbdevice\xenusbdevice\$(var.Platform)\ ?>

<?define DIR_CERTS = $(var.ProjectDir) ?>
<?define CERT_TESTSIGNING = testsigning.cer ?>

<Product Id="*" Name="OpenXT Tools" Language="1033" Version='9.0.0' Manufacturer="OpenXT" UpgradeCode="D5FFB704-D8B7-4D05-A866-7C57F21F88D1">
<Package Description="OpenXT Tools" Manufacturer="OpenXT" InstallerVersion="301" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes" />
<Feature Id="OpenXTTools" Title="OpenXT Tools">
<ComponentGroupRef Id="Certs" />
<ComponentGroupRef Id="XenTools" />
<ComponentGroupRef Id="MiscDrivers" />
</Feature>
<InstallExecuteSequence>
<ScheduleReboot After="InstallFinalize"/>
</InstallExecuteSequence>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="OpenXTTools" Name="OpenXT Tools">
<Directory Id="Certs" Name="certs" />
<Directory Id="Xenbus" Name="xenbus" />
<Directory Id="Xencons" Name="xencons" />
<Directory Id="Xeniface" Name="xeniface" />
<Directory Id="Xenvbd" Name="xenvbd" />
<Directory Id="Xenvif" Name="xenvif" />
<Directory Id="Xennet" Name="xennet" />
<Directory Id="Xenhid" Name="xenhid" />
<Directory Id="Xenvkbd" Name="xenvkbd" />
<Directory Id="Xenvusb" Name="xenvusb" />
<Directory Id="Xenusbdevice" Name="xenusbdevice" />
</Directory>
</Directory>
</Directory>
<Binary Id='TestsigningBinary' SourceFile='$(var.DIR_CERTS)$(var.CERT_TESTSIGNING)' />
<ComponentGroup Id="Certs">
<Component Id='Certificate' Guid='5C7998EF-6EFF-43E1-8EB6-AA6BAA15434B' Directory='Certs'>
<File Id='Testsigning' Name='$(var.CERT_TESTSIGNING)' Source='$(var.DIR_CERTS)$(var.CERT_TESTSIGNING)' KeyPath='yes' />
<iis:Certificate Id='Testsigning'
BinaryKey='TestsigningBinary'
Name='$(var.CERT_TESTSIGNING)'
StoreLocation='localMachine'
StoreName='root'
Request='no'
Overwrite='yes'
/>
</Component>
</ComponentGroup>
<ComponentGroup Id="XenTools">
<Component Id='Xenbus' Guid='4A5B5964-EAB7-488B-ACFA-DFDB228BA423' Directory='Xenbus'>
<File Id='XenbusSys' Source='$(var.DIR_XENBUS)xenbus.sys' KeyPath='yes' />
<File Id='XenbusInf' Source='$(var.DIR_XENBUS)xenbus.inf' />
<File Id='XenbusCat' Source='$(var.DIR_XENBUS)xenbus.cat' />
<File Id='XenSys' Source='$(var.DIR_XENBUS)xen.sys' />
<File Id='XenfiltSys' Source='$(var.DIR_XENBUS)xenfilt.sys' />
<File Id='XenbusCoinst' Source='$(var.DIR_XENBUS)xenbus_coinst.dll' />
<File Id='XenbusMonitorDll' Source='$(var.DIR_XENBUS)xenbus_monitor.dll' />
<File Id='XenbusMonitorExe' Source='$(var.DIR_XENBUS)xenbus_monitor.exe' />
<difx:Driver AddRemovePrograms='no' PlugAndPlayPrompt='no' />
</Component>
<Component Id='Xencons' Guid='2FB2923A-7023-48EB-9814-4748BA7AFE1E' Directory='Xencons'>
<File Id='XenconsSys' Source='$(var.DIR_XENCONS)xencons.sys' KeyPath='yes' />
<File Id='XenconsInf' Source='$(var.DIR_XENCONS)xencons.inf' />
<File Id='XenconsCat' Source='$(var.DIR_XENCONS)xencons.cat' />
<File Id='XenconsCoinst' Source='$(var.DIR_XENCONS)xencons_coinst.dll' />
<File Id='XenconsMonitorDll' Source='$(var.DIR_XENCONS)xencons_monitor.dll' />
<File Id='XenconsMonitorExe' Source='$(var.DIR_XENCONS)xencons_monitor.exe' />
<File Id='XenconsTtyExe' Source='$(var.DIR_XENCONS)xencons_tty.exe' />
<difx:Driver AddRemovePrograms='no' PlugAndPlayPrompt='no' />
</Component>
<Component Id='Xeniface' Guid='E0DC80E8-5A9E-4F92-87C0-CBF17C11B384' Directory='Xeniface'>
<File Id='XenifaceSys' Source='$(var.DIR_XENIFACE)xeniface.sys' KeyPath='yes' />
<File Id='XenifaceInf' Source='$(var.DIR_XENIFACE)xeniface.inf' />
<File Id='XenifaceCat' Source='$(var.DIR_XENIFACE)xeniface.cat' />
<File Id='XenifaceCoinst' Source='$(var.DIR_XENIFACE)xeniface_coinst.dll' />
<File Id='XenagentDll' Source='$(var.DIR_XENIFACE)xenagent.dll' />
<File Id='XenagentExe' Source='$(var.DIR_XENIFACE)xenagent.exe' />
<difx:Driver AddRemovePrograms='no' PlugAndPlayPrompt='no' />
</Component>
<Component Id='Xenhid' Guid='C9534D9E-3ADB-443E-8DCF-24EF77AA69E8' Directory='Xenhid'>
<File Id='XenhidSys' Source='$(var.DIR_XENHID)xenhid.sys' KeyPath='yes' />
<File Id='XenhidInf' Source='$(var.DIR_XENHID)xenhid.inf' />
<File Id='XenhidCat' Source='$(var.DIR_XENHID)xenhid.cat' />
<File Id='XenhidCoinst' Source='$(var.DIR_XENHID)xenhid_coinst.dll' />
<difx:Driver AddRemovePrograms='no' PlugAndPlayPrompt='no' />
</Component>
<Component Id='Xenvkbd' Guid='B3C80249-E80F-4CA4-A293-8E858B45288C' Directory='Xenvkbd'>
<File Id='XenvkbdSys' Source='$(var.DIR_XENVKBD)xenvkbd.sys' KeyPath='yes' />
<File Id='XenvkbdInf' Source='$(var.DIR_XENVKBD)xenvkbd.inf' />
<File Id='XenvkbdCat' Source='$(var.DIR_XENVKBD)xenvkbd.cat' />
<File Id='XenvkbdCoinst' Source='$(var.DIR_XENVKBD)xenvkbd_coinst.dll' />
<difx:Driver AddRemovePrograms='no' PlugAndPlayPrompt='no' />
</Component>
<Component Id='Xenvif' Guid='AA02F568-3DC4-43B6-83BC-75832CA4E4F0' Directory='Xenvif'>
<File Id='XenvifSys' Source='$(var.DIR_XENVIF)xenvif.sys' KeyPath='yes' />
<File Id='XenvifInf' Source='$(var.DIR_XENVIF)xenvif.inf' />
<File Id='XenvifCat' Source='$(var.DIR_XENVIF)xenvif.cat' />
<File Id='XenvifCoinst' Source='$(var.DIR_XENVIF)xenvif_coinst.dll' />
<difx:Driver AddRemovePrograms='no' PlugAndPlayPrompt='no' />
</Component>
<Component Id='Xennet' Guid='3E83BF0A-9405-4523-B418-605D33EC0345' Directory='Xennet'>
<File Id='XennetSys' Source='$(var.DIR_XENNET)xennet.sys' KeyPath='yes' />
<File Id='XennetInf' Source='$(var.DIR_XENNET)xennet.inf' />
<File Id='XennetCat' Source='$(var.DIR_XENNET)xennet.cat' />
<File Id='XennetCoinst' Source='$(var.DIR_XENNET)xennet_coinst.dll' />
<difx:Driver AddRemovePrograms='no' PlugAndPlayPrompt='no' />
</Component>
<Component Id='Xenvbd' Guid='30D77968-F9A7-4466-8436-2A3020F007F3' Directory='Xenvbd'>
<File Id='XenvbdSys' Source='$(var.DIR_XENVBD)xenvbd.sys' KeyPath='yes' />
<File Id='XenvbdInf' Source='$(var.DIR_XENVBD)xenvbd.inf' />
<File Id='XenvbdCat' Source='$(var.DIR_XENVBD)xenvbd.cat' />
<File Id='XencrshSys' Source='$(var.DIR_XENVBD)xencrsh.sys' />
<File Id='XendiskSys' Source='$(var.DIR_XENVBD)xendisk.sys' />
<File Id='XenvbdCoinst' Source='$(var.DIR_XENVBD)xenvbd_coinst.dll' />
<difx:Driver AddRemovePrograms='no' PlugAndPlayPrompt='no' />
</Component>
</ComponentGroup>
<ComponentGroup Id="MiscDrivers">
<Component Id='Xenvusb' Guid='F6E5C176-7869-49FD-BB35-62228A173A2F' Directory='Xenvusb'>
<File Id='XenvusbSys' Source='$(var.DIR_XENVUSB)xenvusb.sys' KeyPath='yes' />
<File Id='XenvusbInf' Source='$(var.DIR_XENVUSB)xenvusb.inf' />
<File Id='XenvusbCat' Source='$(var.DIR_XENVUSB)xenvusb.cat' />
<File Id='XenvusbCoinst' Source='$(var.DIR_XENVUSB)xenvusb_coinst.dll' />
<difx:Driver AddRemovePrograms='no' PlugAndPlayPrompt='no' />
</Component>
<Component Id='Xenusbdevice' Guid='3D2B8FE3-A2C4-4D78-B0D1-35D5DFFEBE9A' Directory='Xenusbdevice'>
<File Id='XenusbdeviceSys' Source='$(var.DIR_XENUSBDEVICE)xenusbdevice.sys' KeyPath='yes' />
<File Id='XenusbdeviceInf' Source='$(var.DIR_XENUSBDEVICE)xenusbdevice.inf' />
<File Id='XenusbdeviceCat' Source='$(var.DIR_XENUSBDEVICE)xenusbdevice.cat' />
<File Id='XenusbdeviceCoinst' Source='$(var.DIR_XENUSBDEVICE)xenusbdevice_coinst.dll' />
<difx:Driver AddRemovePrograms='no' PlugAndPlayPrompt='no' />
</Component>
</ComponentGroup>
</Product>
</Wix>
Binary file added installer/testsigning.cer
Binary file not shown.

0 comments on commit d05dae0

Please sign in to comment.