diff --git a/images/win/scripts/Installers/Install-VCRedist.ps1 b/images/win/scripts/Installers/Install-VCRedist.ps1 index 0defd5090..473fed3a2 100644 --- a/images/win/scripts/Installers/Install-VCRedist.ps1 +++ b/images/win/scripts/Installers/Install-VCRedist.ps1 @@ -12,4 +12,6 @@ if (Test-IsWin19) { $ArgumentList = ("/install", "/quiet", "/norestart") Install-Binary -Url $Vc2010x86URI -Name $Vc2010x86Name -ArgumentList $ArgumentList Install-Binary -Url $Vc2010x64URI -Name $Vc2010x64Name -ArgumentList $ArgumentList -} \ No newline at end of file +} + +Invoke-PesterTests -TestFile "Tools" -TestName "VCRedist" diff --git a/images/win/scripts/Tests/Tools.Tests.ps1 b/images/win/scripts/Tests/Tools.Tests.ps1 index c45660e00..3eb532258 100644 --- a/images/win/scripts/Tests/Tools.Tests.ps1 +++ b/images/win/scripts/Tests/Tools.Tests.ps1 @@ -165,6 +165,22 @@ Describe "Vcpkg" { } } +Describe "VCRedist" -Skip:(Test-IsWin22) { + It "vcredist_140" -Skip:(Test-IsWin19) { + "C:\Windows\System32\vcruntime140.dll" | Should -Exist + } + + It "vcredist_2010_x64" -Skip:(Test-IsWin16) { + "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1D8E6291-B0D5-35EC-8441-6616F567A0F7}" | Should -Exist + "C:\Windows\System32\msvcr100.dll" | Should -Exist + } + + It "vcredist_2010_x64" -Skip:(Test-IsWin16) { + "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1D8E6291-B0D5-35EC-8441-6616F567A0F7}" | Should -Exist + "C:\Windows\System32\msvcr100.dll" | Should -Exist + } +} + Describe "WebPlatformInstaller" -Skip:(Test-IsWin22) { It "WebPlatformInstaller" { "WebPICMD" | Should -ReturnZeroExitCode diff --git a/images/win/windows2019.json b/images/win/windows2019.json index af3c1ea91..fe47fea33 100644 --- a/images/win/windows2019.json +++ b/images/win/windows2019.json @@ -143,6 +143,8 @@ }, { "type": "windows-restart", + "check_registry": true, + "restart_check_command": "powershell -command \"& {if (-not (Get-Process TiWorker.exe -ErrorAction SilentlyContinue)) { Write-Output 'Restart complete' }}\"", "restart_timeout": "30m" }, { diff --git a/images/win/windows2022.json b/images/win/windows2022.json index 2c92c3923..d35c0c637 100644 --- a/images/win/windows2022.json +++ b/images/win/windows2022.json @@ -144,7 +144,6 @@ { "type": "powershell", "scripts": [ - "{{ template_dir }}/scripts/Installers/Install-VCRedist.ps1", "{{ template_dir }}/scripts/Installers/Install-Docker.ps1", "{{ template_dir }}/scripts/Installers/Install-PowershellCore.ps1" ]