diff --git a/Sources/WAU/Gui.ps1 b/Sources/WAU/Gui.ps1 index 3f46dfe..a521f2a 100644 --- a/Sources/WAU/Gui.ps1 +++ b/Sources/WAU/Gui.ps1 @@ -204,7 +204,7 @@ function Start-Installations { #Run Winget-Install script if box is checked if ($AppToInstall) { Start-PopUp "Installing applications..." - $WAUInstallPath = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Romanitho\Winget-AutoUpdate\" -Name InstallLocation + $WAUInstallPath = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate\" -Name InstallLocation #Try with admin rights. try { @@ -275,7 +275,7 @@ function Start-Uninstallations ($AppToUninstall) { } function Get-WAUInstallStatus { - $WAUVersion = Get-ItemProperty -Path HKLM:\SOFTWARE\Romanitho\Winget-AutoUpdate\ -ErrorAction SilentlyContinue | Select-Object -ExpandProperty DisplayVersion -ErrorAction SilentlyContinue + $WAUVersion = Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate\ -ErrorAction SilentlyContinue | Select-Object -ExpandProperty DisplayVersion -ErrorAction SilentlyContinue if ($WAUVersion -eq $WAUConfiguratorVersion) { $WAULabelText = "WAU is currently installed (v$WAUVersion)." $WAUStatus = "Green" @@ -577,7 +577,7 @@ function Start-InstallGUI { $UninstallWAUButton.add_click( { #Uninstall WAU from registry command - $Arguments = Get-ItemPropertyValue "HKLM:\SOFTWARE\Romanitho\Winget-AutoUpdate" -Name "UninstallString" + $Arguments = Get-ItemPropertyValue "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate" -Name "UninstallString" Start-Process "cmd.exe" -ArgumentList "/c $Arguments" -Wait -Verb RunAs $WAUInstallStatus = Get-WAUInstallStatus $WAUStatusLabel.Text = $WAUInstallStatus[0] @@ -699,7 +699,7 @@ function Start-InstallGUI { $LogButton.add_click( { try { - $LogPath = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Romanitho\Winget-AutoUpdate\" -Name InstallLocatifon + $LogPath = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate\" -Name InstallLocatifon Start-Process "$LogPath\Logs" } catch { diff --git a/Sources/WAU/Winget-AutoUpdate-Install.ps1 b/Sources/WAU/Winget-AutoUpdate-Install.ps1 index a115b88..c1d3620 100644 --- a/Sources/WAU/Winget-AutoUpdate-Install.ps1 +++ b/Sources/WAU/Winget-AutoUpdate-Install.ps1 @@ -361,7 +361,7 @@ function Uninstall-WingetAutoUpdate { Write-ToLog "Uninstalling WAU started!" "Yellow" #Get registry install location - $InstallLocation = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Romanitho\Winget-AutoUpdate\" -Name InstallLocation -ErrorAction SilentlyContinue + $InstallLocation = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate\" -Name InstallLocation -ErrorAction SilentlyContinue #Check if installed location exists and delete if ($InstallLocation) { @@ -383,7 +383,7 @@ function Uninstall-WingetAutoUpdate { Get-ChildItem -Path $InstallLocation -Exclude *.txt, mods, logs | Remove-Item -Recurse -Force } & reg delete "HKCR\AppUserModelId\Windows.SystemToast.Winget.Notification" /f | Out-Null - & reg delete "HKLM\SOFTWARE\Romanitho\Winget-AutoUpdate" /f | Out-Null + & reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate" /f | Out-Null if ((Test-Path "${env:ProgramData}\Microsoft\Windows\Start Menu\Programs\Winget-AutoUpdate (WAU)")) { Remove-Item -Path "${env:ProgramData}\Microsoft\Windows\Start Menu\Programs\Winget-AutoUpdate (WAU)" -Recurse -Force | Out-Null @@ -488,7 +488,7 @@ Write-Host "`t https://github.com/Romanitho/Winget-AutoUpdate`n" -Foreground Write-Host "`t________________________________________________________`n" #Define WAU registry key -$Script:regPath = "HKLM:\SOFTWARE\Romanitho\Winget-AutoUpdate" +$Script:regPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate" if (!$Uninstall) { Write-ToLog " INSTALLING WAU" -LogColor "Cyan" -IsHeader diff --git a/Sources/WAU/Winget-AutoUpdate/WAU-Policies.ps1 b/Sources/WAU/Winget-AutoUpdate/WAU-Policies.ps1 index e717d57..da104c9 100644 --- a/Sources/WAU/Winget-AutoUpdate/WAU-Policies.ps1 +++ b/Sources/WAU/Winget-AutoUpdate/WAU-Policies.ps1 @@ -14,7 +14,7 @@ Daily update settings from policies $ActivateGPOManagement = Get-ItemPropertyValue "HKLM:\SOFTWARE\Policies\Romanitho\Winget-AutoUpdate" -Name "WAU_ActivateGPOManagement" -ErrorAction SilentlyContinue if ($ActivateGPOManagement -eq 1) { #Add (or update) tag to activate WAU-Policies Management - New-ItemProperty "HKLM:\SOFTWARE\Romanitho\Winget-AutoUpdate" -Name WAU_RunGPOManagement -Value 1 -Force | Out-Null + New-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate" -Name WAU_RunGPOManagement -Value 1 -Force | Out-Null } #Get WAU settings @@ -32,7 +32,7 @@ if ($WAUConfig.WAU_RunGPOManagement -eq 1) { Add-Content -Path $GPOLogFile -Value "GPO Management Enabled. Policies updated." } else { - New-ItemProperty "HKLM:\SOFTWARE\Romanitho\Winget-AutoUpdate" -Name WAU_RunGPOManagement -Value 0 -Force | Out-Null + New-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate" -Name WAU_RunGPOManagement -Value 0 -Force | Out-Null $WAUConfig.WAU_RunGPOManagement = 0 Add-Content -Path $GPOLogFile -Value "GPO Management Disabled. Policies removed." } diff --git a/Sources/WAU/Winget-AutoUpdate/WAU-Uninstall.ps1 b/Sources/WAU/Winget-AutoUpdate/WAU-Uninstall.ps1 index a518bc2..5003189 100644 --- a/Sources/WAU/Winget-AutoUpdate/WAU-Uninstall.ps1 +++ b/Sources/WAU/Winget-AutoUpdate/WAU-Uninstall.ps1 @@ -35,7 +35,7 @@ Write-Host "`t________________________________________________________`n`n" try { Write-host "Uninstalling WAU..." -ForegroundColor Yellow #Get registry install location - $InstallLocation = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Romanitho\Winget-AutoUpdate\" -Name InstallLocation + $InstallLocation = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate\" -Name InstallLocation #Check if installed location exists and delete if (Test-Path ($InstallLocation)) { @@ -52,7 +52,7 @@ try { Get-ScheduledTask -TaskName "Winget-AutoUpdate-UserContext" -ErrorAction SilentlyContinue | Unregister-ScheduledTask -Confirm:$False Get-ScheduledTask -TaskName "Winget-AutoUpdate-Policies" -ErrorAction SilentlyContinue | Unregister-ScheduledTask -Confirm:$False & reg delete "HKCR\AppUserModelId\Windows.SystemToast.Winget.Notification" /f | Out-Null - & reg delete "HKLM\SOFTWARE\Romanitho\Winget-AutoUpdate" /f | Out-Null + & reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate" /f | Out-Null if (Test-Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate") { & reg delete "HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate" /f | Out-Null } diff --git a/Sources/WAU/Winget-AutoUpdate/Winget-Install.ps1 b/Sources/WAU/Winget-AutoUpdate/Winget-Install.ps1 index 74fb768..ec24e6f 100644 --- a/Sources/WAU/Winget-AutoUpdate/Winget-Install.ps1 +++ b/Sources/WAU/Winget-AutoUpdate/Winget-Install.ps1 @@ -311,7 +311,7 @@ $CurrentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Pri $Script:IsElevated = $CurrentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) #Get WAU Installed location -$WAURegKey = "HKLM:\SOFTWARE\Romanitho\Winget-AutoUpdate\" +$WAURegKey = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate\" $Script:WAUInstallLocation = Get-ItemProperty $WAURegKey -ErrorAction SilentlyContinue | Select-Object -ExpandProperty InstallLocation #LogPath initialisation diff --git a/Sources/WAU/Winget-AutoUpdate/Winget-Notify.ps1 b/Sources/WAU/Winget-AutoUpdate/Winget-Notify.ps1 index 943d529..de22ef7 100644 --- a/Sources/WAU/Winget-AutoUpdate/Winget-Notify.ps1 +++ b/Sources/WAU/Winget-AutoUpdate/Winget-Notify.ps1 @@ -1,7 +1,7 @@ #Send Notify Script #get xml notif config -$WAUinstalledPath = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Romanitho\Winget-AutoUpdate\" -Name InstallLocation +$WAUinstalledPath = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate\" -Name InstallLocation [xml]$NotifConf = Get-Content "$WAUinstalledPath\config\notif.xml" -Encoding UTF8 -ErrorAction SilentlyContinue if (!($NotifConf)) { break diff --git a/Sources/WAU/Winget-AutoUpdate/functions/Get-WAUConfig.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Get-WAUConfig.ps1 index 5c371e0..6f9855c 100644 --- a/Sources/WAU/Winget-AutoUpdate/functions/Get-WAUConfig.ps1 +++ b/Sources/WAU/Winget-AutoUpdate/functions/Get-WAUConfig.ps1 @@ -3,7 +3,7 @@ Function Get-WAUConfig { #Get WAU Configurations from install config - $WAUConfig = Get-ItemProperty -Path "HKLM:\SOFTWARE\Romanitho\Winget-AutoUpdate" -ErrorAction SilentlyContinue + $WAUConfig = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate" -ErrorAction SilentlyContinue #Check if GPO Management is enabled $ActivateGPOManagement = Get-ItemPropertyValue "HKLM:\SOFTWARE\Policies\Romanitho\Winget-AutoUpdate" -Name "WAU_ActivateGPOManagement" -ErrorAction SilentlyContinue diff --git a/Sources/WAU/Winget-AutoUpdate/functions/Invoke-PostUpdateActions.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Invoke-PostUpdateActions.ps1 index f28d76c..fa3db58 100644 --- a/Sources/WAU/Winget-AutoUpdate/functions/Invoke-PostUpdateActions.ps1 +++ b/Sources/WAU/Winget-AutoUpdate/functions/Invoke-PostUpdateActions.ps1 @@ -9,7 +9,7 @@ function Invoke-PostUpdateActions { $null = Update-WinGet #Create WAU Regkey if not present - $regPath = "HKLM:\SOFTWARE\Romanitho\Winget-AutoUpdate" + $regPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate" if (!(test-path $regPath)) { New-Item $regPath -Force New-ItemProperty $regPath -Name DisplayName -Value "Winget-AutoUpdate (WAU)" -Force @@ -113,8 +113,8 @@ function Invoke-PostUpdateActions { } #Remove old registry key - Remove-ItemProperty -Path "HKLM:\SOFTWARE\Romanitho\Winget-AutoUpdate" -Name "VersionMajor" -ErrorAction SilentlyContinue - Remove-ItemProperty -Path "HKLM:\SOFTWARE\Romanitho\Winget-AutoUpdate" -Name "VersionMinor" -ErrorAction SilentlyContinue + Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate" -Name "VersionMajor" -ErrorAction SilentlyContinue + Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate" -Name "VersionMinor" -ErrorAction SilentlyContinue Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Romanitho\Winget-AutoUpdate" -Name "VersionMajor" -ErrorAction SilentlyContinue Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Romanitho\Winget-AutoUpdate" -Name "VersionMinor" -ErrorAction SilentlyContinue Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Romanitho\Winget-AutoUpdate" -Name "DisplayVersion" -ErrorAction SilentlyContinue @@ -143,24 +143,11 @@ function Invoke-PostUpdateActions { Write-ToLog "-> Policies task created." } - #Migrate registry to new location (MSI Prerequisites) - $sourcePath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate" - $destinationPath = "HKLM:\SOFTWARE\Romanitho\Winget-AutoUpdate" - if (-not (Test-Path (Split-Path $destinationPath))) { - New-Item -Path (Split-Path $destinationPath) -ItemType Directory - } - try { - Move-Item -Path $sourcePath -Destination $destinationPath -Force - Write-ToLog "-> Migrated registry from $sourcePath to $destinationPath." - } - catch { - Write-ToLog "-> Failed tro migrate registry to new location" - } ### End of post update actions ### #Reset WAU_UpdatePostActions Value - New-ItemProperty -Path "HKLM:\SOFTWARE\Romanitho\Winget-AutoUpdate" -Name "WAU_PostUpdateActions" -Value 0 -Force | Out-Null + New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate" -Name "WAU_PostUpdateActions" -Value 0 -Force | Out-Null #Get updated WAU Config $Script:WAUConfig = Get-WAUConfig diff --git a/Sources/WAU/Winget-AutoUpdate/functions/Update-WAU.ps1 b/Sources/WAU/Winget-AutoUpdate/functions/Update-WAU.ps1 index 6c32bef..4e4725f 100644 --- a/Sources/WAU/Winget-AutoUpdate/functions/Update-WAU.ps1 +++ b/Sources/WAU/Winget-AutoUpdate/functions/Update-WAU.ps1 @@ -46,10 +46,10 @@ function Update-WAU { Remove-Item -Path $location -Recurse -Force -ErrorAction SilentlyContinue #Set new version to registry - New-ItemProperty -Path "HKLM:\SOFTWARE\Romanitho\Winget-AutoUpdate" -Name "DisplayVersion" -Value $WAUAvailableVersion -Force | Out-Null + New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate" -Name "DisplayVersion" -Value $WAUAvailableVersion -Force | Out-Null #Set Post Update actions to 1 - New-ItemProperty -Path "HKLM:\SOFTWARE\Romanitho\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 #Send success Notif Write-ToLog "WAU Update completed." "Green" diff --git a/Sources/WAU/Winget-AutoUpdate/mods/_AppID-template.ps1 b/Sources/WAU/Winget-AutoUpdate/mods/_AppID-template.ps1 index c771856..85b09b7 100644 --- a/Sources/WAU/Winget-AutoUpdate/mods/_AppID-template.ps1 +++ b/Sources/WAU/Winget-AutoUpdate/mods/_AppID-template.ps1 @@ -35,7 +35,7 @@ $AllVersions = $False $Lnk = @("") #Registry _value_ (DWord/String) to add in existing registry Key (Key created if not existing). Example: -#$AddKey = "HKLM:\SOFTWARE\Romanitho\Winget-AutoUpdate" +#$AddKey = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate" #$AddValue = "WAU_BypassListForUsers" #$AddTypeData = "1" #$AddType = "DWord" @@ -46,7 +46,7 @@ $AddType = "" #Registry _value_ to delete in existing registry Key. #Value can be omitted for deleting entire Key!. Example: -#$DelKey = "HKLM:\SOFTWARE\Romanitho\Winget-AutoUpdate" +#$DelKey = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate" #$DelValue = "WAU_BypassListForUsers" $DelKey = "" $DelValue = ""