Skip to content

Commit

Permalink
Merge pull request Romanitho#443 from Romanitho/ServiceUI-quickfix
Browse files Browse the repository at this point in the history
ServiceUI Quick fix
  • Loading branch information
Romanitho authored Oct 21, 2023
2 parents bd237e0 + 864f95d commit 511ff26
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Winget-AutoUpdate/functions/Update-WAU.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ function Update-WAU {
#Update scritps
Write-ToLog "Updating WAU..." "Yellow"
$TempPath = (Resolve-Path "$location\Winget-AutoUpdate\")[0].Path
if ($TempPath) {
$ServiceUI = Test-Path "$WorkingDir\ServiceUI.exe"
if ($TempPath -and $ServiceUI) {
#Do not copy ServiceUI if already existing, causing error if in use.
Copy-Item -Path "$TempPath\*" -Destination "$WorkingDir\" -Exclude ("icons", "ServiceUI.exe") -Recurse -Force
}
elseif ($TempPath) {
Copy-Item -Path "$TempPath\*" -Destination "$WorkingDir\" -Exclude "icons" -Recurse -Force
}

Expand All @@ -55,7 +60,7 @@ function Update-WAU {

#Rerun with newer version
Write-ToLog "Re-run WAU"
Start-Process powershell -ArgumentList "-NoProfile -ExecutionPolicy Bypass -Command `"$WorkingDir\winget-upgrade.ps1`""
Start-Process powershell -ArgumentList "-NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -Command `"$WorkingDir\winget-upgrade.ps1`""

exit

Expand Down

0 comments on commit 511ff26

Please sign in to comment.