Shortcuts are MSI managed now.

pull/730/head
Romain 2024-10-07 12:22:54 +02:00
parent 0c9b8e7f3d
commit 8684270f46
5 changed files with 9 additions and 30 deletions

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<policyDefinitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" revision="4.8" xsi:schemaLocation="" schemaVersion="1.0" xmlns="http://www.microsoft.com/GroupPolicy/PolicyDefinitions"> <policyDefinitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" revision="4.9" xsi:schemaLocation="" schemaVersion="1.0" xmlns="http://www.microsoft.com/GroupPolicy/PolicyDefinitions">
<policyNamespaces> <policyNamespaces>
<target prefix="WAU" namespace="Romanitho.Policies.WAU"/> <target prefix="WAU" namespace="Romanitho.Policies.WAU"/>
</policyNamespaces> </policyNamespaces>

View File

@ -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).</string> If this policy is disabled or not configured, the default ListPath is used (WAU InstallLocation).</string>
<string id="ModsPath_Name">Get Mods from external Path (URL/UNC/Local/AzureBlob)</string> <string id="ModsPath_Name">Get Mods from external Path (URL/UNC/Local/AzureBlob)</string>
<string id="ModsPath_Explain">If this policy is enabled, you can set a (URL/UNC/Local/AzureBlob) Path to external mods other than the default. <string id="ModsPath_Explain">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). 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'.</string> Note: When set to 'AzureBlob', ensure you also configure 'Set Azure Blob URL with SAS token'.</string>
@ -117,12 +117,12 @@ If this policy is not configured or disabled, Updates at Time: (06:00 AM).</stri
<string id="UserContext_Explain">This policy setting specifies whether to enable User context execution or not. <string id="UserContext_Explain">This policy setting specifies whether to enable User context execution or not.
If this policy is disabled or not configured, the default is No.</string> If this policy is disabled or not configured, the default is No.</string>
<string id="DesktopShortcut_Name">Enable Deskop Shortcut</string> <string id="DesktopShortcut_Name">Enable Deskop Shortcut [DEPRECATED]</string>
<string id="DesktopShortcut_Explain">This policy setting specifies whether to enable a Desktop Shortcut or not: <string id="DesktopShortcut_Explain">This policy setting specifies whether to enable a Desktop Shortcut or not:
WAU - Check for updated Apps WAU - Check for updated Apps
If this policy is disabled or not configured, the default is No.</string> If this policy is disabled or not configured, the default is No.</string>
<string id="StartMenuShortcut_Name">Enable Start Menu Shortcuts</string> <string id="StartMenuShortcut_Name">Enable Start Menu Shortcuts [DEPRECATED]</string>
<string id="StartMenuShortcut_Explain">This policy setting specifies whether to enable the Start Menu Shortcuts or not: <string id="StartMenuShortcut_Explain">This policy setting specifies whether to enable the Start Menu Shortcuts or not:
WAU - Check for updated Apps WAU - Check for updated Apps
WAU - Open logs WAU - Open logs
@ -157,7 +157,7 @@ If this policy is disabled or not configured, the default size is used.</string>
<textBox refId="ModsPath"> <textBox refId="ModsPath">
<label>(URL/UNC/Local/AzureBlob) Path:</label> <label>(URL/UNC/Local/AzureBlob) Path:</label>
</textBox> </textBox>
</presentation> </presentation>
<presentation id="BlobURL"> <presentation id="BlobURL">
<textBox refId="BlobURL"> <textBox refId="BlobURL">
<label>Azure Storage URL with SAS token:</label> <label>Azure Storage URL with SAS token:</label>

View File

@ -147,14 +147,14 @@
Si cette politique est désactivée ou non configurée, la valeur par défaut est Non. Si cette politique est désactivée ou non configurée, la valeur par défaut est Non.
</string> </string>
<string id="DesktopShortcut_Name">Activer le raccourci sur le bureau</string> <string id="DesktopShortcut_Name">Activer le raccourci sur le bureau [DÉPRÉCIÉ]</string>
<string id="DesktopShortcut_Explain"> <string id="DesktopShortcut_Explain">
Ce paramètre de politique spécifie s'il faut activer un raccourci sur le bureau ou non : 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 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. Si cette politique est désactivée ou non configurée, la valeur par défaut est Non.
</string> </string>
<string id="StartMenuShortcut_Name">Activer les raccourcis dans le menu Démarrer</string> <string id="StartMenuShortcut_Name">Activer les raccourcis dans le menu Démarrer [DÉPRÉCIÉ]</string>
<string id="StartMenuShortcut_Explain"> <string id="StartMenuShortcut_Explain">
Ce paramètre de politique spécifie s'il faut activer les raccourcis dans le menu Démarrer ou non : 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 WAU - Vérifier les applications mises à jour

View File

@ -72,27 +72,6 @@ if ($WAUConfig.WAU_RunGPOManagement -eq 1) {
Set-ScheduledTask -TaskPath $WAUTask.TaskPath -TaskName $WAUTask.TaskName -Trigger $taskTriggers | Out-Null 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 #Log latest applied config
Add-Content -Path $GPOLogFile -Value "`nLatest applied settings:" 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 $WAUConfig.PSObject.Properties | Where-Object { $_.Name -like "WAU_*" } | Select-Object Name, Value | Out-File -Encoding default -FilePath $GPOLogFile -Append

View File

@ -194,7 +194,7 @@ function Uninstall-WingetAutoUpdate {
#If upgrade, keep app list and mods. Else, remove. #If upgrade, keep app list and mods. Else, remove.
if ($Upgrade -like "#{*}") { if ($Upgrade -like "#{*}") {
Write-Output "-> Upgrade detected. Keeping *.txt app lists" Write-Output "-> Upgrade detected. Keeping *.txt and mods app lists"
} }
else { else {
$AppLists = Get-Item (Join-Path "$InstallPath" "*_apps.txt") $AppLists = Get-Item (Join-Path "$InstallPath" "*_apps.txt")