From dbfa68ac8e0f716e6081ee8d77ab39612023b5e5 Mon Sep 17 00:00:00 2001 From: Romain <96626929+Romanitho@users.noreply.github.com> Date: Sun, 23 Oct 2022 23:36:15 +0200 Subject: [PATCH] Fix notif --- Winget-AutoUpdate/Winget-Notify.ps1 | 3 ++- Winget-AutoUpdate/functions/Start-NotifTask.ps1 | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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 }