A lot of things

This commit is contained in:
2025-10-28 19:02:19 +01:00
parent 393ef60c82
commit 47cff5e7f6
21 changed files with 794 additions and 60 deletions

View File

@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{BC3A0BBD-E076-426E-88C9-C36E1F6D3326}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Perfect11.Inbox.RemoveWindowsAI</RootNamespace>
<AssemblyName>Perfect11.Inbox.RemoveWindowsAI</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Tweak.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Perfect11.TweaksInterface\Perfect11.TweaksInterface.csproj">
<Project>{b3f8761a-b4b2-4378-9fe8-06bbfc39fce6}</Project>
<Name>Perfect11.TweaksInterface</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -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")]

View File

@@ -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.";
}
}
}
}

View File

@@ -48,6 +48,7 @@
<ProjectReference Include="..\..\Perfect11.TweaksInterface\Perfect11.TweaksInterface.csproj">
<Project>{b3f8761a-b4b2-4378-9fe8-06bbfc39fce6}</Project>
<Name>Perfect11.TweaksInterface</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

View File

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{A33DF785-C123-48E2-B21E-A229FC8FFB55}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Perfect11.Inbox.UninstallEdge</RootNamespace>
<AssemblyName>Perfect11.Inbox.UninstallEdge</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Tweak.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Perfect11.TweaksInterface\Perfect11.TweaksInterface.csproj">
<Project>{b3f8761a-b4b2-4378-9fe8-06bbfc39fce6}</Project>
<Name>Perfect11.TweaksInterface</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -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")]

View File

@@ -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.";
}
}
}

View File

@@ -33,6 +33,7 @@
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />

View File

@@ -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")]

View File

@@ -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!");
}
}
}

View File

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{F77922A2-B913-400E-8789-4867FD1BB351}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Perfect11.Inbox.Widgets</RootNamespace>
<AssemblyName>Perfect11.Inbox.Widgets</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Tweak.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Perfect11.TweaksInterface\Perfect11.TweaksInterface.csproj">
<Project>{b3f8761a-b4b2-4378-9fe8-06bbfc39fce6}</Project>
<Name>Perfect11.TweaksInterface</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -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")]

View File

@@ -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.";
}
}
}
}