This commit is contained in:
2025-10-18 16:47:57 +02:00
parent cebdfef45f
commit b8c45f39f4
8 changed files with 183 additions and 43 deletions

View File

@@ -11,6 +11,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perfect11.Inbox.UninstallOn
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perfect11.Inbox.ManageTelemetry", "tweaks\Perfect11.Inbox.ManageTelemetry\Perfect11.Inbox.ManageTelemetry.csproj", "{2F175C96-FDBA-49D8-BE83-1998C1F75FA2}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perfect11.Inbox.ManageTelemetry", "tweaks\Perfect11.Inbox.ManageTelemetry\Perfect11.Inbox.ManageTelemetry.csproj", "{2F175C96-FDBA-49D8-BE83-1998C1F75FA2}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perfect11.Inbox.DisableAds", "tweaks\Perfect11.Inbox.DisableAds\Perfect11.Inbox.DisableAds.csproj", "{0BCF623D-B134-4824-9167-2F0A39532BDD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perfect11.Inbox.Spotlight", "tweaks\Perfect11.Inbox.Spotlight\Perfect11.Inbox.Spotlight.csproj", "{77376E26-3164-4ED7-9F85-02B3AEBFC751}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@@ -33,6 +37,14 @@ Global
{2F175C96-FDBA-49D8-BE83-1998C1F75FA2}.Debug|Any CPU.Build.0 = Debug|Any CPU {2F175C96-FDBA-49D8-BE83-1998C1F75FA2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2F175C96-FDBA-49D8-BE83-1998C1F75FA2}.Release|Any CPU.ActiveCfg = Release|Any CPU {2F175C96-FDBA-49D8-BE83-1998C1F75FA2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2F175C96-FDBA-49D8-BE83-1998C1F75FA2}.Release|Any CPU.Build.0 = Release|Any CPU {2F175C96-FDBA-49D8-BE83-1998C1F75FA2}.Release|Any CPU.Build.0 = Release|Any CPU
{0BCF623D-B134-4824-9167-2F0A39532BDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0BCF623D-B134-4824-9167-2F0A39532BDD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0BCF623D-B134-4824-9167-2F0A39532BDD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0BCF623D-B134-4824-9167-2F0A39532BDD}.Release|Any CPU.Build.0 = Release|Any CPU
{77376E26-3164-4ED7-9F85-02B3AEBFC751}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{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
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@@ -51,6 +51,7 @@
this.tweaksPage = new ReaLTaiizor.Controls.PoisonTabPage(); this.tweaksPage = new ReaLTaiizor.Controls.PoisonTabPage();
this.runTweaks = new ReaLTaiizor.Controls.PoisonButton(); this.runTweaks = new ReaLTaiizor.Controls.PoisonButton();
this.tweaksList = new ReaLTaiizor.Controls.PoisonListView(); this.tweaksList = new ReaLTaiizor.Controls.PoisonListView();
this.githubLink = new ReaLTaiizor.Controls.PoisonLinkLabel();
this.theme.SuspendLayout(); this.theme.SuspendLayout();
this.pages.SuspendLayout(); this.pages.SuspendLayout();
this.welcomePage.SuspendLayout(); this.welcomePage.SuspendLayout();
@@ -62,8 +63,10 @@
// theme // theme
// //
this.theme.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(41)))), ((int)(((byte)(50))))); this.theme.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(41)))), ((int)(((byte)(50)))));
this.theme.Controls.Add(this.githubLink);
this.theme.Controls.Add(this.controlBoxEdit1); this.theme.Controls.Add(this.controlBoxEdit1);
this.theme.Controls.Add(this.pages); this.theme.Controls.Add(this.pages);
this.theme.Controls.Add(this.editionLabel);
this.theme.Dock = System.Windows.Forms.DockStyle.Fill; this.theme.Dock = System.Windows.Forms.DockStyle.Fill;
this.theme.Font = new System.Drawing.Font("Segoe UI", 8F); this.theme.Font = new System.Drawing.Font("Segoe UI", 8F);
this.theme.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(142)))), ((int)(((byte)(142)))), ((int)(((byte)(142))))); this.theme.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(142)))), ((int)(((byte)(142)))), ((int)(((byte)(142)))));
@@ -97,7 +100,7 @@
this.pages.Dock = System.Windows.Forms.DockStyle.Fill; this.pages.Dock = System.Windows.Forms.DockStyle.Fill;
this.pages.Location = new System.Drawing.Point(3, 28); this.pages.Location = new System.Drawing.Point(3, 28);
this.pages.Name = "pages"; this.pages.Name = "pages";
this.pages.SelectedIndex = 1; this.pages.SelectedIndex = 0;
this.pages.Size = new System.Drawing.Size(1323, 732); this.pages.Size = new System.Drawing.Size(1323, 732);
this.pages.TabIndex = 1; this.pages.TabIndex = 1;
this.pages.UseSelectable = true; this.pages.UseSelectable = true;
@@ -106,7 +109,6 @@
// //
this.welcomePage.BackgroundImage = global::Perfect11.Properties.Resources.win11wallpaperdark; this.welcomePage.BackgroundImage = global::Perfect11.Properties.Resources.win11wallpaperdark;
this.welcomePage.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.welcomePage.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.welcomePage.Controls.Add(this.editionLabel);
this.welcomePage.Controls.Add(this.poisonLabel2); this.welcomePage.Controls.Add(this.poisonLabel2);
this.welcomePage.Controls.Add(this.pictureBox1); this.welcomePage.Controls.Add(this.pictureBox1);
this.welcomePage.Controls.Add(this.poisonLabel1); this.welcomePage.Controls.Add(this.poisonLabel1);
@@ -126,7 +128,7 @@
// //
this.editionLabel.AutoSize = true; this.editionLabel.AutoSize = true;
this.editionLabel.BackColor = System.Drawing.Color.Transparent; this.editionLabel.BackColor = System.Drawing.Color.Transparent;
this.editionLabel.Location = new System.Drawing.Point(16, 656); this.editionLabel.Location = new System.Drawing.Point(12, 763);
this.editionLabel.Name = "editionLabel"; this.editionLabel.Name = "editionLabel";
this.editionLabel.Size = new System.Drawing.Size(175, 19); this.editionLabel.Size = new System.Drawing.Size(175, 19);
this.editionLabel.TabIndex = 4; this.editionLabel.TabIndex = 4;
@@ -139,10 +141,10 @@
this.poisonLabel2.BackColor = System.Drawing.Color.Transparent; this.poisonLabel2.BackColor = System.Drawing.Color.Transparent;
this.poisonLabel2.Location = new System.Drawing.Point(416, 379); this.poisonLabel2.Location = new System.Drawing.Point(416, 379);
this.poisonLabel2.Name = "poisonLabel2"; this.poisonLabel2.Name = "poisonLabel2";
this.poisonLabel2.Size = new System.Drawing.Size(465, 38); this.poisonLabel2.Size = new System.Drawing.Size(459, 38);
this.poisonLabel2.TabIndex = 3; this.poisonLabel2.TabIndex = 3;
this.poisonLabel2.Text = "Perfect11 is a tool made by a guy who loves to optimize Windows.\r\nIt allows to in" + this.poisonLabel2.Text = "Perfect11 is a tool made by a guy who loves to optimize Windows.\r\nIt allows to in" +
"stalls apps, remove bloatware, configure services and even more."; "stalls apps, remove bloatware, tweak the system and even more.";
this.poisonLabel2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.poisonLabel2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.poisonLabel2.UseCustomBackColor = true; this.poisonLabel2.UseCustomBackColor = true;
// //
@@ -344,14 +346,12 @@
// //
// tweaksList // tweaksList
// //
this.tweaksList.AllowSorting = true;
this.tweaksList.Font = new System.Drawing.Font("Segoe UI", 12F); this.tweaksList.Font = new System.Drawing.Font("Segoe UI", 12F);
this.tweaksList.FullRowSelect = true; this.tweaksList.FullRowSelect = true;
this.tweaksList.Location = new System.Drawing.Point(0, 0); this.tweaksList.Location = new System.Drawing.Point(0, 0);
this.tweaksList.Name = "tweaksList"; this.tweaksList.Name = "tweaksList";
this.tweaksList.OwnerDraw = true; this.tweaksList.OwnerDraw = true;
this.tweaksList.Size = new System.Drawing.Size(1310, 617); this.tweaksList.Size = new System.Drawing.Size(1310, 617);
this.tweaksList.Sorting = System.Windows.Forms.SortOrder.Ascending;
this.tweaksList.TabIndex = 2; this.tweaksList.TabIndex = 2;
this.tweaksList.UseCompatibleStateImageBehavior = false; this.tweaksList.UseCompatibleStateImageBehavior = false;
this.tweaksList.UseCustomBackColor = true; this.tweaksList.UseCustomBackColor = true;
@@ -360,6 +360,21 @@
this.tweaksList.UseStyleColors = true; this.tweaksList.UseStyleColors = true;
this.tweaksList.Resize += new System.EventHandler(this.tweaksList_Resize); this.tweaksList.Resize += new System.EventHandler(this.tweaksList_Resize);
// //
// githubLink
//
this.githubLink.BackColor = System.Drawing.Color.Transparent;
this.githubLink.Cursor = System.Windows.Forms.Cursors.Hand;
this.githubLink.Location = new System.Drawing.Point(1275, 762);
this.githubLink.Name = "githubLink";
this.githubLink.Size = new System.Drawing.Size(48, 26);
this.githubLink.TabIndex = 5;
this.githubLink.Text = "GitHub";
this.githubLink.UseCustomBackColor = true;
this.githubLink.UseCustomForeColor = true;
this.githubLink.UseSelectable = true;
this.githubLink.UseStyleColors = true;
this.githubLink.Click += new System.EventHandler(this.githubLink_Click);
//
// Form1 // Form1
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 21F); this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 21F);
@@ -377,6 +392,7 @@
this.TransparencyKey = System.Drawing.Color.Fuchsia; this.TransparencyKey = System.Drawing.Color.Fuchsia;
this.Load += new System.EventHandler(this.Form1_Load); this.Load += new System.EventHandler(this.Form1_Load);
this.theme.ResumeLayout(false); this.theme.ResumeLayout(false);
this.theme.PerformLayout();
this.pages.ResumeLayout(false); this.pages.ResumeLayout(false);
this.welcomePage.ResumeLayout(false); this.welcomePage.ResumeLayout(false);
this.welcomePage.PerformLayout(); this.welcomePage.PerformLayout();
@@ -412,6 +428,7 @@
private ReaLTaiizor.Controls.PoisonListView tweaksList; private ReaLTaiizor.Controls.PoisonListView tweaksList;
private ReaLTaiizor.Controls.PoisonButton runTweaks; private ReaLTaiizor.Controls.PoisonButton runTweaks;
private ReaLTaiizor.Controls.PoisonLabel editionLabel; private ReaLTaiizor.Controls.PoisonLabel editionLabel;
private ReaLTaiizor.Controls.PoisonLinkLabel githubLink;
} }
} }

