From 47cff5e7f69f154220c9c1302533eaf3c63d152a Mon Sep 17 00:00:00 2001 From: Vichingo455 Date: Tue, 28 Oct 2025 19:02:19 +0100 Subject: [PATCH 1/3] A lot of things --- Perfect11.sln | 18 + Perfect11/Form1.Designer.cs | 22 +- Perfect11/Form1.cs | 58 ++-- Perfect11/Library/PowerShell.cs | 2 +- Perfect11/Library/Utilities.cs | 14 +- Perfect11/Program.cs | 4 +- Perfect11/Properties/Resources.Designer.cs | 20 +- Perfect11/Properties/Settings.Designer.cs | 4 +- .../Perfect11.Inbox.RemoveWindowsAI.csproj | 56 +++ .../Properties/AssemblyInfo.cs | 33 ++ .../Perfect11.Inbox.RemoveWindowsAI/Tweak.cs | 44 +++ .../Perfect11.Inbox.Spotlight.csproj | 1 + .../Perfect11.Inbox.UninstallEdge.csproj | 55 +++ .../Properties/AssemblyInfo.cs | 33 ++ tweaks/Perfect11.Inbox.UninstallEdge/Tweak.cs | 322 ++++++++++++++++++ .../Perfect11.Inbox.UninstallOneDrive.csproj | 1 + .../Properties/AssemblyInfo.cs | 2 +- .../Tweak.cs | 6 +- .../Perfect11.Inbox.Widgets.csproj | 55 +++ .../Properties/AssemblyInfo.cs | 33 ++ tweaks/Perfect11.Inbox.Widgets/Tweak.cs | 71 ++++ 21 files changed, 794 insertions(+), 60 deletions(-) create mode 100644 tweaks/Perfect11.Inbox.RemoveWindowsAI/Perfect11.Inbox.RemoveWindowsAI.csproj create mode 100644 tweaks/Perfect11.Inbox.RemoveWindowsAI/Properties/AssemblyInfo.cs create mode 100644 tweaks/Perfect11.Inbox.RemoveWindowsAI/Tweak.cs create mode 100644 tweaks/Perfect11.Inbox.UninstallEdge/Perfect11.Inbox.UninstallEdge.csproj create mode 100644 tweaks/Perfect11.Inbox.UninstallEdge/Properties/AssemblyInfo.cs create mode 100644 tweaks/Perfect11.Inbox.UninstallEdge/Tweak.cs create mode 100644 tweaks/Perfect11.Inbox.Widgets/Perfect11.Inbox.Widgets.csproj create mode 100644 tweaks/Perfect11.Inbox.Widgets/Properties/AssemblyInfo.cs create mode 100644 tweaks/Perfect11.Inbox.Widgets/Tweak.cs diff --git a/Perfect11.sln b/Perfect11.sln index cb4de19..69c9905 100644 --- a/Perfect11.sln +++ b/Perfect11.sln @@ -15,6 +15,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perfect11.Inbox.DisableAds" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perfect11.Inbox.Spotlight", "tweaks\Perfect11.Inbox.Spotlight\Perfect11.Inbox.Spotlight.csproj", "{77376E26-3164-4ED7-9F85-02B3AEBFC751}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perfect11.Inbox.RemoveWindowsAI", "tweaks\Perfect11.Inbox.RemoveWindowsAI\Perfect11.Inbox.RemoveWindowsAI.csproj", "{BC3A0BBD-E076-426E-88C9-C36E1F6D3326}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perfect11.Inbox.Widgets", "tweaks\Perfect11.Inbox.Widgets\Perfect11.Inbox.Widgets.csproj", "{F77922A2-B913-400E-8789-4867FD1BB351}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perfect11.Inbox.UninstallEdge", "tweaks\Perfect11.Inbox.UninstallEdge\Perfect11.Inbox.UninstallEdge.csproj", "{A33DF785-C123-48E2-B21E-A229FC8FFB55}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -45,6 +51,18 @@ Global {77376E26-3164-4ED7-9F85-02B3AEBFC751}.Debug|Any CPU.Build.0 = Debug|Any CPU {77376E26-3164-4ED7-9F85-02B3AEBFC751}.Release|Any CPU.ActiveCfg = Release|Any CPU {77376E26-3164-4ED7-9F85-02B3AEBFC751}.Release|Any CPU.Build.0 = Release|Any CPU + {BC3A0BBD-E076-426E-88C9-C36E1F6D3326}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BC3A0BBD-E076-426E-88C9-C36E1F6D3326}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BC3A0BBD-E076-426E-88C9-C36E1F6D3326}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BC3A0BBD-E076-426E-88C9-C36E1F6D3326}.Release|Any CPU.Build.0 = Release|Any CPU + {F77922A2-B913-400E-8789-4867FD1BB351}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F77922A2-B913-400E-8789-4867FD1BB351}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F77922A2-B913-400E-8789-4867FD1BB351}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F77922A2-B913-400E-8789-4867FD1BB351}.Release|Any CPU.Build.0 = Release|Any CPU + {A33DF785-C123-48E2-B21E-A229FC8FFB55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A33DF785-C123-48E2-B21E-A229FC8FFB55}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A33DF785-C123-48E2-B21E-A229FC8FFB55}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A33DF785-C123-48E2-B21E-A229FC8FFB55}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Perfect11/Form1.Designer.cs b/Perfect11/Form1.Designer.cs index 38646cc..5df3e45 100644 --- a/Perfect11/Form1.Designer.cs +++ b/Perfect11/Form1.Designer.cs @@ -129,7 +129,7 @@ this.pages.Dock = System.Windows.Forms.DockStyle.Fill; this.pages.Location = new System.Drawing.Point(3, 28); this.pages.Name = "pages"; - this.pages.SelectedIndex = 1; + this.pages.SelectedIndex = 0; this.pages.Size = new System.Drawing.Size(1323, 732); this.pages.TabIndex = 1; this.pages.UseSelectable = true; @@ -156,9 +156,12 @@ // // poisonLabel2 // + this.poisonLabel2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.poisonLabel2.AutoSize = true; this.poisonLabel2.BackColor = System.Drawing.Color.Transparent; - this.poisonLabel2.Location = new System.Drawing.Point(416, 379); + this.poisonLabel2.Location = new System.Drawing.Point(422, 362); this.poisonLabel2.Name = "poisonLabel2"; this.poisonLabel2.Size = new System.Drawing.Size(459, 38); this.poisonLabel2.TabIndex = 3; @@ -166,11 +169,12 @@ "stalls apps, remove bloatware, tweak the system and even more."; this.poisonLabel2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.poisonLabel2.UseCustomBackColor = true; + this.poisonLabel2.UseCustomForeColor = true; // // pictureBox1 // this.pictureBox1.Image = global::Perfect11.Properties.Resources.win11logo; - this.pictureBox1.Location = new System.Drawing.Point(559, 156); + this.pictureBox1.Location = new System.Drawing.Point(563, 152); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(163, 160); this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; @@ -179,16 +183,20 @@ // // poisonLabel1 // + this.poisonLabel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.poisonLabel1.AutoSize = true; this.poisonLabel1.BackColor = System.Drawing.Color.Transparent; this.poisonLabel1.FontSize = ReaLTaiizor.Extension.Poison.PoisonLabelSize.Tall; - this.poisonLabel1.Location = new System.Drawing.Point(374, 336); + this.poisonLabel1.Location = new System.Drawing.Point(384, 326); this.poisonLabel1.Name = "poisonLabel1"; this.poisonLabel1.Size = new System.Drawing.Size(533, 25); this.poisonLabel1.TabIndex = 2; this.poisonLabel1.Text = "Welcome to Perfect11, the tool that makes Windows 11 almost perfect."; this.poisonLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.poisonLabel1.UseCustomBackColor = true; + this.poisonLabel1.UseCustomForeColor = true; // // upgradePage // @@ -541,12 +549,14 @@ // this.editionLabel.AutoSize = true; this.editionLabel.BackColor = System.Drawing.Color.Transparent; - this.editionLabel.Location = new System.Drawing.Point(12, 763); + this.editionLabel.Location = new System.Drawing.Point(12, 767); this.editionLabel.Name = "editionLabel"; - this.editionLabel.Size = new System.Drawing.Size(175, 19); + this.editionLabel.Size = new System.Drawing.Size(213, 21); this.editionLabel.TabIndex = 4; this.editionLabel.Text = "Perfect11 Community Edition"; this.editionLabel.UseCustomBackColor = true; + this.editionLabel.UseCustomFont = true; + this.editionLabel.UseCustomForeColor = true; // // Form1 // diff --git a/Perfect11/Form1.cs b/Perfect11/Form1.cs index d2f16e5..6b1d53e 100644 --- a/Perfect11/Form1.cs +++ b/Perfect11/Form1.cs @@ -23,10 +23,12 @@ namespace Perfect11 private List _listSystemApps = new List(); private List _tweaks = new List(); private CancellationTokenSource _cts; + private CancellationTokenSource _cts2; + private CancellationTokenSource _cts3; private bool _isDownloading = false; - string url = $"https://software-static.download.prss.microsoft.com/dbazure/888969d5-f34g-4e03-ac9d-1f9786c66749/26200.6584.250915-1905.25h2_ge_release_svc_refresh_CLIENT_CONSUMER_{Utilities.GetSystemArchitecture()}FRE_{Utilities.GetLanguageCode()}.iso"; + string url = $"https://software-.download.prss.microsoft.com/dbazure/888969d5-f34g-4e03-ac9d-1f9786c66749/26200.6584.250915-1905.25h2_ge_release_svc_refresh_CLIENT_CONSUMER_{Utilities.GetSystemArchitecture()}FRE_{Utilities.GetLanguageCode()}.iso"; string destination = Path.Combine(@"C:\Temp", @"windows.iso"); - private static string AppEdition = "Perfect11 Community Edition"; + private string AppEdition = "Perfect11 Community Edition"; public Form1() { InitializeComponent(); @@ -84,7 +86,9 @@ namespace Perfect11 welcomePage.Theme = ThemeStyle.Light; debloatPage.Theme = ThemeStyle.Light; poisonLabel1.Theme = ThemeStyle.Light; + poisonLabel1.ForeColor = Color.FromArgb(255, 255, 255); poisonLabel2.Theme = ThemeStyle.Light; + poisonLabel2.ForeColor = Color.FromArgb(255, 255, 255); LblInstalledCount.Theme = ThemeStyle.Light; LblRemoveCount.Theme = ThemeStyle.Light; LstUWP.Theme = ThemeStyle.Light; @@ -279,19 +283,15 @@ namespace Perfect11 if (LstUWPRemove.SelectedItems.Count > 0) { List selectedItems = new List(); - foreach (ListViewItem selectedItem in LstUWPRemove.SelectedItems) { selectedItems.Add(selectedItem); } - - // Move each selected item foreach (ListViewItem item in selectedItems) { LstUWP.Items.Add((ListViewItem)item.Clone()); LstUWPRemove.Items.Remove(item); } - RefreshUWP(); } } @@ -313,43 +313,37 @@ namespace Perfect11 if (LstUWPRemove.Items.Count == 0) { MessageBox.Show("No items were selected for removal.","Perfect11", MessageBoxButtons.OK,MessageBoxIcon.Information); } else { - Enabled = false; + _cts3 = new CancellationTokenSource(); + BtnRunUninstaller.Enabled = false; + addAllButton.Enabled = false; + addButton.Enabled = false; + removeButton.Enabled = false; + removeAllButton.Enabled = false; MessageBox.Show(RemoveUWP(),"Perfect11",MessageBoxButtons.OK,MessageBoxIcon.Information); LstUWPRemove.Items.Clear(); GetUWP(); - Enabled = true; + _cts3 = null; } } private void InitializeTweaks() { const string tweaksFolder = "Tweaks"; const string interfaceDll = "Perfect11.TweaksInterface.dll"; - - // Ensure folder exists and remove old interface DLL if (!Directory.Exists(tweaksFolder)) Directory.CreateDirectory(tweaksFolder); - string interfacePath = Path.Combine(tweaksFolder, interfaceDll); if (File.Exists(interfacePath)) File.Delete(interfacePath); - - // Load categorized plugins var categorizedPlugins = Utilities.LoadTweaks(tweaksFolder); - - // Setup ListView tweaksList.View = View.Details; tweaksList.FullRowSelect = true; tweaksList.ShowGroups = true; tweaksList.Items.Clear(); tweaksList.Groups.Clear(); - - // Setup columns tweaksList.Columns.Clear(); tweaksList.Columns.Add("Tweak"); tweaksList.Columns.Add("Description"); AdjustListViewColumns(); - - // Add groups and items foreach (var category in categorizedPlugins.OrderBy(c => c.Key)) { var group = new ListViewGroup(category.Key); @@ -366,16 +360,11 @@ namespace Perfect11 tweaksList.Items.Add(item); } } - - // Enable or disable run button runTweaks.Enabled = tweaksList.Items.Count > 0; } - - // Adjust column widths dynamically based on ListView client width private void AdjustListViewColumns() { if (tweaksList.Columns.Count < 2) return; - int totalWidth = tweaksList.ClientSize.Width; tweaksList.Columns[0].Width = (int)(totalWidth * 0.3); // Tweak column tweaksList.Columns[1].Width = (int)(totalWidth * 0.7); // Description column @@ -399,8 +388,8 @@ namespace Perfect11 MessageBox.Show("Select one or more plugins to run.","Perfect11",MessageBoxButtons.OK,MessageBoxIcon.Information); return; } - - Enabled = false; // prevent multiple clicks + runTweaks.Enabled = false; + _cts2 = new CancellationTokenSource(); try { foreach (ListViewItem item in tweaksList.SelectedItems) @@ -418,7 +407,8 @@ namespace Perfect11 } finally { - Enabled = true; + _cts2 = null; + runTweaks.Enabled = true; } } @@ -447,14 +437,22 @@ namespace Perfect11 MessageBox.Show("Upgrade to Windows 11 is in progress, cannot change tab.", "Perfect11", MessageBoxButtons.OK, MessageBoxIcon.Information); pages.SelectedTab = upgradePage; } + else if (pages.SelectedTab != tweaksPage && _cts2 != null) + { + pages.SelectedTab = tweaksPage; + } + else if (pages.SelectedTab != debloatPage && _cts3 != null) + { + pages.SelectedTab = tweaksPage; + } if ((pages.SelectedTab == debloatPage || pages.SelectedTab == tweaksPage) && !Utilities.IsWindows11()) { - MessageBox.Show("In order to use these features you need to upgrade to Windows 11.","Perfect11",MessageBoxButtons.OK,MessageBoxIcon.Information); + MessageBox.Show("In order to use these features you need to upgrade to Windows 11.", "Perfect11", MessageBoxButtons.OK, MessageBoxIcon.Information); pages.SelectedTab = upgradePage; } else if (pages.SelectedTab == upgradePage && Utilities.IsWindows11()) { - if (MessageBox.Show("You're already using Windows 11, there's no need to upgrade. However, this page might be useful as well for reinstallation. Are you sure to continue?", "Perfect11", MessageBoxButtons.YesNo, MessageBoxIcon.Information,MessageBoxDefaultButton.Button2) == DialogResult.No) + if (MessageBox.Show("You're already using Windows 11, there's no need to upgrade. However, this page might be useful as well for reinstallation. Are you sure to continue?", "Perfect11", MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2) == DialogResult.No) { pages.SelectedTab = welcomePage; } @@ -751,7 +749,7 @@ namespace Perfect11 private void Form1_FormClosing(object sender, FormClosingEventArgs e) { - if (_cts != null) + if (_cts != null || _cts2 != null || _cts3 != null) e.Cancel = true; } } diff --git a/Perfect11/Library/PowerShell.cs b/Perfect11/Library/PowerShell.cs index 45a2955..17ded5e 100644 --- a/Perfect11/Library/PowerShell.cs +++ b/Perfect11/Library/PowerShell.cs @@ -4,7 +4,7 @@ namespace Perfect11.Library { public class PowerShell { - public static string Execute(string command) + public string Execute(string command) { ProcessStartInfo psi = new ProcessStartInfo { diff --git a/Perfect11/Library/Utilities.cs b/Perfect11/Library/Utilities.cs index 26c406b..d6b6049 100644 --- a/Perfect11/Library/Utilities.cs +++ b/Perfect11/Library/Utilities.cs @@ -20,14 +20,14 @@ namespace Perfect11.Library } public class Utilities { - public static bool IsWindows11() + public bool IsWindows11() { string buildNumber = (string)Registry.GetValue( @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "CurrentBuildNumber", null); return int.TryParse(buildNumber, out int build) && build >= 22000; } - public static Dictionary> LoadTweaks(string path) + public Dictionary> LoadTweaks(string path) { var categorizedPlugins = new Dictionary>(StringComparer.OrdinalIgnoreCase); @@ -58,14 +58,14 @@ namespace Perfect11.Library return categorizedPlugins; } - public static bool IsAppsDarkMode() + public bool IsAppsDarkMode() { RegistryKey rk = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"); int value = (int)rk.GetValue("AppsUseLightTheme"); rk.Close(); return value == 0; } - public static string EolApp(string app) + public string EolApp(string app) { try { @@ -115,12 +115,12 @@ namespace Perfect11.Library return $"Error: {ex.Message}"; } } - public static string GetLanguageCode() + public string GetLanguageCode() { string languageCode = CultureInfo.CurrentUICulture.Name; return languageCode.ToLower(); } - public static List LoadApps(string resourceName) + public List LoadApps(string resourceName) { var assembly = Assembly.GetExecutingAssembly(); @@ -148,7 +148,7 @@ namespace Perfect11.Library } } } - public static string GetSystemArchitecture() + public string GetSystemArchitecture() { string arch = Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE"); string archWow64 = Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432"); diff --git a/Perfect11/Program.cs b/Perfect11/Program.cs index b1ace6e..4d926ee 100644 --- a/Perfect11/Program.cs +++ b/Perfect11/Program.cs @@ -4,13 +4,13 @@ using Perfect11.Library; namespace Perfect11 { - internal static class Program + internal class Program { /// /// The main entry point for the application. /// [STAThread] - static void Main() + void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); diff --git a/Perfect11/Properties/Resources.Designer.cs b/Perfect11/Properties/Resources.Designer.cs index 260bc78..15d0db2 100644 --- a/Perfect11/Properties/Resources.Designer.cs +++ b/Perfect11/Properties/Resources.Designer.cs @@ -24,9 +24,9 @@ namespace Perfect11.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { - private static global::System.Resources.ResourceManager resourceMan; + private global::System.Resources.ResourceManager resourceMan; - private static global::System.Globalization.CultureInfo resourceCulture; + private global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { @@ -36,7 +36,7 @@ namespace Perfect11.Properties { /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { + internal global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Perfect11.Properties.Resources", typeof(Resources).Assembly); @@ -51,7 +51,7 @@ namespace Perfect11.Properties { /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { + internal global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } @@ -66,7 +66,7 @@ namespace Perfect11.Properties { ///[VL] ///0. /// - internal static string EI_CFG { + internal string EI_CFG { get { return ResourceManager.GetString("EI_CFG", resourceCulture); } @@ -81,7 +81,7 @@ namespace Perfect11.Properties { /// <HideEULAPage>true</HideEULAPage> /// <HideOEMRegistrat [rest of string was truncated]";. /// - internal static string unattend_OOBEAutomate { + internal string unattend_OOBEAutomate { get { return ResourceManager.GetString("unattend_OOBEAutomate", resourceCulture); } @@ -108,7 +108,7 @@ namespace Perfect11.Properties { ///Microsoft.Services.Store.Engagement ///Microsoft.V [rest of string was truncated]";. /// - internal static string UWPSystemAppList { + internal string UWPSystemAppList { get { return ResourceManager.GetString("UWPSystemAppList", resourceCulture); } @@ -117,7 +117,7 @@ namespace Perfect11.Properties { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap win11logo { + internal System.Drawing.Bitmap win11logo { get { object obj = ResourceManager.GetObject("win11logo", resourceCulture); return ((System.Drawing.Bitmap)(obj)); @@ -127,7 +127,7 @@ namespace Perfect11.Properties { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap win11wallpaperdark { + internal System.Drawing.Bitmap win11wallpaperdark { get { object obj = ResourceManager.GetObject("win11wallpaperdark", resourceCulture); return ((System.Drawing.Bitmap)(obj)); @@ -137,7 +137,7 @@ namespace Perfect11.Properties { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap win11wallpaperlight { + internal System.Drawing.Bitmap win11wallpaperlight { get { object obj = ResourceManager.GetObject("win11wallpaperlight", resourceCulture); return ((System.Drawing.Bitmap)(obj)); diff --git a/Perfect11/Properties/Settings.Designer.cs b/Perfect11/Properties/Settings.Designer.cs index 4b7e6d9..8b2bec4 100644 --- a/Perfect11/Properties/Settings.Designer.cs +++ b/Perfect11/Properties/Settings.Designer.cs @@ -15,9 +15,9 @@ namespace Perfect11.Properties { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.14.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + private Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - public static Settings Default { + public Settings Default { get { return defaultInstance; } diff --git a/tweaks/Perfect11.Inbox.RemoveWindowsAI/Perfect11.Inbox.RemoveWindowsAI.csproj b/tweaks/Perfect11.Inbox.RemoveWindowsAI/Perfect11.Inbox.RemoveWindowsAI.csproj new file mode 100644 index 0000000..164eaf2 --- /dev/null +++ b/tweaks/Perfect11.Inbox.RemoveWindowsAI/Perfect11.Inbox.RemoveWindowsAI.csproj @@ -0,0 +1,56 @@ + + + + + Debug + AnyCPU + {BC3A0BBD-E076-426E-88C9-C36E1F6D3326} + Library + Properties + Perfect11.Inbox.RemoveWindowsAI + Perfect11.Inbox.RemoveWindowsAI + v4.8 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + none + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + {b3f8761a-b4b2-4378-9fe8-06bbfc39fce6} + Perfect11.TweaksInterface + False + + + + \ No newline at end of file diff --git a/tweaks/Perfect11.Inbox.RemoveWindowsAI/Properties/AssemblyInfo.cs b/tweaks/Perfect11.Inbox.RemoveWindowsAI/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..063b3dc --- /dev/null +++ b/tweaks/Perfect11.Inbox.RemoveWindowsAI/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Perfect11 Inbox Tweaks")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Vichingo455")] +[assembly: AssemblyProduct("Perfect11")] +[assembly: AssemblyCopyright("Copyright © 2025 Vichingo455")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("bc3a0bbd-e076-426e-88c9-c36e1f6d3326")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/tweaks/Perfect11.Inbox.RemoveWindowsAI/Tweak.cs b/tweaks/Perfect11.Inbox.RemoveWindowsAI/Tweak.cs new file mode 100644 index 0000000..be29ae9 --- /dev/null +++ b/tweaks/Perfect11.Inbox.RemoveWindowsAI/Tweak.cs @@ -0,0 +1,44 @@ +using Perfect11.TweaksInterface; +using System.Diagnostics; +using System.Windows.Forms; + +namespace Perfect11.Inbox.RemoveWindowsAI +{ + public class Tweak : IPlugin + { + public string Name => "Remove Windows AI"; + public string Description => "Remove AI components in Windows (PowerShell script by zoicware)"; + public string Category => "Privacy"; + public string Execute() + { + if (MessageBox.Show("To use this tweak, you need to agree with the following additional license terms:\r\n\r\n" + + "MIT License\r\n\r\nCopyright (c) 2024 zoicware\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all\r\ncopies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\nSOFTWARE." + + "\r\n\r\n\r\nAgree?","Perfect11",MessageBoxButtons.YesNo,MessageBoxIcon.Information,MessageBoxDefaultButton.Button2) == DialogResult.Yes) + { + string PowerShell(string command) + { + ProcessStartInfo psi = new ProcessStartInfo + { + FileName = "powershell.exe", + Arguments = $"-NoProfile -ExecutionPolicy Bypass -Command \"{command}\"", + RedirectStandardOutput = true, + RedirectStandardError = true, + UseShellExecute = false, + CreateNoWindow = true + }; + using (Process process = Process.Start(psi)) + { + string output = process.StandardOutput.ReadToEnd(); + process.WaitForExit(); + return output; + } + } + return PowerShell("& ([scriptblock]::Create((irm 'https://git.vichingo455.freeddns.org/Vichingo455/RemoveWindowsAI/raw/branch/main/RemoveWindowsAi.ps1')))"); + } + else + { + return "Operation aborted by user."; + } + } + } +} diff --git a/tweaks/Perfect11.Inbox.Spotlight/Perfect11.Inbox.Spotlight.csproj b/tweaks/Perfect11.Inbox.Spotlight/Perfect11.Inbox.Spotlight.csproj index ef9b420..20b8ac3 100644 --- a/tweaks/Perfect11.Inbox.Spotlight/Perfect11.Inbox.Spotlight.csproj +++ b/tweaks/Perfect11.Inbox.Spotlight/Perfect11.Inbox.Spotlight.csproj @@ -48,6 +48,7 @@ {b3f8761a-b4b2-4378-9fe8-06bbfc39fce6} Perfect11.TweaksInterface + False diff --git a/tweaks/Perfect11.Inbox.UninstallEdge/Perfect11.Inbox.UninstallEdge.csproj b/tweaks/Perfect11.Inbox.UninstallEdge/Perfect11.Inbox.UninstallEdge.csproj new file mode 100644 index 0000000..34bc640 --- /dev/null +++ b/tweaks/Perfect11.Inbox.UninstallEdge/Perfect11.Inbox.UninstallEdge.csproj @@ -0,0 +1,55 @@ + + + + + Debug + AnyCPU + {A33DF785-C123-48E2-B21E-A229FC8FFB55} + Library + Properties + Perfect11.Inbox.UninstallEdge + Perfect11.Inbox.UninstallEdge + v4.8 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + none + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + {b3f8761a-b4b2-4378-9fe8-06bbfc39fce6} + Perfect11.TweaksInterface + False + + + + \ No newline at end of file diff --git a/tweaks/Perfect11.Inbox.UninstallEdge/Properties/AssemblyInfo.cs b/tweaks/Perfect11.Inbox.UninstallEdge/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..3168ff9 --- /dev/null +++ b/tweaks/Perfect11.Inbox.UninstallEdge/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Perfect11 Inbox Tweaks")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Vichingo455")] +[assembly: AssemblyProduct("Perfect11")] +[assembly: AssemblyCopyright("Copyright © 2025 Vichingo455")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("a33df785-c123-48e2-b21e-a229fc8ffb55")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/tweaks/Perfect11.Inbox.UninstallEdge/Tweak.cs b/tweaks/Perfect11.Inbox.UninstallEdge/Tweak.cs new file mode 100644 index 0000000..97a5d0b --- /dev/null +++ b/tweaks/Perfect11.Inbox.UninstallEdge/Tweak.cs @@ -0,0 +1,322 @@ +using Microsoft.Win32; +using Perfect11.TweaksInterface; +using System; +using System.Diagnostics; +using System.IO; +using System.Security.Principal; + +namespace Perfect11.Inbox.UninstallEdge +{ + public class Tweak : IPlugin + { + public string Name => "Uninstall Microsoft Edge"; + public string Description => "Remove Microsoft Edge from the system."; + public string Category => "Apps"; + public string Execute() + { + void KillProcessIfRunning(string name) + { + try + { + foreach (var p in Process.GetProcessesByName(name)) + { + try { p.Kill(); } catch { } + } + } + catch { } + } + + void RunHidden(string fileName, string args) + { + try + { + var psi = new ProcessStartInfo(fileName, args) + { + CreateNoWindow = true, + UseShellExecute = false, + RedirectStandardOutput = false, + RedirectStandardError = false + }; + var p = Process.Start(psi); + p?.WaitForExit(); + } + catch { } + } + + void TryDeleteRegistryKey(RegistryKey hive, string subKey) + { + try + { + hive.DeleteSubKeyTree(subKey, throwOnMissingSubKey: false); + } + catch + { + + } + } + + void TryDeleteRegistryValue(RegistryKey hive, string subKey, string valueName) + { + try + { + using (var key = hive.OpenSubKey(subKey, writable: true)) + { + key?.DeleteValue(valueName, throwOnMissingValue: false); + } + } + catch { } + } + + void TryCreateSetValue(RegistryKey hive, string subKey, string valueName, int dwordValue, bool createIfMissing = true) + { + try + { + if (createIfMissing) + { + using (var key = hive.CreateSubKey(subKey)) + { + key?.SetValue(valueName, dwordValue, RegistryValueKind.DWord); + } + } + else + { + using (var key = hive.OpenSubKey(subKey, writable: true)) + { + key?.SetValue(valueName, dwordValue, RegistryValueKind.DWord); + } + } + } + catch { } + } + + void TryDeleteDirectory(string path) + { + try + { + if (Directory.Exists(path)) + Directory.Delete(path, recursive: true); + } + catch + { + TryTakeOwnershipAndDelete(path); + } + } + + void TryTakeOwnershipAndDelete(string path) + { + try + { + if (File.Exists(path) || Directory.Exists(path)) + { + RunHidden("takeown", $"/f \"{path}\" /a /r /d y"); + RunHidden("icacls", $"\"{path}\" /grant Everyone:F /t /c"); + try + { + if (File.Exists(path)) File.Delete(path); + else if (Directory.Exists(path)) Directory.Delete(path, true); + } + catch {} + } + } + catch { } + } + + void TryDeleteIfExists(string file) + { + try + { + if (File.Exists(file)) + File.Delete(file); + } + catch { } + } + + string GetCurrentUserSid() + { + try + { + var nt = WindowsIdentity.GetCurrent(); + return nt?.User?.Value ?? ""; + } + catch { return ""; } + } + + string[] RunPowerShellAndGetLines(string command) + { + try + { + var psi = new ProcessStartInfo("powershell", "-NoProfile -Command " + WrapForPowerShell(command)) + { + CreateNoWindow = true, + UseShellExecute = false, + RedirectStandardOutput = true, + RedirectStandardError = true + }; + var p = Process.Start(psi); + string output = p.StandardOutput.ReadToEnd(); + p.WaitForExit(); + return output.Split(new[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries); + } + catch + { + return new string[0]; + } + } + + string WrapForPowerShell(string cmd) + { + return "\"" + cmd.Replace("\"", "\\\"") + "\""; + } + + string pf = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles); + string pf86 = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86); + + bool existsInPf = Directory.Exists(Path.Combine(pf, "Microsoft\\Edge")); + bool existsInPf86 = Directory.Exists(Path.Combine(pf86, "Microsoft\\Edge")); + + if (!existsInPf && !existsInPf86) + { + throw new Exception("Microsoft Edge not found."); + } + if (existsInPf86) + { + KillProcessIfRunning("msedge"); + KillProcessIfRunning("MicrosoftEdgeUpdate"); + KillProcessIfRunning("msedgewebview2"); + TryDeleteRegistryKey(Registry.LocalMachine, @"SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge"); + TryDeleteRegistryKey(Registry.LocalMachine, @"SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge Update"); + TryDeleteRegistryKey(Registry.LocalMachine, @"SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft EdgeWebView"); + TryDeleteRegistryKey(Registry.LocalMachine, @"SOFTWARE\Microsoft\Active Setup\Installed Components\{9459C573-B17A-45AE-9F64-1857B5D58CEE}"); + TryDeleteRegistryKey(Registry.LocalMachine, @"SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate"); + TryDeleteRegistryKey(Registry.LocalMachine, @"SOFTWARE\WOW6432Node\Microsoft\Edge"); + TryDeleteRegistryKey(Registry.LocalMachine, @"SOFTWARE\WOW6432Node\Microsoft\Internet Explorer\EdgeIntegration"); + RunHidden("net", "stop MicrosoftEdgeElevationService"); + RunHidden("sc", "delete MicrosoftEdgeElevationService"); + RunHidden("net", "stop edgeupdate"); + RunHidden("sc", "delete edgeupdate"); + RunHidden("net", "stop edgeupdatem"); + RunHidden("sc", "delete edgeupdatem"); + TryDeleteDirectory(Path.Combine(pf86, "Microsoft\\Edge")); + TryDeleteDirectory(Path.Combine(pf86, "Microsoft\\EdgeCore")); + TryDeleteDirectory(Path.Combine(pf86, "Microsoft\\EdgeUpdate")); + TryDeleteDirectory(Path.Combine(pf86, "Microsoft\\EdgeWebView")); + TryDeleteDirectory(Path.Combine(pf86, "Microsoft\\Temp")); + TryDeleteDirectory(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "Microsoft\\EdgeUpdate")); + TryDeleteDirectory(Path.Combine(pf, "Microsoft\\Edge")); + TryDeleteDirectory(Path.Combine(pf, "Microsoft\\EdgeCore")); + TryDeleteDirectory(Path.Combine(pf, "Microsoft\\EdgeUpdate")); + TryDeleteDirectory(Path.Combine(pf, "Microsoft\\EdgeWebView")); + TryDeleteDirectory(Path.Combine(pf, "Microsoft\\Temp")); + TryCreateSetValue(Registry.LocalMachine, @"Software\Microsoft\EdgeUpdate", "DoNotUpdateToEdgeWithChromium", 1); + TryCreateSetValue(Registry.LocalMachine, @"Software\WOW6432Node\Microsoft\EdgeUpdate", "DoNotUpdateToEdgeWithChromium", 1); + } + else + { + KillProcessIfRunning("msedge"); + KillProcessIfRunning("MicrosoftEdgeUpdate"); + KillProcessIfRunning("msedgewebview2"); + TryDeleteRegistryKey(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge"); + TryDeleteRegistryKey(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge Update"); + TryDeleteRegistryKey(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft EdgeWebView"); + TryDeleteRegistryKey(Registry.LocalMachine, @"SOFTWARE\Microsoft\Active Setup\Installed Components\{9459C573-B17A-45AE-9F64-1857B5D58CEE}"); + TryDeleteRegistryKey(Registry.LocalMachine, @"SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate"); + TryDeleteRegistryKey(Registry.LocalMachine, @"SOFTWARE\Microsoft\Edge"); + TryDeleteRegistryKey(Registry.LocalMachine, @"SOFTWARE\Microsoft\Internet Explorer\EdgeIntegration"); + RunHidden("net", "stop MicrosoftEdgeElevationService"); + RunHidden("sc", "delete MicrosoftEdgeElevationService"); + RunHidden("net", "stop edgeupdate"); + RunHidden("sc", "delete edgeupdate"); + RunHidden("net", "stop edgeupdatem"); + RunHidden("sc", "delete edgeupdatem"); + TryDeleteDirectory(Path.Combine(pf, "Microsoft\\Edge")); + TryDeleteDirectory(Path.Combine(pf, "Microsoft\\EdgeCore")); + TryDeleteDirectory(Path.Combine(pf, "Microsoft\\EdgeUpdate")); + TryDeleteDirectory(Path.Combine(pf, "Microsoft\\EdgeWebView")); + TryDeleteDirectory(Path.Combine(pf, "Microsoft\\Temp")); + TryCreateSetValue(Registry.LocalMachine, @"Software\Microsoft\EdgeUpdate", "DoNotUpdateToEdgeWithChromium", 1); + } + TryDeleteIfExists(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "Microsoft Edge.lnk")); + TryDeleteIfExists(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonDesktopDirectory), "Microsoft Edge.lnk")); + TryDeleteIfExists(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonStartMenu), "Programs\\Microsoft Edge.lnk")); + TryDeleteIfExists(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.StartMenu), "Programs\\Microsoft Edge.lnk")); + TryDeleteIfExists(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Microsoft\\Internet Explorer\\Quick Launch\\User Pinned\\TaskBar\\Microsoft Edge.lnk")); + var systemTasksPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Windows), "System32", "Tasks"); + try + { + foreach (var f in Directory.EnumerateFiles(systemTasksPath, "*MicrosoftEdge*", SearchOption.AllDirectories)) + { + TryTakeOwnershipAndDelete(f); + } + } + catch {} + string userSid = GetCurrentUserSid(); + try + { + string psListCmd = "Get-AppxPackage -AllUsers | Where-Object { $_.PackageFullName -like '*microsoftedge*' } | Select-Object -ExpandProperty PackageFullName"; + var edgePackages = RunPowerShellAndGetLines(psListCmd); + + foreach (var pkg in edgePackages) + { + if (string.IsNullOrWhiteSpace(pkg)) continue; + string packageName = pkg.Trim(); + + if (!string.IsNullOrEmpty(userSid)) + { + TryCreateSetValue(Registry.LocalMachine, $@"SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\EndOfLife\{userSid}\{packageName}", "", 0, createIfMissing: true); + TryCreateSetValue(Registry.LocalMachine, $@"SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\EndOfLife\S-1-5-18\{packageName}", "", 0, createIfMissing: true); + TryCreateSetValue(Registry.LocalMachine, $@"SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Deprovisioned\{packageName}", "", 0, createIfMissing: true); + } + + RunHidden("powershell", $"-Command \"Remove-AppxPackage -Package '{packageName}'\" 2>$null"); + RunHidden("powershell", $"-Command \"Remove-AppxPackage -Package '{packageName}' -AllUsers\" 2>$null"); + } + } + catch {} + try + { + var sysRoot = Environment.GetFolderPath(Environment.SpecialFolder.Windows); + foreach (var f in Directory.EnumerateFiles(sysRoot, "Microsoft.MicrosoftEdge*", SearchOption.AllDirectories)) + { + TryTakeOwnershipAndDelete(f); + } + } + catch { } + + try + { + foreach (var f in Directory.EnumerateFiles(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Windows), "System32"), "MicrosoftEdge*.exe", SearchOption.AllDirectories)) + { + TryTakeOwnershipAndDelete(f); + } + } + catch { } + + try + { + foreach (var f in Directory.EnumerateFiles(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Windows), "SysWOW64"), "MicrosoftEdge*.exe", SearchOption.AllDirectories)) + { + TryTakeOwnershipAndDelete(f); + } + } + catch { } + TryDeleteRegistryKey(Registry.LocalMachine, @"SOFTWARE\Clients\StartMenuInternet\Microsoft Edge"); + TryDeleteRegistryValue(Registry.LocalMachine, @"SOFTWARE\RegisteredApplications", "Microsoft Edge"); + TryDeleteRegistryValue(Registry.LocalMachine, @"SOFTWARE\Classes\.htm\OpenWithProgIds", "MSEdgeHTM"); + TryDeleteRegistryValue(Registry.LocalMachine, @"SOFTWARE\Classes\.html\OpenWithProgIds", "MSEdgeHTM"); + TryDeleteRegistryValue(Registry.LocalMachine, @"SOFTWARE\Classes\.mht\OpenWithProgIds", "MSEdgeMHT"); + TryDeleteRegistryValue(Registry.LocalMachine, @"SOFTWARE\Classes\.mhtml\OpenWithProgIds", "MSEdgeMHT"); + TryDeleteRegistryValue(Registry.LocalMachine, @"SOFTWARE\Classes\.pdf\OpenWithProgIds", "MSEdgePDF"); + TryDeleteRegistryValue(Registry.LocalMachine, @"SOFTWARE\Classes\.shtml\OpenWithProgIds", "MSEdgeHTM"); + TryDeleteRegistryValue(Registry.LocalMachine, @"SOFTWARE\Classes\.svg\OpenWithProgIds", "MSEdgeHTM"); + TryDeleteRegistryValue(Registry.LocalMachine, @"SOFTWARE\Classes\.webp\OpenWithProgIds", "MSEdgeHTM"); + TryDeleteRegistryValue(Registry.LocalMachine, @"SOFTWARE\Classes\.xht\OpenWithProgIds", "MSEdgeHTM"); + TryDeleteRegistryValue(Registry.LocalMachine, @"SOFTWARE\Classes\.xhtml\OpenWithProgIds", "MSEdgeHTM"); + TryDeleteRegistryValue(Registry.LocalMachine, @"SOFTWARE\Classes\.xml\OpenWithProgIds", "MSEdgeHTM"); + TryDeleteRegistryKey(Registry.LocalMachine, @"SOFTWARE\WOW6432Node\Clients\StartMenuInternet\Microsoft Edge"); + TryDeleteRegistryValue(Registry.LocalMachine, @"SOFTWARE\WOW6432Node\RegisteredApplications", "Microsoft Edge"); + TryDeleteRegistryKey(Registry.LocalMachine, @"SOFTWARE\WOW6432Node\Microsoft\Edge"); + TryDeleteRegistryKey(Registry.LocalMachine, @"SOFTWARE\WOW6432Node\Microsoft\Internet Explorer\EdgeIntegration"); + return "Microsoft Edge should now be uninstalled."; + } + } +} diff --git a/tweaks/Perfect11.Inbox.UninstallOneDrive/Perfect11.Inbox.UninstallOneDrive.csproj b/tweaks/Perfect11.Inbox.UninstallOneDrive/Perfect11.Inbox.UninstallOneDrive.csproj index 8ae360b..4332a03 100644 --- a/tweaks/Perfect11.Inbox.UninstallOneDrive/Perfect11.Inbox.UninstallOneDrive.csproj +++ b/tweaks/Perfect11.Inbox.UninstallOneDrive/Perfect11.Inbox.UninstallOneDrive.csproj @@ -33,6 +33,7 @@ + diff --git a/tweaks/Perfect11.Inbox.UninstallOneDrive/Properties/AssemblyInfo.cs b/tweaks/Perfect11.Inbox.UninstallOneDrive/Properties/AssemblyInfo.cs index 006b8ba..351f556 100644 --- a/tweaks/Perfect11.Inbox.UninstallOneDrive/Properties/AssemblyInfo.cs +++ b/tweaks/Perfect11.Inbox.UninstallOneDrive/Properties/AssemblyInfo.cs @@ -5,7 +5,7 @@ using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("Perfect11 Inbox Plugins")] +[assembly: AssemblyTitle("Perfect11 Inbox Tweaks")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Vichingo455")] diff --git a/tweaks/Perfect11.Inbox.UninstallOneDrive/Tweak.cs b/tweaks/Perfect11.Inbox.UninstallOneDrive/Tweak.cs index 7d48c80..830c212 100644 --- a/tweaks/Perfect11.Inbox.UninstallOneDrive/Tweak.cs +++ b/tweaks/Perfect11.Inbox.UninstallOneDrive/Tweak.cs @@ -4,6 +4,7 @@ using System; using System.Diagnostics; using System.IO; using System.Linq; +using System.Windows.Forms; namespace Perfect11.Inbox.UninstallOneDrive { @@ -47,7 +48,10 @@ namespace Perfect11.Inbox.UninstallOneDrive string oneDrivePath = Path.Combine(dir, "OneDrive"); if (Directory.Exists(oneDrivePath) && Directory.EnumerateFileSystemEntries(oneDrivePath).Any()) { - throw new Exception("OneDrive files found, cannot continue!"); + if (MessageBox.Show("OneDrive files and/or folder was found, it might be empty or it might contain some files (who knows?). Are you sure to continue","Perfect11",MessageBoxButtons.YesNo,MessageBoxIcon.Warning,MessageBoxDefaultButton.Button2) == DialogResult.No) + { + throw new Exception("OneDrive files found, cannot continue!"); + } } } diff --git a/tweaks/Perfect11.Inbox.Widgets/Perfect11.Inbox.Widgets.csproj b/tweaks/Perfect11.Inbox.Widgets/Perfect11.Inbox.Widgets.csproj new file mode 100644 index 0000000..ff926cb --- /dev/null +++ b/tweaks/Perfect11.Inbox.Widgets/Perfect11.Inbox.Widgets.csproj @@ -0,0 +1,55 @@ + + + + + Debug + AnyCPU + {F77922A2-B913-400E-8789-4867FD1BB351} + Library + Properties + Perfect11.Inbox.Widgets + Perfect11.Inbox.Widgets + v4.8 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + none + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + {b3f8761a-b4b2-4378-9fe8-06bbfc39fce6} + Perfect11.TweaksInterface + False + + + + \ No newline at end of file diff --git a/tweaks/Perfect11.Inbox.Widgets/Properties/AssemblyInfo.cs b/tweaks/Perfect11.Inbox.Widgets/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..41987fd --- /dev/null +++ b/tweaks/Perfect11.Inbox.Widgets/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Perfect11 Inbox Tweaks")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Vichingo455")] +[assembly: AssemblyProduct("Perfect11")] +[assembly: AssemblyCopyright("Copyright © 2025 Vichingo455")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("f77922a2-b913-400e-8789-4867fd1bb351")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/tweaks/Perfect11.Inbox.Widgets/Tweak.cs b/tweaks/Perfect11.Inbox.Widgets/Tweak.cs new file mode 100644 index 0000000..d829397 --- /dev/null +++ b/tweaks/Perfect11.Inbox.Widgets/Tweak.cs @@ -0,0 +1,71 @@ +using Microsoft.Win32; +using Perfect11.TweaksInterface; + +namespace Perfect11.Inbox.Widgets +{ + public class Tweak : IPlugin + { + public string Name => "Enable/Disable Widgets"; + public string Description => "Enable or Disable Windows 11 Widgets"; + public string Category => "Annoyances"; + + public string Execute() + { + bool Enabled() + { + try + { + using (var key = Registry.CurrentUser.OpenSubKey( + @"Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced")) + { + object value = key?.GetValue("TaskbarDa"); + if (value is int intValue) + return intValue == 1; + } + } + catch { } + return true; + } + if (Enabled()) + { + using (var key = Registry.CurrentUser.CreateSubKey( + @"Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced")) + { + key?.SetValue("TaskbarDa", 0, RegistryValueKind.DWord); + } + using (var policyKey = Registry.LocalMachine.CreateSubKey( + @"SOFTWARE\Policies\Microsoft\Dsh")) + { + policyKey?.SetValue("AllowNewsAndInterests", 0, RegistryValueKind.DWord); + } + using (var taskbarKey = Registry.CurrentUser.CreateSubKey( + @"Software\Microsoft\Windows\CurrentVersion\Feeds")) + { + taskbarKey?.SetValue("ShellFeedsTaskbarViewMode", 2, RegistryValueKind.DWord); + } + return "Widgets have been disabled successfully! Please consider to restart File Explorer or log off and log back in for changes to apply."; + } + else + { + using (var key = Registry.CurrentUser.CreateSubKey( + @"Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced")) + { + key?.SetValue("TaskbarDa", 1, RegistryValueKind.DWord); + } + + using (var policyKey = Registry.LocalMachine.CreateSubKey( + @"SOFTWARE\Policies\Microsoft\Dsh")) + { + policyKey?.SetValue("AllowNewsAndInterests", 1, RegistryValueKind.DWord); + } + + using (var taskbarKey = Registry.CurrentUser.CreateSubKey( + @"Software\Microsoft\Windows\CurrentVersion\Feeds")) + { + taskbarKey?.SetValue("ShellFeedsTaskbarViewMode", 0, RegistryValueKind.DWord); + } + return "Widgets have been enabled successfully! Please consider to restart File Explorer or log off and log back in for changes to apply."; + } + } + } +} From 3601baea19542386ee7c0d4a35633f778b833b5c Mon Sep 17 00:00:00 2001 From: theitaliandeveloper Date: Wed, 29 Oct 2025 13:11:13 +0100 Subject: [PATCH 2/3] bruh --- Perfect11/Library/PowerShell.cs | 2 +- Perfect11/Library/Utilities.cs | 14 +++++++------- Perfect11/Perfect11.csproj | 3 ++- Perfect11/Program.cs | 2 +- Perfect11/Properties/Resources.Designer.cs | 20 ++++++++++---------- 5 files changed, 21 insertions(+), 20 deletions(-) diff --git a/Perfect11/Library/PowerShell.cs b/Perfect11/Library/PowerShell.cs index 17ded5e..45a2955 100644 --- a/Perfect11/Library/PowerShell.cs +++ b/Perfect11/Library/PowerShell.cs @@ -4,7 +4,7 @@ namespace Perfect11.Library { public class PowerShell { - public string Execute(string command) + public static string Execute(string command) { ProcessStartInfo psi = new ProcessStartInfo { diff --git a/Perfect11/Library/Utilities.cs b/Perfect11/Library/Utilities.cs index d6b6049..26c406b 100644 --- a/Perfect11/Library/Utilities.cs +++ b/Perfect11/Library/Utilities.cs @@ -20,14 +20,14 @@ namespace Perfect11.Library } public class Utilities { - public bool IsWindows11() + public static bool IsWindows11() { string buildNumber = (string)Registry.GetValue( @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "CurrentBuildNumber", null); return int.TryParse(buildNumber, out int build) && build >= 22000; } - public Dictionary> LoadTweaks(string path) + public static Dictionary> LoadTweaks(string path) { var categorizedPlugins = new Dictionary>(StringComparer.OrdinalIgnoreCase); @@ -58,14 +58,14 @@ namespace Perfect11.Library return categorizedPlugins; } - public bool IsAppsDarkMode() + public static bool IsAppsDarkMode() { RegistryKey rk = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"); int value = (int)rk.GetValue("AppsUseLightTheme"); rk.Close(); return value == 0; } - public string EolApp(string app) + public static string EolApp(string app) { try { @@ -115,12 +115,12 @@ namespace Perfect11.Library return $"Error: {ex.Message}"; } } - public string GetLanguageCode() + public static string GetLanguageCode() { string languageCode = CultureInfo.CurrentUICulture.Name; return languageCode.ToLower(); } - public List LoadApps(string resourceName) + public static List LoadApps(string resourceName) { var assembly = Assembly.GetExecutingAssembly(); @@ -148,7 +148,7 @@ namespace Perfect11.Library } } } - public string GetSystemArchitecture() + public static string GetSystemArchitecture() { string arch = Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE"); string archWow64 = Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432"); diff --git a/Perfect11/Perfect11.csproj b/Perfect11/Perfect11.csproj index e30ffe2..b945a3c 100644 --- a/Perfect11/Perfect11.csproj +++ b/Perfect11/Perfect11.csproj @@ -58,7 +58,8 @@ Simpleicons-Team-Simple-Windows-11.ico - + + diff --git a/Perfect11/Program.cs b/Perfect11/Program.cs index 4d926ee..6f8b7a7 100644 --- a/Perfect11/Program.cs +++ b/Perfect11/Program.cs @@ -10,7 +10,7 @@ namespace Perfect11 /// The main entry point for the application. /// [STAThread] - void Main() + static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); diff --git a/Perfect11/Properties/Resources.Designer.cs b/Perfect11/Properties/Resources.Designer.cs index 15d0db2..260bc78 100644 --- a/Perfect11/Properties/Resources.Designer.cs +++ b/Perfect11/Properties/Resources.Designer.cs @@ -24,9 +24,9 @@ namespace Perfect11.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { - private global::System.Resources.ResourceManager resourceMan; + private static global::System.Resources.ResourceManager resourceMan; - private global::System.Globalization.CultureInfo resourceCulture; + private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { @@ -36,7 +36,7 @@ namespace Perfect11.Properties { /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal global::System.Resources.ResourceManager ResourceManager { + internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Perfect11.Properties.Resources", typeof(Resources).Assembly); @@ -51,7 +51,7 @@ namespace Perfect11.Properties { /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal global::System.Globalization.CultureInfo Culture { + internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } @@ -66,7 +66,7 @@ namespace Perfect11.Properties { ///[VL] ///0. /// - internal string EI_CFG { + internal static string EI_CFG { get { return ResourceManager.GetString("EI_CFG", resourceCulture); } @@ -81,7 +81,7 @@ namespace Perfect11.Properties { /// <HideEULAPage>true</HideEULAPage> /// <HideOEMRegistrat [rest of string was truncated]";. /// - internal string unattend_OOBEAutomate { + internal static string unattend_OOBEAutomate { get { return ResourceManager.GetString("unattend_OOBEAutomate", resourceCulture); } @@ -108,7 +108,7 @@ namespace Perfect11.Properties { ///Microsoft.Services.Store.Engagement ///Microsoft.V [rest of string was truncated]";. /// - internal string UWPSystemAppList { + internal static string UWPSystemAppList { get { return ResourceManager.GetString("UWPSystemAppList", resourceCulture); } @@ -117,7 +117,7 @@ namespace Perfect11.Properties { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal System.Drawing.Bitmap win11logo { + internal static System.Drawing.Bitmap win11logo { get { object obj = ResourceManager.GetObject("win11logo", resourceCulture); return ((System.Drawing.Bitmap)(obj)); @@ -127,7 +127,7 @@ namespace Perfect11.Properties { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal System.Drawing.Bitmap win11wallpaperdark { + internal static System.Drawing.Bitmap win11wallpaperdark { get { object obj = ResourceManager.GetObject("win11wallpaperdark", resourceCulture); return ((System.Drawing.Bitmap)(obj)); @@ -137,7 +137,7 @@ namespace Perfect11.Properties { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal System.Drawing.Bitmap win11wallpaperlight { + internal static System.Drawing.Bitmap win11wallpaperlight { get { object obj = ResourceManager.GetObject("win11wallpaperlight", resourceCulture); return ((System.Drawing.Bitmap)(obj)); From 09b00a5f85e61d0dd3e23f32383482c0cba049be Mon Sep 17 00:00:00 2001 From: theitaliandeveloper Date: Wed, 29 Oct 2025 13:37:05 +0100 Subject: [PATCH 3/3] Stuff --- Perfect11.sln | 6 ++ Perfect11/Library/Utilities.cs | 8 --- Perfect11/Properties/Resources.resx | 3 + .../Perfect11.Inbox.DisableVBS.csproj | 55 +++++++++++++++ .../Properties/AssemblyInfo.cs | 33 +++++++++ tweaks/Perfect11.Inbox.DisableVBS/Tweak.cs | 70 +++++++++++++++++++ .../Perfect11.Inbox.RemoveWindowsAI/Tweak.cs | 3 +- 7 files changed, 169 insertions(+), 9 deletions(-) create mode 100644 tweaks/Perfect11.Inbox.DisableVBS/Perfect11.Inbox.DisableVBS.csproj create mode 100644 tweaks/Perfect11.Inbox.DisableVBS/Properties/AssemblyInfo.cs create mode 100644 tweaks/Perfect11.Inbox.DisableVBS/Tweak.cs diff --git a/Perfect11.sln b/Perfect11.sln index 69c9905..615c708 100644 --- a/Perfect11.sln +++ b/Perfect11.sln @@ -21,6 +21,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perfect11.Inbox.Widgets", " EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perfect11.Inbox.UninstallEdge", "tweaks\Perfect11.Inbox.UninstallEdge\Perfect11.Inbox.UninstallEdge.csproj", "{A33DF785-C123-48E2-B21E-A229FC8FFB55}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perfect11.Inbox.DisableVBS", "tweaks\Perfect11.Inbox.DisableVBS\Perfect11.Inbox.DisableVBS.csproj", "{998241DA-25C9-4CB6-B893-7158A387C030}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -63,6 +65,10 @@ Global {A33DF785-C123-48E2-B21E-A229FC8FFB55}.Debug|Any CPU.Build.0 = Debug|Any CPU {A33DF785-C123-48E2-B21E-A229FC8FFB55}.Release|Any CPU.ActiveCfg = Release|Any CPU {A33DF785-C123-48E2-B21E-A229FC8FFB55}.Release|Any CPU.Build.0 = Release|Any CPU + {998241DA-25C9-4CB6-B893-7158A387C030}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {998241DA-25C9-4CB6-B893-7158A387C030}.Debug|Any CPU.Build.0 = Debug|Any CPU + {998241DA-25C9-4CB6-B893-7158A387C030}.Release|Any CPU.ActiveCfg = Release|Any CPU + {998241DA-25C9-4CB6-B893-7158A387C030}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Perfect11/Library/Utilities.cs b/Perfect11/Library/Utilities.cs index 26c406b..60ff62a 100644 --- a/Perfect11/Library/Utilities.cs +++ b/Perfect11/Library/Utilities.cs @@ -69,26 +69,19 @@ namespace Perfect11.Library { try { - // Use your PowerShell.Execute helper string packageFullName = PowerShell.Execute( "Get-AppxPackage -AllUsers | Where-Object { $_.PackageFullName -like '*" + app +"*' } | Select-Object -ExpandProperty PackageFullName" ); - if (string.IsNullOrWhiteSpace(packageFullName)) { return "Sticky Notes package not found."; } - Console.WriteLine($"Found package: {packageFullName}"); - - // Get current user SID string userSid = WindowsIdentity.GetCurrent().User?.Value; if (string.IsNullOrEmpty(userSid)) { return "Unable to get current user SID."; } - - // Registry base path string basePath = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore"; string[] subKeys = { @@ -96,7 +89,6 @@ namespace Perfect11.Library $@"EndOfLife\S-1-5-18\{packageFullName}", $@"Deprovisioned\{packageFullName}" }; - foreach (var subKey in subKeys) { try diff --git a/Perfect11/Properties/Resources.resx b/Perfect11/Properties/Resources.resx index f348e7a..4e9ef1a 100644 --- a/Perfect11/Properties/Resources.resx +++ b/Perfect11/Properties/Resources.resx @@ -120,12 +120,15 @@ ..\Resources\EI.CFG.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 + EI.CFG for Windows ..\Resources\unattend-OOBEAutomate.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 + Unattend.xml for OOBE automation ..\Resources\UWPSystemAppList.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + List of UWP System Apps ..\Resources\Images\win11logo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a diff --git a/tweaks/Perfect11.Inbox.DisableVBS/Perfect11.Inbox.DisableVBS.csproj b/tweaks/Perfect11.Inbox.DisableVBS/Perfect11.Inbox.DisableVBS.csproj new file mode 100644 index 0000000..ae4ea70 --- /dev/null +++ b/tweaks/Perfect11.Inbox.DisableVBS/Perfect11.Inbox.DisableVBS.csproj @@ -0,0 +1,55 @@ + + + + + Debug + AnyCPU + {998241DA-25C9-4CB6-B893-7158A387C030} + Library + Properties + Perfect11.Inbox.DisableVBS + Perfect11.Inbox.DisableVBS + v4.8 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + none + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + {b3f8761a-b4b2-4378-9fe8-06bbfc39fce6} + Perfect11.TweaksInterface + False + + + + \ No newline at end of file diff --git a/tweaks/Perfect11.Inbox.DisableVBS/Properties/AssemblyInfo.cs b/tweaks/Perfect11.Inbox.DisableVBS/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..93215aa --- /dev/null +++ b/tweaks/Perfect11.Inbox.DisableVBS/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Perfect11 Inbox Tweaks")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Vichingo455")] +[assembly: AssemblyProduct("Perfect11")] +[assembly: AssemblyCopyright("Copyright © 2025 Vichingo455")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("998241da-25c9-4cb6-b893-7158a387c030")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/tweaks/Perfect11.Inbox.DisableVBS/Tweak.cs b/tweaks/Perfect11.Inbox.DisableVBS/Tweak.cs new file mode 100644 index 0000000..879bc2e --- /dev/null +++ b/tweaks/Perfect11.Inbox.DisableVBS/Tweak.cs @@ -0,0 +1,70 @@ +using Microsoft.Win32; +using Perfect11.TweaksInterface; +using System; +using System.Diagnostics; +using System.IO; + +namespace Perfect11.Inbox.DisableVBS +{ + public class Tweak : IPlugin + { + public string Name => "Disable VBS"; + public string Description => "Disables Virtualization Based Security and Credential Guard (requires additional steps)"; + public string Category => "Annoyances"; + public string Execute() + { + void RunCommand(string command) + { + var psi = new ProcessStartInfo("cmd.exe", "/c " + command) + { + RedirectStandardOutput = true, + RedirectStandardError = true, + UseShellExecute = false, + CreateNoWindow = true, + //Verb = "runas" + }; + + using (var process = Process.Start(psi)) + { + process.WaitForExit(); + if (process.ExitCode != 0) + { + throw new InvalidOperationException($"Comando fallito: {command}"); + } + } + } + try + { + Registry.SetValue( + @"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa", + "LsaCfgFlags", + 0, + RegistryValueKind.DWord + ); + Registry.SetValue( + @"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard", + "LsaCfgFlags", + 0, + RegistryValueKind.DWord + ); + RunCommand("mountvol X: /s"); + string windowsDir = Environment.GetFolderPath(Environment.SpecialFolder.Windows); + string source = Path.Combine(windowsDir, @"System32\SecConfig.efi"); + string dest = @"X:\EFI\Microsoft\Boot\SecConfig.efi"; + Directory.CreateDirectory(Path.GetDirectoryName(dest)); + File.Copy(source, dest, true); + RunCommand(@"bcdedit /create {0cb3b571-2f2e-4343-a879-d86a476d7215} /d ""DebugTool"" /application osloader"); + RunCommand(@"bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} path ""\EFI\Microsoft\Boot\SecConfig.efi"""); + RunCommand(@"bcdedit /set {bootmgr} bootsequence {0cb3b571-2f2e-4343-a879-d86a476d7215}"); + RunCommand(@"bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} loadoptions DISABLE-LSA-ISO,DISABLE-VBS"); + RunCommand(@"bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} device partition=X:"); + RunCommand("mountvol X: /d"); + return "Disabling Credential Guard is almost done!\r\nNow, restart your system and when asked, press F3 or the Windows key to disable both credential guard and virtualization based security.\r\nAfter reboot, you might need to set up your PIN again."; + } + catch (Exception ex) + { + throw new Exception("Error: " + ex.Message); + } + } + } +} diff --git a/tweaks/Perfect11.Inbox.RemoveWindowsAI/Tweak.cs b/tweaks/Perfect11.Inbox.RemoveWindowsAI/Tweak.cs index be29ae9..f0b1ab1 100644 --- a/tweaks/Perfect11.Inbox.RemoveWindowsAI/Tweak.cs +++ b/tweaks/Perfect11.Inbox.RemoveWindowsAI/Tweak.cs @@ -1,4 +1,5 @@ using Perfect11.TweaksInterface; +using System; using System.Diagnostics; using System.Windows.Forms; @@ -37,7 +38,7 @@ namespace Perfect11.Inbox.RemoveWindowsAI } else { - return "Operation aborted by user."; + throw new Exception("Operation aborted by user."); } } }