Merge pull request #756 from Romanitho/fix-visual

Fixes pre-installed visual c++ 2022
pull/757/head v2.0.3-n
Romain 2024-11-05 17:31:45 +01:00 committed by GitHub
commit 58cca62d04
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -5,9 +5,9 @@ function Install-Prerequisites {
Write-ToLog "Checking prerequisites..." "Yellow"
#Check if Visual C++ 2019 or 2022 installed
$Visual2019 = "Microsoft Visual C++ 2015-2019 Redistributable*"
$Visual2022 = "Microsoft Visual C++ 2015-2022 Redistributable*"
$path = Get-Item HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Where-Object { $_.GetValue("DisplayName") -like $Visual2019 -or $_.GetValue("DisplayName") -like $Visual2022 }
$VisualMinVer = "14.40.0.0"
$path = Get-Item HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Where-Object { $_.GetValue("DisplayName") -like $Visual2022 -and $_.GetValue("DisplayVersion") -gt $VisualMinVer }
if (!($path)) {
try {
Write-ToLog "MS Visual C++ 2015-2022 is not installed" "Red"