Skip to content

Commit

Permalink
Merge pull request #708 from Romanitho/version
Browse files Browse the repository at this point in the history
Review version reporting in registry for v1
  • Loading branch information
Romanitho authored Sep 19, 2024
2 parents a2bc01d + 6264a25 commit 3bc95db
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Sources/Winget-AutoUpdate/functions/Update-WAU.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,16 @@ function Update-WAU {
Copy-Item -Path "$TempPath\*" -Destination "$WorkingDir\" -Exclude "icons" -Recurse -Force
}

#Get installed version
$InstalledVersion = Get-Content "$TempPath\Version.txt"

#Remove update zip file and update temp folder
Write-ToLog "Done. Cleaning temp files..." "Cyan"
Remove-Item -Path $ZipFile -Force -ErrorAction SilentlyContinue
Remove-Item -Path $location -Recurse -Force -ErrorAction SilentlyContinue

#Set new version to registry
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate" -Name "DisplayVersion" -Value $WAUAvailableVersion -Force | Out-Null
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate" -Name "DisplayVersion" -Value $InstalledVersion -Force | Out-Null

#Set Post Update actions to 1
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate" -Name "WAU_PostUpdateActions" -Value 1 -Force | Out-Null
Expand Down

0 comments on commit 3bc95db

Please sign in to comment.