Skip to content

Commit 73d3c85

Browse files
authored
Merge pull request #26 from Atlas-OS/na-beta-releases
Beta v0.1.9
2 parents 9018842 + c4f82c6 commit 73d3c85

22 files changed

+483
-189
lines changed

AtlasToolbox/AtlasToolbox.csproj

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
<None Remove="SoftwarePage.xaml" />
4444
<None Remove="Views\ContentDialogView.xaml" />
4545
<None Remove="Views\NewProfilePage.xaml" />
46+
<None Remove="Views\UpdateDeferralPAge.xaml" />
4647
</ItemGroup>
4748
<ItemGroup>
4849
<Content Include="assets\**">
@@ -56,29 +57,29 @@
5657
</ItemGroup>
5758
<ItemGroup>
5859
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
59-
<PackageReference Include="CommunityToolkit.WinUI.Animations" Version="8.2.250402" />
60-
<PackageReference Include="CommunityToolkit.WinUI.Controls.Primitives" Version="8.2.250402" />
61-
<PackageReference Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.2.250402" />
62-
<PackageReference Include="ICSharpCode.Decompiler" Version="9.1.0.7988" />
60+
<PackageReference Include="CommunityToolkit.WinUI.Animations" Version="8.1.240916" />
61+
<PackageReference Include="CommunityToolkit.WinUI.Controls.Primitives" Version="8.1.240916" />
62+
<PackageReference Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.1.240916" />
63+
<PackageReference Include="ICSharpCode.Decompiler" Version="9.0.0.7889" />
6364
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="6.0.0" />
64-
<PackageReference Include="Microsoft.Dism" Version="3.3.12" />
65-
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.6" />
66-
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.6" />
65+
<PackageReference Include="Microsoft.Dism" Version="3.3.0" />
66+
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.3" />
67+
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.3" />
6768
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.3.2" />
68-
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.4188" />
69-
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.7.250606001" />
69+
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" />
70+
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.7.250310001" />
7071
<PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="3.0.0" />
7172
<PackageReference Include="MVVMEssentials.WPF" Version="1.0.3" />
7273
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
73-
<PackageReference Include="NLog" Version="6.0.0" />
74-
<PackageReference Include="NLog.Extensions.Logging" Version="6.0.0" />
75-
<PackageReference Include="System.Configuration.ConfigurationManager" Version="9.0.6" />
76-
<PackageReference Include="System.Management" Version="9.0.6" />
74+
<PackageReference Include="NLog" Version="5.4.0" />
75+
<PackageReference Include="NLog.Extensions.Logging" Version="5.4.0" />
76+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="9.0.3" />
77+
<PackageReference Include="System.Management" Version="9.0.3" />
7778
<PackageReference Include="System.Private.Uri" Version="4.3.2" />
7879
<PackageReference Include="System.Runtime.InteropServices.WindowsRuntime" Version="4.3.0" />
79-
<PackageReference Include="System.ServiceProcess.ServiceController" Version="9.0.6" />
80+
<PackageReference Include="System.ServiceProcess.ServiceController" Version="9.0.3" />
8081
<PackageReference Include="WindowsDisplayAPI" Version="1.3.0.13" />
81-
<PackageReference Include="WinUIEx" Version="2.6.0" />
82+
<PackageReference Include="WinUIEx" Version="2.5.1" />
8283
<Manifest Include="$(ApplicationManifest)" />
8384
</ItemGroup>
8485
<ItemGroup>
@@ -198,6 +199,9 @@
198199
<Pack>True</Pack>
199200
<PackagePath>\</PackagePath>
200201
</None>
202+
<Page Update="Views\UpdateDeferralPage.xaml">
203+
<Generator>MSBuild:Compile</Generator>
204+
</Page>
201205
<Page Update="Views\NewProfilePage.xaml">
202206
<Generator>MSBuild:Compile</Generator>
203207
</Page>
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Runtime.CompilerServices;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
using AtlasToolbox.Utils;
8+
using MVVMEssentials.Commands;
9+
10+
namespace AtlasToolbox.Commands.ConfigurationButtonsCommand
11+
{
12+
public class ResetWindowsUpdateDeferral : AsyncCommandBase
13+
{
14+
protected override async Task ExecuteAsync(object parameter)
15+
{
16+
await Task.Run(() =>
17+
{
18+
ResetUpdateDeferral();
19+
});
20+
}
21+
22+
private void ResetUpdateDeferral()
23+
{
24+
const string WINDOWS_UPDATE_KEY = "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\WindowsUpdate";
25+
const string FEATURE_UDATE_Deferral_KEY = "HKLM\\SOFTWARE\\AtlasOS\\FeatureUpdateDeferrals";
26+
const string QUALITY_UPDATE_DeferralS_KEY = "HKLM\\SOFTWARE\\AtlasOS\\QualityUpdateDeferrals";
27+
28+
RegistryHelper.DeleteValue(WINDOWS_UPDATE_KEY, "DeferFeatureUpdates");
29+
RegistryHelper.DeleteValue(WINDOWS_UPDATE_KEY, "DeferFeatureUpdatesPeriodInDays");
30+
31+
RegistryHelper.DeleteValue(WINDOWS_UPDATE_KEY, "DeferQualityUpdates");
32+
RegistryHelper.DeleteValue(WINDOWS_UPDATE_KEY, "DeferQualityUpdatesPeriodInDays");
33+
34+
RegistryHelper.SetValue(FEATURE_UDATE_Deferral_KEY, "state", 0, Microsoft.Win32.RegistryValueKind.DWord);
35+
RegistryHelper.SetValue(FEATURE_UDATE_Deferral_KEY, "path", "C:\\Windows\\AtlasDesktop\\3. General Configuration\\Windows Updates\\Set Windows Update Deferral.cmd", Microsoft.Win32.RegistryValueKind.DWord);
36+
RegistryHelper.SetValue(FEATURE_UDATE_Deferral_KEY, "value", 0, Microsoft.Win32.RegistryValueKind.DWord);
37+
38+
RegistryHelper.SetValue(QUALITY_UPDATE_DeferralS_KEY, "state", 0, Microsoft.Win32.RegistryValueKind.DWord);
39+
RegistryHelper.SetValue(QUALITY_UPDATE_DeferralS_KEY, "path", "C:\\Windows\\AtlasDesktop\\3. General Configuration\\Windows Updates\\Set Windows Update Deferral.cmd", Microsoft.Win32.RegistryValueKind.DWord);
40+
RegistryHelper.SetValue(QUALITY_UPDATE_DeferralS_KEY, "value", 0, Microsoft.Win32.RegistryValueKind.DWord);
41+
}
42+
}
43+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
using System;
2+
using System.Threading;
3+
using System.Threading.Tasks;
4+
using AtlasToolbox.Utils;
5+
using AtlasToolbox.Views;
6+
using Microsoft.UI.Dispatching;
7+
using Microsoft.UI.Xaml;
8+
using Microsoft.UI.Xaml.Controls;
9+
using MVVMEssentials.Commands;
10+
11+
namespace AtlasToolbox.Commands.ConfigurationButtonsCommand
12+
{
13+
public class SetUpdateDeferralConfigurationButton : AsyncCommandBase
14+
{
15+
protected override async Task ExecuteAsync(object parameter)
16+
{
17+
UpdateDeferralPage page = new UpdateDeferralPage();
18+
await Task.Run(() =>
19+
{
20+
// stupid hack idk why microsoft doesn't allow us to do a DispatcherQueue.EnqueueAsync
21+
// in things other than pages and whatnot
22+
page.ShowUpdateDeferralPrompt();
23+
});
24+
}
25+
26+
public static void SetUpdateDeferral(int featureDays, int qualityDays)
27+
{
28+
const string WINDOWS_UPDATE_KEY = "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\WindowsUpdate";
29+
30+
RegistryHelper.SetValue(WINDOWS_UPDATE_KEY, "DeferFeatureUpdates", 1, Microsoft.Win32.RegistryValueKind.DWord);
31+
RegistryHelper.SetValue(WINDOWS_UPDATE_KEY, "DeferFeatureUpdatesPeriodInDays", featureDays, Microsoft.Win32.RegistryValueKind.DWord);
32+
33+
RegistryHelper.SetValue(WINDOWS_UPDATE_KEY, "DeferQualityUpdates", 1, Microsoft.Win32.RegistryValueKind.DWord);
34+
RegistryHelper.SetValue(WINDOWS_UPDATE_KEY, "DeferQualityUpdatesPeriodInDays", qualityDays, Microsoft.Win32.RegistryValueKind.DWord);
35+
36+
RegistryHelper.SetValue("HKLM\\SOFTWARE\\AtlasOS\\FeatureUpdateDeferrals", "state", 1, Microsoft.Win32.RegistryValueKind.DWord);
37+
RegistryHelper.SetValue("HKLM\\SOFTWARE\\AtlasOS\\FeatureUpdateDeferrals", "path", "C:\\Windows\\AtlasDesktop\\3. General Configuration\\Windows Updates\\Set Windows Update Deferral.cmd", Microsoft.Win32.RegistryValueKind.DWord);
38+
RegistryHelper.SetValue("HKLM\\SOFTWARE\\AtlasOS\\FeatureUpdateDeferrals", "value", featureDays, Microsoft.Win32.RegistryValueKind.DWord);
39+
40+
RegistryHelper.SetValue("HKLM\\SOFTWARE\\AtlasOS\\QualityUpdateDeferrals", "state", 1, Microsoft.Win32.RegistryValueKind.DWord);
41+
RegistryHelper.SetValue("HKLM\\SOFTWARE\\AtlasOS\\QualityUpdateDeferrals", "path", "C:\\Windows\\AtlasDesktop\\3. General Configuration\\Windows Updates\\Set Windows Update Deferral.cmd", Microsoft.Win32.RegistryValueKind.DWord);
42+
RegistryHelper.SetValue("HKLM\\SOFTWARE\\AtlasOS\\QualityUpdateDeferrals", "value", qualityDays, Microsoft.Win32.RegistryValueKind.DWord);
43+
}
44+
}
45+
}

AtlasToolbox/Enums/ConfigurationType.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public enum ConfigurationType
4141
MitigationsSubMenu,
4242
TroubleshootingNetwork,
4343
FileSharingSubMenu,
44+
WindowsUpdate,
4445
}
4546