View File

@@ -5,6 +5,7 @@ using ReaLTaiizor.Enum.Poison;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data; using System.Data;
using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
@@ -56,6 +57,7 @@ namespace Perfect11
tweaksList.BackColor = Color.FromArgb(17, 17, 17); tweaksList.BackColor = Color.FromArgb(17, 17, 17);
poisonLabel1.ForeColor = Color.FromArgb(255, 255, 255); poisonLabel1.ForeColor = Color.FromArgb(255, 255, 255);
poisonLabel2.ForeColor = Color.FromArgb(255, 255, 255); poisonLabel2.ForeColor = Color.FromArgb(255, 255, 255);
githubLink.Theme = ThemeStyle.Dark;
} }
else else
{ {
@@ -82,13 +84,14 @@ namespace Perfect11
LstUWP.BackColor = Color.FromArgb(255,255,255); LstUWP.BackColor = Color.FromArgb(255,255,255);
LstUWPRemove.BackColor = Color.FromArgb(255,255,255); LstUWPRemove.BackColor = Color.FromArgb(255,255,255);
tweaksList.BackColor = Color.FromArgb(255,255,255); tweaksList.BackColor = Color.FromArgb(255,255,255);
githubLink.Theme = ThemeStyle.Light;
} }
} }
private void Form1_Load(object sender, EventArgs e) private void Form1_Load(object sender, EventArgs e)
{ {
pages.SelectedTab = welcomePage; // Always start from the first tab pages.SelectedTab = welcomePage; // Always start from the first tab
editionLabel.Text = AppEdition; editionLabel.Text = AppEdition;
theme.Text = AppEdition; //theme.Text = AppEdition;
LstUWP.View = View.Details; LstUWP.View = View.Details;
LstUWP.Columns.Clear(); LstUWP.Columns.Clear();
LstUWP.Columns.Add("App Name", -2, HorizontalAlignment.Left); LstUWP.Columns.Add("App Name", -2, HorizontalAlignment.Left);
@@ -185,13 +188,15 @@ namespace Perfect11
string command2 = $"Get-AppxProvisionedPackage -online | Where PackageName -like *\"{appName}\"* | Remove-AppxProvisionedPackage -online"; string command2 = $"Get-AppxProvisionedPackage -online | Where PackageName -like *\"{appName}\"* | Remove-AppxProvisionedPackage -online";
try try
{ {
string output3 = Utilities.EolApp(appName);
string output2 = PowerShell.Execute(command2); string output2 = PowerShell.Execute(command2);
string output = PowerShell.Execute(command); string output = PowerShell.Execute(command);
#if DEBUG #if DEBUG
MessageBox.Show(output3);
MessageBox.Show(output2); MessageBox.Show(output2);
MessageBox.Show(output); MessageBox.Show(output);
#endif #endif
if (!output.ToLower().Contains("error") && !output2.ToLower().Contains("error")) if (!output.ToLower().Contains("error") && !output2.ToLower().Contains("error") && !output3.ToLower().Contains("error"))
{ {
success += "\t" + appName + "\n"; success += "\t" + appName + "\n";
} }
@@ -210,7 +215,7 @@ namespace Perfect11
private void ChkShowUWPSystem_CheckedChanged(object sender, EventArgs e) private void ChkShowUWPSystem_CheckedChanged(object sender, EventArgs e)
{ {
if (ChkShowUWPSystem.Checked) MessageBox.Show("You're about to show system UWP apps. Those apps if removed can break several things in your system. Proceed with caution.", "Perfect11 - WARNING", MessageBoxButtons.OK); if (ChkShowUWPSystem.Checked) MessageBox.Show("You're about to show system UWP apps. Those apps if removed can break several things in your system. Proceed with caution.", "Perfect11", MessageBoxButtons.OK, MessageBoxIcon.Warning);
GetUWP(); GetUWP();
} }
@@ -284,36 +289,63 @@ namespace Perfect11
} }
private void InitializeTweaks() private void InitializeTweaks()
{ {
if (!Directory.Exists("Tweaks")) const string tweaksFolder = "Tweaks";
{ const string interfaceDll = "Perfect11.TweaksInterface.dll";
Directory.CreateDirectory("Tweaks");
} // Ensure folder exists and remove old interface DLL
if (File.Exists("Tweaks\\Perfect11.TweaksInterface.dll")) if (!Directory.Exists(tweaksFolder))
{ Directory.CreateDirectory(tweaksFolder);
File.Delete("Tweaks\\Perfect11.TweaksInterface.dll");
} string interfacePath = Path.Combine(tweaksFolder, interfaceDll);
var categorizedPlugins = Utilities.LoadTweaks(@"Tweaks"); if (File.Exists(interfacePath))
File.Delete(interfacePath);
// Load categorized plugins
var categorizedPlugins = Utilities.LoadTweaks(tweaksFolder);
// Setup ListView
tweaksList.View = View.Details; tweaksList.View = View.Details;
tweaksList.Columns.Clear(); tweaksList.FullRowSelect = true;
tweaksList.Columns.Add("Tweaks", -2, HorizontalAlignment.Left); tweaksList.ShowGroups = true;
int totalWidth = tweaksList.ClientSize.Width;
tweaksList.Columns[0].Width = totalWidth;
tweaksList.Items.Clear(); tweaksList.Items.Clear();
tweaksList.Groups.Clear(); tweaksList.Groups.Clear();
tweaksList.FullRowSelect = true;
foreach (var category in categorizedPlugins) // 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); var group = new ListViewGroup(category.Key);
tweaksList.Groups.Add(group); tweaksList.Groups.Add(group);
foreach (var plugin in category.Value)
foreach (var plugin in category.Value.OrderBy(p => p.Name))
{ {
var item = new ListViewItem(plugin.Name) { Group = group }; var item = new ListViewItem(plugin.Name)
item.Tag = plugin; {
Group = group,
Tag = plugin
};
item.SubItems.Add(plugin.Description);
tweaksList.Items.Add(item); tweaksList.Items.Add(item);
} }
} }
tweaksList.ShowGroups = true;
if (tweaksList.Items.Count == 0) runTweaks.Enabled = false; // 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
} }
private void InitializeDarkMode() private void InitializeDarkMode()
{ {
@@ -359,8 +391,19 @@ namespace Perfect11
private void tweaksList_Resize(object sender, EventArgs e) private void tweaksList_Resize(object sender, EventArgs e)
{ {
int totalWidth = tweaksList.ClientSize.Width; AdjustListViewColumns();
tweaksList.Columns[0].Width = totalWidth; }
private void githubLink_Click(object sender, EventArgs e)
{
try
{
Process.Start("https://github.com/theitaliandeveloper/Perfect11/");
}
catch
{
MessageBox.Show("Looks like your browser is not available, please copy the link below and paste it in your browser's address bar:\n\nhttps://github.com/theitaliandeveloper/Perfect11/","Perfect11",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
} }
} }
} }

