-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI Pipelines build with WDK Nuget Packages (#1179)
Integrate nuget into the workflow pipelines
- Loading branch information
1 parent
dbfbead
commit e59949f
Showing
6 changed files
with
135 additions
and
45 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<# | ||
.SYNOPSIS | ||
Checks WDK vsix version and downloads and installs as necessary. | ||
#> | ||
|
||
[CmdletBinding()] | ||
param( | ||
[bool]$optimize = $false | ||
) | ||
|
||
$root = Get-Location | ||
|
||
# launch developer powershell (if necessary) | ||
if (-not $env:VSCMD_VER) { | ||
Import-Module (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*\Common7\Tools\Microsoft.VisualStudio.DevShell.dll") | ||
Enter-VsDevShell -VsInstallPath (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*") | ||
cd $root | ||
} | ||
|
||
# source environment variables | ||
. .\Env-Vars.ps1 | ||
|
||
$version = $env:SAMPLES_VSIX_VERSION | ||
$uri = $env:SAMPLES_VSIX_URI | ||
|
||
function PrintWdkVsix { | ||
$installed = ls "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=*" | Select -ExpandProperty Name | ||
"WDK Vsix Version: $installed" | ||
} | ||
|
||
function TestWdkVsix { | ||
Test-Path "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=$version" | ||
} | ||
|
||
if ($optimize) { | ||
"---> Downloading vsix and configuring build environment..." | ||
Invoke-WebRequest -Uri "$uri" -OutFile wdk.zip | ||
Expand-Archive ".\wdk.zip" .\ | ||
cp ".\`$MSBuild\*" (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*\MSBuild\") -Recurse -Force | ||
"<--- Finished" | ||
} | ||
else { | ||
"Getting installed WDK vsix..." | ||
PrintWdkVsix | ||
"Checking the WDK.vsix version installed..." | ||
if (-not (TestWdkVsix)) { | ||
"The correct WDK vsix is not installed." | ||
"Will attempt to download and install now..." | ||
Invoke-WebRequest -Uri "$uri" -OutFile wdk.vsix | ||
"Finished downloading." | ||
"Starting install process. This will take some time to complete..." | ||
Start-Process vsixinstaller -ArgumentList "/f /q /sp .\wdk.vsix" -wait | ||
"The install process has finished." | ||
"Checking the WDK.vsix version installed..." | ||
if (TestWdkVsix) { | ||
PrintWdkVsix | ||
"The WDK vsix version is OK" | ||
} | ||
else { | ||
"The WDK vsix install FAILED" | ||
Write-Host "`u{274C} wdk vsix install had an issue" | ||
Write-Error "the wdk vsix cannot be installed at this time" | ||
exit 1 | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Environment variables for script sourcing. | ||
# Note: When a new WDK ships the following need to be updated: | ||
# 1. Environment variables in .\Env-Vars.ps1 (this script) | ||
# 2. Nuget package versions in .\packages.config | ||
# 3. Nuget package versions in .\Directory.Build.props | ||
# 4. SDK and WDK versions and WDK vsix link in .\configuration.dsc.yaml | ||
$env:SAMPLES_VSIX_VERSION = "10.0.26100.0" | ||
$env:SAMPLES_VSIX_URI = "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/DriverDeveloperKits-WDK/vsextensions/WDKVsix/10.0.26100.0/vspackage?targetPlatform=5e3e564c-03bb-4499-8ae5-b2b35e9a86dc" | ||
$env:SAMPLES_BUILD_NUMBER = "26100" |