4647
public static class EnumExtensions

AtlasToolbox/HostBuilder/AddServicesHostBuilderExtensions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ private static IHostBuilder AddConfigurationServices(this IHostBuilder host)
117117
services.AddKeyedTransient<IConfigurationService, NetworkNavigationPaneConfigurationService>("NetworkNavigationPane");
118118
services.AddKeyedTransient<IConfigurationService, FileSharingConfigurationService>("FileSharing");
119119
services.AddKeyedTransient<IConfigurationService, WindowsHelloConfigurationServices>("WindowsHello");
120+
services.AddKeyedTransient<IConfigurationService, ToggleWindowsUpdateConfigurationService>("ToggleWindowsUpdates");
120121
services.AddKeyedTransient<IMultiOptionConfigurationServices, ContextMenuTeminalsConfigurationService>("ContextMenuTerminals");
121122
services.AddKeyedTransient<IMultiOptionConfigurationServices, ShortcutIconConfigurationService>("ShortcutIcon");
122123
services.AddKeyedTransient<IMultiOptionConfigurationServices, MitigationsConfigurationService>("Mitigations");
@@ -150,6 +151,7 @@ private static IHostBuilder AddConfigurationMenus(this IHostBuilder host)
150151
services.AddKeyedTransient<IConfigurationSubMenu, MitigationsSubMenu>("MitigationsSubMenu");
151152
services.AddKeyedTransient<IConfigurationSubMenu, TroubleshootingNetworkSubMenu>("TroubleshootingNetwork");
152153
services.AddKeyedTransient<IConfigurationSubMenu, FileSharingSubMenu>("FileSharingSubMenu");
154+
services.AddKeyedTransient<IConfigurationSubMenu, WindowsUpdateSubMenu>("WindowsUpdate");
153155
});
154156

