Skip to content

Commit 2d38b5d

Browse files
committed
Seconds unnecessary!
1 parent be6b043 commit 2d38b5d

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ By default, scripts and components will be placed in "Program Files" location (i
7878
Post installation: all settings can be managed via the **WAU Settings (Administrator)** shortcut installed if `STARTMENUSHORTCUT=1` is set during installation (if not set `WAU-Settings-GUI.ps1` can be run manually as an **Administrator**)
7979

8080
Managed by Registry (local):
81-
![image](https://github.com/user-attachments/assets/260ac393-4a09-4e99-b64c-60b9df49c206)
81+
![image](https://github.com/user-attachments/assets/75b117ab-886e-43c3-9858-1da51cea2d4f)
8282

8383
Dev Tools (F12):
8484
![image](https://github.com/user-attachments/assets/1acb6e19-a58d-41a7-a468-50136373b7a2)

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,8 @@ function Update-WAUGUIFromConfig {
657657
}
658658

659659
# Update time and delay
660-
$Controls.UpdateTimeTextBox.Text = (Get-DisplayValue -PropertyName "WAU_UpdatesAtTime" -Config $updatedConfig -Policies $updatedPolicies).ToString()
660+
$updateTime = (Get-DisplayValue -PropertyName "WAU_UpdatesAtTime" -Config $updatedConfig -Policies $updatedPolicies).ToString()
661+
$Controls.UpdateTimeTextBox.Text = $updateTime.Substring(0, $updateTime.Length - 3)
661662
$Controls.RandomDelayTextBox.Text = (Get-DisplayValue -PropertyName "WAU_UpdatesTimeDelay" -Config $updatedConfig -Policies $updatedPolicies).ToString()
662663

663664
# Update paths
@@ -1142,11 +1143,11 @@ function Show-WAUSettingsGUI {
11421143

11431144
# Validate time format
11441145
try {
1145-
[datetime]::ParseExact($controls.UpdateTimeTextBox.Text, "HH:mm:ss", $null) | Out-Null
1146+
[datetime]::ParseExact($controls.UpdateTimeTextBox.Text, "HH:mm", $null) | Out-Null
11461147
}
11471148
catch {
11481149
Close-PopUp
1149-
[System.Windows.MessageBox]::Show("Invalid time format. Please use HH:mm:ss format (e.g., 06:00:00)", "Error", "OK", "Error")
1150+
[System.Windows.MessageBox]::Show("Invalid time format. Please use HH:mm format (e.g., 06:00)", "Error", "OK", "Error")
11501151
$controls.StatusBarText.Text = "$Script:STATUS_READY_TEXT"
11511152
$controls.StatusBarText.Foreground = "$Script:COLOR_INACTIVE"
11521153
return
@@ -1168,7 +1169,7 @@ function Show-WAUSettingsGUI {
11681169
$newSettings = @{
11691170
WAU_NotificationLevel = $controls.NotificationLevelComboBox.SelectedItem.Tag
11701171
WAU_UpdatesInterval = $controls.UpdateIntervalComboBox.SelectedItem.Tag
1171-
WAU_UpdatesAtTime = $controls.UpdateTimeTextBox.Text
1172+
WAU_UpdatesAtTime = "$($controls.UpdateTimeTextBox.Text):00"
11721173
WAU_UpdatesTimeDelay = $controls.RandomDelayTextBox.Text
11731174
WAU_ListPath = $controls.ListPathTextBox.Text
11741175
WAU_ModsPath = $controls.ModsPathTextBox.Text

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@
9494
<!-- Update Time Column -->
9595
<StackPanel Grid.Column="0" Margin="0,0,5,0">
9696
<StackPanel Orientation="Horizontal">
97-
<TextBox x:Name="UpdateTimeTextBox" Width="80" Height="25" Text="06:00:00" VerticalContentAlignment="Center"/>
98-
<TextBlock Text="(HH:mm:ss format)" VerticalAlignment="Center" Margin="10,0,0,0" FontSize="10" Foreground="$Script:COLOR_INACTIVE"/>
97+
<TextBox x:Name="UpdateTimeTextBox" Width="80" Height="25" Text="06:00" VerticalContentAlignment="Center"/>
98+
<TextBlock Text="(HH:mm format)" VerticalAlignment="Center" Margin="10,0,0,0" FontSize="10" Foreground="$Script:COLOR_INACTIVE"/>
9999
</StackPanel>
100100
<TextBlock Text="Time of day when updates are checked" FontSize="10" Foreground="$Script:COLOR_INACTIVE" Margin="0,5,0,0"/>
101101
</StackPanel>

0 commit comments

Comments
 (0)