Skip to content

Commit

Permalink
Shortcuts are MSI managed now.
Browse files Browse the repository at this point in the history
  • Loading branch information
Romanitho committed Oct 7, 2024
1 parent 0c9b8e7 commit 8684270
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Sources/Policies/ADMX/WAU.admx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?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>
<target prefix="WAU" namespace="Romanitho.Policies.WAU"/>
</policyNamespaces>
Expand Down
10 changes: 5 additions & 5 deletions Sources/Policies/ADMX/en-US/WAU.adml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
<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).

Note: When set to 'AzureBlob', ensure you also configure 'Set Azure Blob URL with SAS token'.</string>
Expand Down Expand Up @@ -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.

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:
WAU - Check for updated Apps

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:
WAU - Check for updated Apps
WAU - Open logs
Expand Down Expand Up @@ -157,7 +157,7 @@ If this policy is disabled or not configured, the default size is used.</string>
<textBox refId="ModsPath">
<label>(URL/UNC/Local/AzureBlob) Path:</label>
</textBox>
</presentation>
</presentation>
<presentation id="BlobURL">
<textBox refId="BlobURL">
<label>Azure Storage URL with SAS token:</label>
Expand Down
4 changes: 2 additions & 2 deletions Sources/Policies/ADMX/fr-FR/WAU.adml
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,14 @@

Si cette politique est désactivée ou non configurée, la valeur par défaut est Non.
</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">
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.
</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">
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
Expand Down
21 changes: 0 additions & 21 deletions Sources/Winget-AutoUpdate/WAU-Policies.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Sources/Winget-AutoUpdate/config/WAU-MSI_Actions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 8684270

Please sign in to comment.