From 1f66d5fb55fda01477fd3292d090fbea846a0b1c Mon Sep 17 00:00:00 2001 From: Romain <96626929+Romanitho@users.noreply.github.com> Date: Sun, 20 Feb 2022 22:52:10 +0100 Subject: [PATCH] Change MS Visual C++ detection --- Winget-AutoUpdate-Install.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Winget-AutoUpdate-Install.ps1 b/Winget-AutoUpdate-Install.ps1 index 3dc9661..94388ce 100644 --- a/Winget-AutoUpdate-Install.ps1 +++ b/Winget-AutoUpdate-Install.ps1 @@ -33,7 +33,7 @@ param( function Check-Prerequisites{ #Check if Visual C++ 2019 installed $app = "Microsoft Visual C++*2019*" - $path = Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall | Get-ItemProperty | Where-Object {$_.DisplayName -like $app } | Select-Object -Property Displayname, DisplayVersion + $path = Get-Item HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Where-Object { $_.GetValue("DisplayName") -like $app} #If not installed, ask for installation if (!($path)){ @@ -173,4 +173,4 @@ Check-Prerequisites Install-WingetAutoUpdate Write-host "End of process." -Start-Sleep 3 \ No newline at end of file +Start-Sleep 3