From d651c8859c8917135c6d664517550e0f898905f7 Mon Sep 17 00:00:00 2001 From: Matt <138825652+middlemose@users.noreply.github.com> Date: Wed, 18 Sep 2024 20:55:50 -0700 Subject: [PATCH] Deprecate WDK vsix install --- .github/scripts/Install-Vsix.ps1 | 2 +- .github/workflows/Code-Scanning.yml | 3 --- .github/workflows/ci-pr.yml | 3 --- .github/workflows/ci.yml | 3 --- Build-SampleSet.ps1 | 22 +++++++++------------- Building-Locally.md | 2 +- configuration.dsc.yaml | 19 ++----------------- configuration_vsonly.dsc.yaml | 3 ++- 8 files changed, 15 insertions(+), 42 deletions(-) diff --git a/.github/scripts/Install-Vsix.ps1 b/.github/scripts/Install-Vsix.ps1 index 50ef088b0..3ca8c65d5 100644 --- a/.github/scripts/Install-Vsix.ps1 +++ b/.github/scripts/Install-Vsix.ps1 @@ -1,7 +1,7 @@ <# .SYNOPSIS -Download and install the latest WDK VSIX. +DEPRECATED #> diff --git a/.github/workflows/Code-Scanning.yml b/.github/workflows/Code-Scanning.yml index cd0d8abfd..313ce215c 100644 --- a/.github/workflows/Code-Scanning.yml +++ b/.github/workflows/Code-Scanning.yml @@ -37,9 +37,6 @@ jobs: with: submodules: 'recursive' - - name: Install WDK VSIX - run: .\.github\scripts\Install-Vsix.ps1 - - name: Install Nuget Packages run: nuget restore .\packages.config -PackagesDirectory .\packages\ diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index c04f4adb8..72fb176f3 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -22,9 +22,6 @@ jobs: with: submodules: 'recursive' - - name: Install WDK VSIX - run: .\.github\scripts\Install-Vsix.ps1 - - name: Install Nuget Packages run: nuget restore .\packages.config -PackagesDirectory .\packages\ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c35a81ec1..11dee203e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,9 +22,6 @@ jobs: with: submodules: 'recursive' - - name: Install WDK VSIX - run: .\.github\scripts\Install-Vsix.ps1 - - name: Install Nuget Packages run: nuget restore .\packages.config -PackagesDirectory .\packages\ diff --git a/Build-SampleSet.ps1 b/Build-SampleSet.ps1 index adae8bb06..8c48bd181 100644 --- a/Build-SampleSet.ps1 +++ b/Build-SampleSet.ps1 @@ -61,7 +61,6 @@ finally { $build_environment="" $build_number=0 $nuget_package_version=0 -$vsix_version="" # # In Github we build using NuGet and get the version from packages and vsix version from env var set from the install vsix step. # @@ -69,7 +68,6 @@ if ($env:GITHUB_REPOSITORY) { $build_environment="GitHub" $nuget_package_version=([regex]'(?<=x64\.)(\d+\.)(\d+\.)(\d+\.)(\d+)').Matches((Get-Childitem .\packages\*WDK.x64* -Name)).Value $build_number=$nuget_package_version.split('.')[2] - $vsix_version = $env:SAMPLES_VSIX_VERSION } # # WDK NuGet will require presence of a folder 'packages'. The version is sourced from repo .\Env-Vars.ps1. @@ -107,16 +105,14 @@ else { exit 1 } # -# Get the vsix version from packages if not set -if (-not $vsix_version) { - $vsix_version = ls "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=*" | Select -ExpandProperty Name - if ($vsix_version) { - $vsix_version = $vsix_version.split('=')[1] - } - else { - Write-Error "No version of the WDK VSIX could be found. The WDK VSIX is not installed." - exit 1 - } +# Get the WDK extension version from installed packages +$wdk_extension_ver = ls "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=*" | Select -ExpandProperty Name +if ($wdk_extension_ver) { + $wdk_extension_ver = $wdk_extension_ver.split('=')[1] +} +else { + Write-Error "No version of the WDK Visual Studio Extension could be found. The WDK Extension is not installed." + exit 1 } # # @@ -183,7 +179,7 @@ $SolutionsTotal = $sampleSet.Count * $Configurations.Count * $Platforms.Count Write-Output ("Build Environment: " + $build_environment) Write-Output ("Build Number: " + $build_number) if (($build_environment -eq "GitHub") -or ($build_environment -eq "NuGet")) { Write-Output ("Nuget Package Version: " + $nuget_package_version) } -Write-Output ("WDK VSIX Version: " + $vsix_version) +Write-Output ("WDK Visual Studio Extension Version: " + $wdk_extension_ver) Write-Output ("Samples: " + $sampleSet.Count) Write-Output ("Configurations: " + $Configurations.Count + " (" + $Configurations + ")") Write-Output ("Platforms: " + $Platforms.Count + " (" + $Platforms + ")") diff --git a/Building-Locally.md b/Building-Locally.md index e3db8dde7..add5c91c9 100644 --- a/Building-Locally.md +++ b/Building-Locally.md @@ -92,7 +92,7 @@ To build the Windows Driver Samples you need a "driver build environment". In e >nuget restore -PackagesDirectory .\packages ``` -* When this is done you should have a .\packages folder that looks exactly as follows: +* When this is done you should have a .\packages folder that looks like example below: ``` >cd path\to\your\repos\Windows-driver-samples >dir /b packages diff --git a/configuration.dsc.yaml b/configuration.dsc.yaml index f8245c080..3d25ff064 100644 --- a/configuration.dsc.yaml +++ b/configuration.dsc.yaml @@ -42,6 +42,7 @@ properties: - Microsoft.VisualStudio.Component.VC.MFC.ARM64 - Microsoft.VisualStudio.Component.VC.MFC.ARM64.Spectre - Microsoft.VisualStudio.Workload.NativeDesktop + - Component.Microsoft.Windows.DriverKit - resource: Microsoft.WinGet.DSC/WinGetPackage id: sdkPackage directives: @@ -62,20 +63,4 @@ properties: id: Microsoft.WindowsWDK.10.0.26100 source: winget useLatest: true - - resource: PSDscResources/Script - id: wdkVsix - dependsOn: - - wdkPackage - - vsComponents - directives: - description: Install Windows Driver Kit VSIX - settings: - GetScript: | - return & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -nologo -version '[17.0,18.0)' -requires Microsoft.Windows.DriverKit -property installationVersion - SetScript: | - $installerPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -nologo -latest -products * -property enginePath | Join-Path -ChildPath 'VSIXInstaller.exe' - if (Test-Path $installerPath) { & $installerPath /q "${env:ProgramFiles(x86)}\Windows Kits\10\Vsix\VS2022\10.0.26100.0\${env:PROCESSOR_ARCHITECTURE}\WDK.vsix" } - TestScript: | - $versionString = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -nologo -version '[17.0,18.0)' -requires Microsoft.Windows.DriverKit -property installationVersion - return $versionString -match "^17\." - configurationVersion: 0.2.0 + configurationVersion: 0.2.1 diff --git a/configuration_vsonly.dsc.yaml b/configuration_vsonly.dsc.yaml index 6ce4fc83c..9d86a4f74 100644 --- a/configuration_vsonly.dsc.yaml +++ b/configuration_vsonly.dsc.yaml @@ -42,4 +42,5 @@ properties: - Microsoft.VisualStudio.Component.VC.MFC.ARM64 - Microsoft.VisualStudio.Component.VC.MFC.ARM64.Spectre - Microsoft.VisualStudio.Workload.NativeDesktop - configurationVersion: 0.2.0 + - Component.Microsoft.Windows.DriverKit + configurationVersion: 0.2.1