Update Update-WAU.ps1
parent
a2bc01d298
commit
6264a259af
|
@ -96,13 +96,16 @@ function Update-WAU {
|
||||||
Copy-Item -Path "$TempPath\*" -Destination "$WorkingDir\" -Exclude "icons" -Recurse -Force
|
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
|
#Remove update zip file and update temp folder
|
||||||
Write-ToLog "Done. Cleaning temp files..." "Cyan"
|
Write-ToLog "Done. Cleaning temp files..." "Cyan"
|
||||||
Remove-Item -Path $ZipFile -Force -ErrorAction SilentlyContinue
|
Remove-Item -Path $ZipFile -Force -ErrorAction SilentlyContinue
|
||||||
Remove-Item -Path $location -Recurse -Force -ErrorAction SilentlyContinue
|
Remove-Item -Path $location -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
|
|
||||||
#Set new version to registry
|
#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
|
#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
|
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate" -Name "WAU_PostUpdateActions" -Value 1 -Force | Out-Null
|
||||||
|
|
Loading…
Reference in New Issue