155157
return host;

AtlasToolbox/HostBuilder/AddStoresHostBuilderExtensions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ private static IHostBuilder AddConfigurationStores(this IHostBuilder host)
9999
services.AddKeyedSingleton<ConfigurationStore>("NetworkNavigationPane");
100100
services.AddKeyedSingleton<ConfigurationStore>("FileSharing");
101101
services.AddKeyedSingleton<ConfigurationStore>("WindowsHello");
102+
services.AddKeyedSingleton<ConfigurationStore>("ToggleWindowsUpdates");
102103
services.AddKeyedSingleton<MultiOptionConfigurationStore>("ContextMenuTerminals");
103104
services.AddKeyedSingleton<MultiOptionConfigurationStore>("ShortcutIcon");
104105
services.AddKeyedSingleton<MultiOptionConfigurationStore>("Mitigations");
@@ -132,6 +133,7 @@ private static IHostBuilder AddConfigurationMenu(this IHostBuilder host)
132133
services.AddKeyedSingleton<ConfigurationStoreSubMenu>("MitigationsSubMenu");
133134
services.AddKeyedSingleton<ConfigurationStoreSubMenu>("TroubleshootingNetwork");
134135
services.AddKeyedSingleton<ConfigurationStoreSubMenu>("FileSharingSubMenu");
136+
services.AddKeyedSingleton<ConfigurationStoreSubMenu>("WindowsUpdate");
135137
});
136138

