Merge pull request #730 from Romanitho/decomission
Shortcuts are MSI managed now.pull/732/head v1.22.4-n
commit
b892ec8c10
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Reference in New Issue