Skip to content

Commit

Permalink
Merge pull request #756 from Romanitho/fix-visual
Browse files Browse the repository at this point in the history
Fixes pre-installed visual c++ 2022
  • Loading branch information
Romanitho authored Nov 5, 2024
2 parents 773579f + a3ddc7d commit 58cca62
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Winget-AutoUpdate/functions/Install-Prerequisites.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 58cca62

Please sign in to comment.