View File

@@ -5,6 +5,7 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using System.Security.Principal;
namespace Perfect11.Library namespace Perfect11.Library
{ {
@@ -55,5 +56,55 @@ namespace Perfect11.Library
rk.Close(); rk.Close();
return value == 0; return value == 0;
} }
public static string EolApp(string app)
{
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 =
{
$@"EndOfLife\{userSid}\{packageFullName}",
$@"EndOfLife\S-1-5-18\{packageFullName}",
$@"Deprovisioned\{packageFullName}"
};
foreach (var subKey in subKeys)
{
try
{
Registry.LocalMachine.CreateSubKey(basePath + "\\" + subKey);
}
catch (Exception ex)
{
return $"Error: {ex.Message}";
}
}
return "Deprovision completed successfully.";
}
catch (Exception ex)
{
return $"Error: {ex.Message}";
}
}
} }
} }

View File

@@ -19,7 +19,6 @@ Microsoft.Services.Store.Engagement
Microsoft.VCLibs Microsoft.VCLibs
Microsoft.Win32WebViewHost Microsoft.Win32WebViewHost
Microsoft.WindowsStore Microsoft.WindowsStore
Microsoft.WindowsCalculator
Microsoft.XboxGameCallableUI Microsoft.XboxGameCallableUI
Microsoft.Windows.Apprep.ChxApp Microsoft.Windows.Apprep.ChxApp
Microsoft.Windows.AssignedAccessLockApp Microsoft.Windows.AssignedAccessLockApp

