Skip to content

Commit 121daaf

Browse files
committed
Fix the wdk version in EWDK
1 parent 7bc5255 commit 121daaf

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

Build-SampleSet.ps1

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,19 +104,20 @@ else {
104104
exit 1
105105
}
106106
#
107-
# Get the WDK extension version from installed packages
108-
$wdk_extension_ver = Get-ChildItem "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=*" | Select-Object -ExpandProperty Name
109-
$wdk_extension_ver = ([regex]'(\d+\.)(\d+\.)(\d+\.)(\d+)').Matches($wdk_extension_ver).Value
110-
if (-not $wdk_extension_ver) {
111-
# Be lenient with EWDK builds that do not include the package information
112-
if ($build_environment -match '^EWDK') {
113-
$wdk_extension_ver = "(package not found)"
114-
}
115-
else {
107+
108+
# Be lenient with EWDK builds that do not include the package information
109+
if ($build_environment -match '^EWDK') {
110+
$wdk_extension_ver = "(package is not included for EWDK builds)"
111+
} else {
112+
# Get the WDK extension version from installed packages
113+
$wdk_extension_ver = Get-ChildItem "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=*" -ErrorAction SilentlyContinue
114+
if (-not $wdk_extension_ver) {
116115
Write-Error "No version of the WDK Visual Studio Extension could be found. The WDK Extension is not installed."
117116
exit 1
118117
}
118+
$wdk_extension_ver = [regex]::Match($wdk_extension_ver.Name, '(\d+\.){3}\d+').Value
119119
}
120+
120121
#
121122
#
122123
# InfVerif_AdditionalOptions

0 commit comments

Comments
 (0)