Merge pull request #20 from Romanitho/Romanitho-patch-1

Fixed issue
pull/21/head v1.5.1
Romain 2022-03-07 03:28:39 +01:00 committed by GitHub
commit 50399cd84e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -268,7 +268,7 @@ function Update-WAU{
#Send available update notification
$Title = $NotifLocale.local.outputs.output[2].title -f "Winget-AutoUpdate"
$Message = $NotifLocale.local.outputs.output[2].message -f $CurrentVersion, $LatestVersion
$Message = $NotifLocale.local.outputs.output[2].message -f $CurrentVersion, $LatestVersion.Replace("v","")
$MessageType = "info"
$Balise = "Winget-AutoUpdate"
Start-NotifTask $Title $Message $MessageType $Balise
@ -281,7 +281,7 @@ function Update-WAU{
#Download the zip
Write-Log "Starting downloading the GitHub Repository"
Invoke-RestMethod -Uri "$($WAUurl)/zipball/$($LatestVersion)" -OutFile $ZipFile
Invoke-RestMethod -Uri "https://api.github.com/repos/Romanitho/Winget-AutoUpdate/zipball/$($LatestVersion)" -OutFile $ZipFile
Write-Log 'Download finished'
#Extract Zip File
@ -290,8 +290,8 @@ function Update-WAU{
Expand-Archive -Path $ZipFile -DestinationPath $location -Force
Get-ChildItem -Path $location -Recurse | Unblock-File
Write-Log "Unzip finished"
$TempPath = Resolve-Path "$location\Romanitho-Winget-AutoUpdate*\Winget-AutoUpdate\"
Copy-Item -Path "$TempPath\*" -Destination ".\" -Recurse -Force
$TempPath = (Resolve-Path "$location\Romanitho-Winget-AutoUpdate*\Winget-AutoUpdate\").Path
Copy-Item -Path "$TempPath\*" -Destination "$WorkingDir\" -Recurse -Force
#Remove update zip file
Write-Log "Cleaning temp files"