From 8684270f464eed5763857f678deae22e89f38a26 Mon Sep 17 00:00:00 2001 From: Romain <96626929+Romanitho@users.noreply.github.com> Date: Mon, 7 Oct 2024 12:22:54 +0200 Subject: [PATCH] Shortcuts are MSI managed now. --- Sources/Policies/ADMX/WAU.admx | 2 +- Sources/Policies/ADMX/en-US/WAU.adml | 10 ++++----- Sources/Policies/ADMX/fr-FR/WAU.adml | 4 ++-- Sources/Winget-AutoUpdate/WAU-Policies.ps1 | 21 ------------------- .../config/WAU-MSI_Actions.ps1 | 2 +- 5 files changed, 9 insertions(+), 30 deletions(-) diff --git a/Sources/Policies/ADMX/WAU.admx b/Sources/Policies/ADMX/WAU.admx index 3106d8bd..79e515cd 100644 --- a/Sources/Policies/ADMX/WAU.admx +++ b/Sources/Policies/ADMX/WAU.admx @@ -1,5 +1,5 @@ - + diff --git a/Sources/Policies/ADMX/en-US/WAU.adml b/Sources/Policies/ADMX/en-US/WAU.adml index e9d1f052..24361200 100644 --- a/Sources/Policies/ADMX/en-US/WAU.adml +++ b/Sources/Policies/ADMX/en-US/WAU.adml @@ -45,8 +45,8 @@ If "Application GPO Blacklist/Whitelist" is set in this GPO the Path can be: GPO If this policy is disabled or not configured, the default ListPath is used (WAU InstallLocation). Get Mods from external Path (URL/UNC/Local/AzureBlob) - If this policy is enabled, you can set a (URL/UNC/Local/AzureBlob) Path to external mods other than the default. - + If this policy is enabled, you can set a (URL/UNC/Local/AzureBlob) Path to external mods other than the default. + If this policy is disabled or not configured, the default ModsPath is used (WAU InstallLocation). Note: When set to 'AzureBlob', ensure you also configure 'Set Azure Blob URL with SAS token'. @@ -117,12 +117,12 @@ If this policy is not configured or disabled, Updates at Time: (06:00 AM).This policy setting specifies whether to enable User context execution or not. If this policy is disabled or not configured, the default is No. - Enable Deskop Shortcut + Enable Deskop Shortcut [DEPRECATED] This policy setting specifies whether to enable a Desktop Shortcut or not: WAU - Check for updated Apps If this policy is disabled or not configured, the default is No. - Enable Start Menu Shortcuts + Enable Start Menu Shortcuts [DEPRECATED] This policy setting specifies whether to enable the Start Menu Shortcuts or not: WAU - Check for updated Apps WAU - Open logs @@ -157,7 +157,7 @@ If this policy is disabled or not configured, the default size is used. - + diff --git a/Sources/Policies/ADMX/fr-FR/WAU.adml b/Sources/Policies/ADMX/fr-FR/WAU.adml index 8045caff..7ddb8245 100644 --- a/Sources/Policies/ADMX/fr-FR/WAU.adml +++ b/Sources/Policies/ADMX/fr-FR/WAU.adml @@ -147,14 +147,14 @@ Si cette politique est désactivée ou non configurée, la valeur par défaut est Non. - Activer le raccourci sur le bureau + Activer le raccourci sur le bureau [DÉPRÉCIÉ] Ce paramètre de politique spécifie s'il faut activer un raccourci sur le bureau ou non : WAU - Vérifier les applications mises à jour Si cette politique est désactivée ou non configurée, la valeur par défaut est Non. - Activer les raccourcis dans le menu Démarrer + Activer les raccourcis dans le menu Démarrer [DÉPRÉCIÉ] Ce paramètre de politique spécifie s'il faut activer les raccourcis dans le menu Démarrer ou non : WAU - Vérifier les applications mises à jour diff --git a/Sources/Winget-AutoUpdate/WAU-Policies.ps1 b/Sources/Winget-AutoUpdate/WAU-Policies.ps1 index e5c17147..fdd880d4 100644 --- a/Sources/Winget-AutoUpdate/WAU-Policies.ps1 +++ b/Sources/Winget-AutoUpdate/WAU-Policies.ps1 @@ -72,27 +72,6 @@ if ($WAUConfig.WAU_RunGPOManagement -eq 1) { Set-ScheduledTask -TaskPath $WAUTask.TaskPath -TaskName $WAUTask.TaskName -Trigger $taskTriggers | Out-Null } - #Update Desktop shortcut - $DesktopShortcut = "${env:Public}\Desktop\WAU - Check for updated Apps.lnk" - if (($WAUConfig.WAU_DesktopShortcut -eq 1) -and !(Test-Path $DesktopShortcut)) { - Add-Shortcut "wscript.exe" $DesktopShortcut "`"$($WAUConfig.InstallLocation)\Invisible.vbs`" `"powershell.exe -NoProfile -ExecutionPolicy Bypass -File `"`"`"$($WAUConfig.InstallLocation)\user-run.ps1`"`"" "${env:SystemRoot}\System32\shell32.dll,-16739" "Manual start of Winget-AutoUpdate (WAU)..." - } - elseif ($WAUConfig.WAU_DesktopShortcut -ne 1) { - Remove-Item -Path $DesktopShortcut -Force -ErrorAction SilentlyContinue | Out-Null - } - - #Update Start Menu shortcuts - $StartMenuShortcut = "${env:ProgramData}\Microsoft\Windows\Start Menu\Programs\Winget-AutoUpdate (WAU)" - if (($WAUConfig.WAU_StartMenuShortcut -eq 1) -and !(Test-Path $StartMenuShortcut)) { - New-Item -ItemType Directory -Force -Path $StartMenuShortcut | Out-Null - Add-Shortcut "wscript.exe" "$StartMenuShortcut\WAU - Check for updated Apps.lnk" "`"$($WAUConfig.InstallLocation)\Invisible.vbs`" `"powershell.exe -NoProfile -ExecutionPolicy Bypass -File `"`"`"$($WAUConfig.InstallLocation)\user-run.ps1`"`"" "${env:SystemRoot}\System32\shell32.dll,-16739" "Manual start of Winget-AutoUpdate (WAU)..." - Add-Shortcut "wscript.exe" "$StartMenuShortcut\WAU - Open logs.lnk" "`"$($WAUConfig.InstallLocation)\Invisible.vbs`" `"powershell.exe -NoProfile -ExecutionPolicy Bypass -File `"`"`"$($WAUConfig.InstallLocation)\user-run.ps1`" -Logs`"" "${env:SystemRoot}\System32\shell32.dll,-16763" "Open existing WAU logs..." - Add-Shortcut "wscript.exe" "$StartMenuShortcut\WAU - Web Help.lnk" "`"$($WAUConfig.InstallLocation)\Invisible.vbs`" `"powershell.exe -NoProfile -ExecutionPolicy Bypass -File `"`"`"$($WAUConfig.InstallLocation)\user-run.ps1`" -Help`"" "${env:SystemRoot}\System32\shell32.dll,-24" "Help for WAU..." - } - elseif ($WAUConfig.WAU_StartMenuShortcut -ne 1) { - Remove-Item -Path $StartMenuShortcut -Recurse -Force -ErrorAction SilentlyContinue | Out-Null - } - #Log latest applied config Add-Content -Path $GPOLogFile -Value "`nLatest applied settings:" $WAUConfig.PSObject.Properties | Where-Object { $_.Name -like "WAU_*" } | Select-Object Name, Value | Out-File -Encoding default -FilePath $GPOLogFile -Append diff --git a/Sources/Winget-AutoUpdate/config/WAU-MSI_Actions.ps1 b/Sources/Winget-AutoUpdate/config/WAU-MSI_Actions.ps1 index 57821c7d..bd58c665 100644 --- a/Sources/Winget-AutoUpdate/config/WAU-MSI_Actions.ps1 +++ b/Sources/Winget-AutoUpdate/config/WAU-MSI_Actions.ps1 @@ -194,7 +194,7 @@ function Uninstall-WingetAutoUpdate { #If upgrade, keep app list and mods. Else, remove. if ($Upgrade -like "#{*}") { - Write-Output "-> Upgrade detected. Keeping *.txt app lists" + Write-Output "-> Upgrade detected. Keeping *.txt and mods app lists" } else { $AppLists = Get-Item (Join-Path "$InstallPath" "*_apps.txt")