summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorMatt <[email protected]>2024-06-25 10:51:36 -0700
committerGitHub <[email protected]>2024-06-25 10:51:36 -0700
commit6dabe4ef5fa80d5a565705edeb6a0dcb98b30f80 (patch)
tree6ae31a10deae14d52fd297c9530e0d3800959638 /.github
parente59949f40da211f378e8f76bee383506d9b97243 (diff)
Improve version info, vsix installation, and update building locally readme
Diffstat (limited to '.github')
-rw-r--r--.github/scripts/Install-Vsix.ps140
1 files changed, 24 insertions, 16 deletions
diff --git a/.github/scripts/Install-Vsix.ps1 b/.github/scripts/Install-Vsix.ps1
index 24c7ef45..8579b36b 100644
--- a/.github/scripts/Install-Vsix.ps1
+++ b/.github/scripts/Install-Vsix.ps1
@@ -12,34 +12,42 @@ param(
$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
-}
+# launch developer powershell
+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
+
+# Automatically resolve the latest amd64 VSIX
+$uri = "https://marketplace.visualstudio.com$((Invoke-WebRequest -Uri "https://marketplace.visualstudio.com/items?itemName=DriverDeveloperKits-WDK.WDKVsix").Links | Where-Object outerHTML -like '*(amd64)*' | select -expand href)"
-# source environment variables
-. .\Env-Vars.ps1
+# Set local version variable
+$version = ([regex]'(\d+\.)(\d+\.)(\d+\.)(\d+)').Matches($uri).Value
-$version = $env:SAMPLES_VSIX_VERSION
-$uri = $env:SAMPLES_VSIX_URI
+# Set github environment variable for vsix version
+"SAMPLES_VSIX_VERSION=$version" | Out-File -FilePath "$env:GITHUB_ENV" -Append
function PrintWdkVsix {
- $installed = ls "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=*" | Select -ExpandProperty Name
- "WDK Vsix Version: $installed"
+ "WDK Vsix Version: $(ls "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=*" | Select -ExpandProperty Name)"
}
function TestWdkVsix {
Test-Path "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=$version"
}
+# NOTE: The '$optimize' code path examines the '.vsixmanifest' when downloaded and then examines it again (in the 'MSBuild' directory) once
+# the necessary extension files are copied.
if ($optimize) {
- "---> Downloading vsix and configuring build environment..."
+ $msbuild_path = (Resolve-Path "$env:ProgramFiles\Microsoft Visual Studio\2022\*\MSBuild\")
+ "---> Downloading vsix version: $version"
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"
+ "Downloaded VSIX Version: $(([xml](Get-Content .\extension.vsixmanifest)).PackageManifest.Metadata.Identity.Version)"
+ "<--- Download complete"
+ "---> Configuring build environment..."
+ cp ".\`$MSBuild\*" "$msbuild_path" -Recurse -Force
+ cp ".\extension.vsixmanifest" "$msbuild_path"
+ "Installed VSIX Version: $(([xml](Get-Content ${msbuild_path}\extension.vsixmanifest)).PackageManifest.Metadata.Identity.Version)"
+ "<--- Configuration complete"
}
else {
"Getting installed WDK vsix..."
@@ -65,4 +73,4 @@ else {
exit 1
}
}
-} \ No newline at end of file
+}