137139
return host;

AtlasToolbox/HostBuilder/AddViewModelsHostBuilderExtensions.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,8 @@ private static IHostBuilder AddConfigurationButtonItemViewModels(this IHostBuild
235235
["TelemetryComponents"] = new(buttonCommand = new TelemetryComponentsCommand(), App.GetValueFromItemList("FixErrors"), App.GetValueFromItemList("TelemetryComponents"), ConfigurationType.Troubleshooting),
236236
["AtlasDefault"] = new(buttonCommand = new NetworkAtlasDefaults(), App.GetValueFromItemList("ResetFTH"), App.GetValueFromItemList("AtlasDefault"), ConfigurationType.TroubleshootingNetwork),
237237
["WindowsDefault"] = new(buttonCommand = new NetworkWindowsDefaults(), App.GetValueFromItemList("ResetFTH"), App.GetValueFromItemList("WindowsDefault"), ConfigurationType.TroubleshootingNetwork),
238+
["SetUpdateDeferral"] = new(buttonCommand = new SetUpdateDeferralConfigurationButton(), App.GetValueFromItemList("Set"), App.GetValueFromItemList("WindowsUpdateDeferral"), ConfigurationType.WindowsUpdate),
239+
["ResetUpdateDeferral"] = new(buttonCommand = new ResetWindowsUpdateDeferral(), App.GetValueFromItemList("ResetFTH"), App.GetValueFromItemList("ResetWindowsUpdateDeferral"), ConfigurationType.WindowsUpdate),
238240
};
239241

240242
host.ConfigureServices((_, services) =>
@@ -279,6 +281,7 @@ private static IHostBuilder AddConfigurationSubMenu(this IHostBuilder host)
279281
["MitigationsSubMenu"] = new(App.GetValueFromItemList("MitigationsSubMenu"), App.GetValueFromItemList("MitigationsSubMenu", true), ConfigurationType.Security),
280282
["TroubleshootingNetwork"] = new(App.GetValueFromItemList("TroubleshootingNetwork"), App.GetValueFromItemList("TroubleshootingNetwork", true), ConfigurationType.Troubleshooting),
281283
["FileSharingSubMenu"] = new(App.GetValueFromItemList("FileSharingSubMenu"), App.GetValueFromItemList("FileSharingSubMenu", true), ConfigurationType.General),
284+
["WindowsUpdate"] = new(App.GetValueFromItemList("WindowsUpdate"), App.GetValueFromItemList("WindowsUpdate", true), ConfigurationType.General),
282285
};
283286
host.ConfigureServices((_, services) =>
284287
{
@@ -407,6 +410,7 @@ private static IHostBuilder AddConfigurationItemViewModels(this IHostBuilder hos
407410
["NetworkNavigationPane"] = new(App.GetValueFromItemList("NetworkNavigationPane"), "NetworkNavigationPane", ConfigurationType.FileSharingSubMenu, RiskRating.HighRisk),
408411
["FileSharing"] = new(App.GetValueFromItemList("FileSharing"), "FileSharing", ConfigurationType.FileSharingSubMenu, RiskRating.HighRisk),
409412
["WindowsHello"] = new(App.GetValueFromItemList("WindowsHello"), "WindowsHello", ConfigurationType.General, RiskRating.HighRisk),
413+
["ToggleWindowsUpdates"] = new(App.GetValueFromItemList("ToggleWindowsUpdates"), "ToggleWindowsUpdates", ConfigurationType.WindowsUpdate, RiskRating.HighRisk),
410414
};
411415

412416
host.ConfigureServices((_,services) =>

0 commit comments

Comments
 (0)