From 066913e6baab270f536820589ffdc74055542ce8 Mon Sep 17 00:00:00 2001 From: Romain <96626929+Romanitho@users.noreply.github.com> Date: Mon, 30 Sep 2024 16:46:05 +0200 Subject: [PATCH] Fix missing settings during MSI update settings migration --- Sources/Winget-AutoUpdate/functions/Update-WAU.ps1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Sources/Winget-AutoUpdate/functions/Update-WAU.ps1 b/Sources/Winget-AutoUpdate/functions/Update-WAU.ps1 index e39dfc9..a0e5fbd 100644 --- a/Sources/Winget-AutoUpdate/functions/Update-WAU.ps1 +++ b/Sources/Winget-AutoUpdate/functions/Update-WAU.ps1 @@ -29,6 +29,11 @@ function Update-WAU { New-Item -Path $destinationPath -ItemType Directory -Force Write-ToLog "New registry key created." } + #Create missing default values + Set-ItemProperty -Path $destinationPath -Name "WAU_DoNotRunOnMetered" -Value 1 -Type Dword + Write-ToLog "WAU_DoNotRunOnMetered created. Value: 1" + Set-ItemProperty -Path $destinationPath -Name "WAU_UpdatesAtLogon" -Value 0 -Type Dword + Write-ToLog "WAU_UpdatesAtLogon created. Value 0" #Retrieve the properties of the source key $properties = Get-ItemProperty -Path $sourcePath foreach ($property in $properties.PSObject.Properties) { @@ -36,7 +41,7 @@ function Update-WAU { if ($property.Name -like "WAU_*" -and $property.Name -notlike "WAU_PostUpdateActions*") { #Copy the value to the destination key Set-ItemProperty -Path $destinationPath -Name $property.Name -Value $property.Value - Write-ToLog "$($property.Name) saved." + Write-ToLog "$($property.Name) saved. Value: $($property.Value)" } }