Skip to content

Commit 90deaa8

Browse files
committed
Corrected Run WAU Shortcut
1 parent 3a941f9 commit 90deaa8

File tree

2 files changed

+9
-20
lines changed

2 files changed

+9
-20
lines changed

Sources/Winget-AutoUpdate/WAU-Settings-GUI.ps1

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -405,24 +405,6 @@ function Set-WAUConfig {
405405
}
406406
}
407407

408-
# Check if WAU schedule is disabled and create Run WAU desktop shortcut if needed
409-
if ($Settings.ContainsKey('WAU_UpdatesInterval') -and $Settings['WAU_UpdatesInterval'] -eq 'Never') {
410-
# Always create if it doesn't exist when schedule is disabled (regardless of desktop shortcut setting)
411-
if (-not (Test-Path $Script:DESKTOP_RUN_WAU)) {
412-
Add-Shortcut $Script:DESKTOP_RUN_WAU $Script:CONHOST_EXE "$($currentConfig.InstallLocation)" "$Script:POWERSHELL_ARGS `"$($currentConfig.InstallLocation)$Script:USER_RUN_SCRIPT`"" "$Script:WAU_ICON" "Winget AutoUpdate" "Normal"
413-
# Mirror shortcut creation to registry
414-
Set-ItemProperty -Path $Script:WAU_REGISTRY_PATH -Name 'WAU_DesktopShortcut' -Value 1 -Force
415-
}
416-
}
417-
# Remove Run WAU desktop shortcut if schedule is enabled and desktop shortcuts are disabled
418-
elseif ($Settings.ContainsKey('WAU_UpdatesInterval') -and $Settings['WAU_UpdatesInterval'] -ne 'Never' -and $Settings.ContainsKey('WAU_DesktopShortcut') -and $Settings['WAU_DesktopShortcut'] -eq 0) {
419-
if (Test-Path $Script:DESKTOP_RUN_WAU) {
420-
Remove-Item -Path $Script:DESKTOP_RUN_WAU -Force
421-
# Mirror shortcut removal to registry
422-
Set-ItemProperty -Path $Script:WAU_REGISTRY_PATH -Name 'WAU_DesktopShortcut' -Value 0 -Force
423-
}
424-
}
425-
426408
# Remove WAU Settings desktop shortcut if Start Menu shortcuts are created
427409
if ($Settings.ContainsKey('WAU_StartMenuShortcut') -and $Settings['WAU_StartMenuShortcut'] -eq 1) {
428410
if (Test-Path $Script:DESKTOP_WAU_SETTINGS) {

Sources/Winget-AutoUpdate/config/settings-window.xaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,15 @@
166166
ToolTip="Allow WAU to update itself to pre-release versions"/>
167167
<CheckBox Grid.Row="0" Grid.Column="2" x:Name="DoNotRunOnMeteredCheckBox" Content="Don't run on data plan" Margin="0,0,5,5"
168168
ToolTip="Prevent WAU from running when connected to a metered network"/>
169-
<CheckBox Grid.Row="1" Grid.Column="0" x:Name="StartMenuShortcutCheckBox" Content="Start menu shortcuts" Margin="0,0,5,5"
170-
ToolTip="Create/delete Start menu shortcuts (Settings Shortcut will be created on active User Desktop if deleted)"/>
169+
<CheckBox Grid.Row="1" Grid.Column="0" x:Name="StartMenuShortcutCheckBox" Content="Start menu shortcuts" Margin="0,0,5,5">
170+
<CheckBox.ToolTip>
171+
<TextBlock>
172+
Create/delete Start menu shortcuts:
173+
<LineBreak/>
174+
'$Script:WAU_TITLE' Shortcut will be created on active User Desktop if deleted.
175+
</TextBlock>
176+
</CheckBox.ToolTip>
177+
</CheckBox>
171178
<CheckBox Grid.Row="1" Grid.Column="1" x:Name="DesktopShortcutCheckBox" Content="WAU Desktop shortcut" Margin="0,0,5,5"
172179
ToolTip="Create/delete 'Run WAU' shortcut on Desktop"/>
173180
<CheckBox Grid.Row="1" Grid.Column="2" x:Name="AppInstallerShortcutCheckBox" Content="App Installer Desktop shortcut" Margin="0,0,5,5"

0 commit comments

Comments
 (0)