diff --git a/Winget-AutoUpdate/Winget-Notify.ps1 b/Winget-AutoUpdate/Winget-Notify.ps1 index e2288e8..6531226 100644 --- a/Winget-AutoUpdate/Winget-Notify.ps1 +++ b/Winget-AutoUpdate/Winget-Notify.ps1 @@ -1,7 +1,8 @@ #Send Notif Script #get xml notif config -[xml]$NotifConf = Get-Content "$env:ProgramData\Winget-AutoUpdate\config\notif.xml" -Encoding UTF8 -ErrorAction SilentlyContinue +$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/Winget-AutoUpdate/functions/Start-NotifTask.ps1 b/Winget-AutoUpdate/functions/Start-NotifTask.ps1 index aae33fc..22c74df 100644 --- a/Winget-AutoUpdate/functions/Start-NotifTask.ps1 +++ b/Winget-AutoUpdate/functions/Start-NotifTask.ps1 @@ -27,7 +27,7 @@ function Start-NotifTask ($Title, $Message, $MessageType, $Balise, $OnClickActio if ($IsSystem) { #Save XML to File - $ToastTemplateLocation = "$env:ProgramData\Winget-AutoUpdate\config\" + $ToastTemplateLocation = "$($WAUConfig.InstallLocation)\config\" if (!(Test-Path $ToastTemplateLocation)) { New-Item -ItemType Directory -Force -Path $ToastTemplateLocation }