diff --git a/Perfect11.sln b/Perfect11.sln index cb4de19..615c708 100644 --- a/Perfect11.sln +++ b/Perfect11.sln @@ -15,6 +15,14 @@ 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 +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 @@ -45,6 +53,22 @@ 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 + {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/Form1.Designer.cs b/Perfect11/Form1.Designer.cs index f9d0a07..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; @@ -144,7 +144,7 @@ this.welcomePage.Controls.Add(this.poisonLabel1); this.welcomePage.HorizontalScrollbarBarColor = true; this.welcomePage.HorizontalScrollbarHighlightOnWheel = false; - this.welcomePage.HorizontalScrollbarSize = 4; + this.welcomePage.HorizontalScrollbarSize = 9; this.welcomePage.Location = new System.Drawing.Point(4, 38); this.welcomePage.Name = "welcomePage"; this.welcomePage.Size = new System.Drawing.Size(1315, 690); @@ -152,13 +152,16 @@ this.welcomePage.Text = "Welcome"; this.welcomePage.VerticalScrollbarBarColor = true; this.welcomePage.VerticalScrollbarHighlightOnWheel = false; - this.welcomePage.VerticalScrollbarSize = 23; + this.welcomePage.VerticalScrollbarSize = 51; // // 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 // @@ -205,7 +213,7 @@ this.upgradePage.Controls.Add(this.poisonLabel4); this.upgradePage.HorizontalScrollbarBarColor = true; this.upgradePage.HorizontalScrollbarHighlightOnWheel = false; - this.upgradePage.HorizontalScrollbarSize = 4; + this.upgradePage.HorizontalScrollbarSize = 10; this.upgradePage.Location = new System.Drawing.Point(4, 38); this.upgradePage.Name = "upgradePage"; this.upgradePage.Size = new System.Drawing.Size(1315, 690); @@ -213,7 +221,7 @@ this.upgradePage.Text = "Upgrade"; this.upgradePage.VerticalScrollbarBarColor = true; this.upgradePage.VerticalScrollbarHighlightOnWheel = false; - this.upgradePage.VerticalScrollbarSize = 5; + this.upgradePage.VerticalScrollbarSize = 10; // // statusLabel // @@ -362,7 +370,7 @@ this.debloatPage.Controls.Add(this.LstUWP); this.debloatPage.HorizontalScrollbarBarColor = true; this.debloatPage.HorizontalScrollbarHighlightOnWheel = false; - this.debloatPage.HorizontalScrollbarSize = 4; + this.debloatPage.HorizontalScrollbarSize = 9; this.debloatPage.Location = new System.Drawing.Point(4, 38); this.debloatPage.Name = "debloatPage"; this.debloatPage.Size = new System.Drawing.Size(1315, 690); @@ -370,7 +378,7 @@ this.debloatPage.Text = "Debloat"; this.debloatPage.VerticalScrollbarBarColor = true; this.debloatPage.VerticalScrollbarHighlightOnWheel = false; - this.debloatPage.VerticalScrollbarSize = 14; + this.debloatPage.VerticalScrollbarSize = 31; // // BtnRunUninstaller // @@ -500,7 +508,7 @@ this.tweaksPage.Controls.Add(this.tweaksList); this.tweaksPage.HorizontalScrollbarBarColor = true; this.tweaksPage.HorizontalScrollbarHighlightOnWheel = false; - this.tweaksPage.HorizontalScrollbarSize = 4; + this.tweaksPage.HorizontalScrollbarSize = 9; this.tweaksPage.Location = new System.Drawing.Point(4, 38); this.tweaksPage.Name = "tweaksPage"; this.tweaksPage.Size = new System.Drawing.Size(1315, 690); @@ -508,7 +516,7 @@ this.tweaksPage.Text = "Tweak"; this.tweaksPage.VerticalScrollbarBarColor = true; this.tweaksPage.VerticalScrollbarHighlightOnWheel = false; - this.tweaksPage.VerticalScrollbarSize = 5; + this.tweaksPage.VerticalScrollbarSize = 12; // // runTweaks // @@ -541,17 +549,18 @@ // 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 // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 21F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(41)))), ((int)(((byte)(50))))); this.ClientSize = new System.Drawing.Size(1329, 788); 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/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/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 b1ace6e..6f8b7a7 100644 --- a/Perfect11/Program.cs +++ b/Perfect11/Program.cs @@ -4,7 +4,7 @@ using Perfect11.Library; namespace Perfect11 { - internal static class Program + internal class Program { /// /// The main entry point for the application. 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/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.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/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..f0b1ab1 --- /dev/null +++ b/tweaks/Perfect11.Inbox.RemoveWindowsAI/Tweak.cs @@ -0,0 +1,45 @@ +using Perfect11.TweaksInterface; +using System; +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 + { + throw new Exception("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."; + } + } + } +}