Skip to content

Commit ae85b14

Browse files
authored
Hard coded notification xml file path
1 parent 7104088 commit ae85b14

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

winget-update/winget-notify.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#Send Notif Script
22

33
#get xml notif config
4-
[xml]$NotifConf = Get-Content "$PSScriptRoot\notif.xml" -Encoding UTF8 -ErrorAction SilentlyContinue
4+
[xml]$NotifConf = Get-Content "C:\ProgramData\winget-update\notif.xml" -Encoding UTF8 -ErrorAction SilentlyContinue
55
if (!($NotifConf)) {break}
66

77
#Load Assemblies

winget-update/winget-upgrade.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@ function Start-NotifTask ($Title,$Message,$MessageType,$Balise) {
5959
"@
6060

6161
#Save XML File
62-
$ToastTemplate.Save("$WorkingDir\notif.xml")
62+
$ToastTemplateLocation = "C:\ProgramData\winget-update\"
63+
if (!(Test-Path $ToastTemplateLocation)){
64+
New-Item -ItemType Directory -Force -Path $ToastTemplateLocation
65+
}
66+
$ToastTemplate.Save("$ToastTemplateLocation\notif.xml")
6367

6468
#Send Notification to user
6569
Get-ScheduledTask -TaskName "Winget Update Notify" -ErrorAction SilentlyContinue | Start-ScheduledTask -ErrorAction SilentlyContinue

0 commit comments

Comments
 (0)