Skip to content

Commit

Permalink
Merge pull request #40 from Romanitho/fix
Browse files Browse the repository at this point in the history
Fix multiple Winget version cases
  • Loading branch information
Romanitho authored Apr 7, 2022
2 parents 41b61bd + e352be6 commit 06f2cc0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Winget-AutoUpdate/config/about.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<app>
<name>Winget-AutoUpdate (WAU)</name>
<version>1.7.0</version>
<version>1.7.1</version>
<author>Romanitho</author>
<info>https://github.com/Romanitho/Winget-AutoUpdate</info>
</app>
</app>
9 changes: 7 additions & 2 deletions Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ function Get-WingetOutdatedApps {
[string]$AvailableVersion
}

#Get WinGet Path
$WingetPath = (Resolve-Path "C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe").Path
#Get WinGet Path (if admin context)
$ResolveWingetPath = Resolve-Path "C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe"
if ($ResolveWingetPath){
#If multiple version, pick last one
$WingetPath = $ResolveWingetPath[-1].Path
}

#Get Winget Location in User context
if ($WingetCmd){
$Script:Winget = (Get-Command winget.exe -ErrorAction SilentlyContinue).Source
Expand Down

0 comments on commit 06f2cc0

Please sign in to comment.