View File

@@ -1 +1,9 @@
# Perfect11 # Perfect11
Windows 11 customization and optimization toolkit.
## How to use
1. Download [latest release](https://github.com/theitaliandeveloper/Perfect11/releases/latest)
2. Unzip the zip file
3. Run Perfect11.exe
##### Copyright (C) 2025 Vichingo455 (The Italian Developer). All rights reserved.

View File

@@ -101,16 +101,23 @@ namespace Perfect11.Inbox.ManageTelemetry
} }
} }
bool IsTelemetryActivated() bool IsTelemetryActivated()
{
try
{ {
RegistryKey rk = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Policies\\Microsoft\\Windows\\DataCollection"); RegistryKey rk = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Policies\\Microsoft\\Windows\\DataCollection");
int value = (int)rk.GetValue("AllowTelemetry"); int value = (int)rk.GetValue("AllowTelemetry");
rk.Close(); rk.Close();
return value != 0; return value != 0;
} catch
{
return true;
}
} }
if (IsTelemetryActivated()) if (IsTelemetryActivated())
{ {
// Step 1: Registry // Step 1: Registry
RegistryKey rk = Registry.LocalMachine.CreateSubKey("SOFTWARE\\Policies\\Microsoft\\Windows\\DataCollection"); RegistryKey rk;
rk = Registry.LocalMachine.CreateSubKey("SOFTWARE\\Policies\\Microsoft\\Windows\\DataCollection");
rk.SetValue("AllowTelemetry",0,RegistryValueKind.DWord); rk.SetValue("AllowTelemetry",0,RegistryValueKind.DWord);
rk.SetValue("MaxTelemetryAllowed", 0, RegistryValueKind.DWord); rk.SetValue("MaxTelemetryAllowed", 0, RegistryValueKind.DWord);
rk.Close(); rk.Close();
@@ -143,7 +150,8 @@ namespace Perfect11.Inbox.ManageTelemetry
else else
{ {
// Step 1: Registry // Step 1: Registry
RegistryKey rk = Registry.LocalMachine.CreateSubKey("SOFTWARE\\Policies\\Microsoft\\Windows\\DataCollection"); RegistryKey rk;
rk = Registry.LocalMachine.CreateSubKey("SOFTWARE\\Policies\\Microsoft\\Windows\\DataCollection");
rk.DeleteValue("AllowTelemetry"); rk.DeleteValue("AllowTelemetry");
rk.DeleteValue("MaxTelemetryAllowed"); rk.DeleteValue("MaxTelemetryAllowed");
rk.Close(); rk.Close();

View File

@@ -1,12 +1,9 @@
using Microsoft.Win32; using Microsoft.Win32;
using Perfect11.TweaksInterface; using Perfect11.TweaksInterface;
using System; using System;
using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Perfect11.Inbox.UninstallOneDrive namespace Perfect11.Inbox.UninstallOneDrive
{ {
@@ -28,6 +25,11 @@ namespace Perfect11.Inbox.UninstallOneDrive
if (key != null) if (key != null)
regExists = key.GetSubKeyNames().Any(n => n.ToLower().Contains("onedrive")); regExists = key.GetSubKeyNames().Any(n => n.ToLower().Contains("onedrive"));
} }
using (var key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Uninstall"))
{
if (key != null)
regExists = key.GetSubKeyNames().Any(n => n.ToLower().Contains("onedrive"));
}
} }
catch { } catch { }