mirror of
https://github.com/actions/runner-images.git
synced 2025-12-13 20:56:47 +00:00
[Windows OS] Include Microsoft Game Development Kit (GDK) to image (#4097)
This commit is contained in:
19
images/win/scripts/Installers/Install-GDK.ps1
Normal file
19
images/win/scripts/Installers/Install-GDK.ps1
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
################################################################################
|
||||||
|
## File: Install-GDK.ps1
|
||||||
|
## Desc: Install Microsoft Game Developement Kit
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
# Preparation
|
||||||
|
$tempFolder = Join-Path $env:Tmp "GDK"
|
||||||
|
|
||||||
|
# Fetching Microsoft GDK release version
|
||||||
|
$GDKReleaseVersion = (Invoke-RestMethod -Uri "https://api.github.com/repos/microsoft/GDK/releases/latest").tag_name
|
||||||
|
|
||||||
|
# Cloning GDK repo and checking out to release
|
||||||
|
git clone --depth 1 --branch $GDKReleaseVersion "https://github.com/microsoft/GDK.git" $tempFolder
|
||||||
|
|
||||||
|
# Installing GDK
|
||||||
|
$GDKInstaller = Join-Path $tempFolder "pgdk.exe"
|
||||||
|
Install-Binary -FilePath $GDKInstaller -ArgumentList ("/quiet", "/norestart")
|
||||||
|
|
||||||
|
Invoke-PesterTests -Testfile "Tools" -TestName "Microsoft GDK"
|
||||||
@@ -324,6 +324,13 @@ function Get-PipxVersion {
|
|||||||
return "Pipx $pipxVersion"
|
return "Pipx $pipxVersion"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Get-GDKVersion {
|
||||||
|
$regKey = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
|
||||||
|
$installedApplications = Get-ItemProperty -Path $regKey
|
||||||
|
$GDKRelease = $installedApplications | Where-Object DisplayName -match "Microsoft Game Development Kit"
|
||||||
|
return "$($GDKRelease.DisplayName) $($GDKRelease.DisplayVersion)"
|
||||||
|
}
|
||||||
|
|
||||||
function Build-PackageManagementEnvironmentTable {
|
function Build-PackageManagementEnvironmentTable {
|
||||||
$envVariables = @(
|
$envVariables = @(
|
||||||
@{
|
@{
|
||||||
|
|||||||
@@ -123,6 +123,11 @@ $toolsList = @(
|
|||||||
(Get-ZstdVersion),
|
(Get-ZstdVersion),
|
||||||
(Get-YAMLLintVersion)
|
(Get-YAMLLintVersion)
|
||||||
)
|
)
|
||||||
|
if (Test-IsWin19) {
|
||||||
|
$toolsList += @(
|
||||||
|
(Get-GDKVersion)
|
||||||
|
)
|
||||||
|
}
|
||||||
if ((Test-IsWin16) -or (Test-IsWin19)) {
|
if ((Test-IsWin16) -or (Test-IsWin19)) {
|
||||||
$toolsList += @(
|
$toolsList += @(
|
||||||
(Get-NSISVersion),
|
(Get-NSISVersion),
|
||||||
|
|||||||
@@ -91,6 +91,12 @@ Describe "Mingw64" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Describe "Microsoft GDK" -Skip:(-not (Test-IsWin19)) {
|
||||||
|
It "GDK" {
|
||||||
|
"$($env:GRDKLatest)grdk.ini" | Should -Exist
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Describe "GoogleCloudSDK" -Skip:(Test-IsWin22) {
|
Describe "GoogleCloudSDK" -Skip:(Test-IsWin22) {
|
||||||
It "<ToolName>" -TestCases @(
|
It "<ToolName>" -TestCases @(
|
||||||
@{ ToolName = "bq" }
|
@{ ToolName = "bq" }
|
||||||
|
|||||||
@@ -252,6 +252,7 @@
|
|||||||
"{{ template_dir }}/scripts/Installers/Install-GoogleCloudSDK.ps1",
|
"{{ template_dir }}/scripts/Installers/Install-GoogleCloudSDK.ps1",
|
||||||
"{{ template_dir }}/scripts/Installers/Install-CodeQLBundle.ps1",
|
"{{ template_dir }}/scripts/Installers/Install-CodeQLBundle.ps1",
|
||||||
"{{ template_dir }}/scripts/Installers/Install-BizTalkBuildComponent.ps1",
|
"{{ template_dir }}/scripts/Installers/Install-BizTalkBuildComponent.ps1",
|
||||||
|
"{{ template_dir }}/scripts/Installers/Install-GDK.ps1",
|
||||||
"{{ template_dir }}/scripts/Installers/Disable-JITDebugger.ps1",
|
"{{ template_dir }}/scripts/Installers/Disable-JITDebugger.ps1",
|
||||||
"{{ template_dir }}/scripts/Installers/Configure-DynamicPort.ps1",
|
"{{ template_dir }}/scripts/Installers/Configure-DynamicPort.ps1",
|
||||||
"{{ template_dir }}/scripts/Installers/Configure-GDIProcessHandleQuota.ps1",
|
"{{ template_dir }}/scripts/Installers/Configure-GDIProcessHandleQuota.ps1",
|
||||||
|
|||||||
Reference in New Issue
Block a user