Merge pull request #443 from Romanitho/ServiceUI-quickfix

ServiceUI Quick fix
pull/444/head
Romain 2023-10-21 23:01:37 +02:00 committed by GitHub
commit 511ff260a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -31,7 +31,12 @@ function Update-WAU {
#Update scritps #Update scritps
Write-ToLog "Updating WAU..." "Yellow" Write-ToLog "Updating WAU..." "Yellow"
$TempPath = (Resolve-Path "$location\Winget-AutoUpdate\")[0].Path $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 Copy-Item -Path "$TempPath\*" -Destination "$WorkingDir\" -Exclude "icons" -Recurse -Force
} }
@ -55,7 +60,7 @@ function Update-WAU {
#Rerun with newer version #Rerun with newer version
Write-ToLog "Re-run WAU" 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 exit