mirror of
https://github.com/theitaliandeveloper/Perfect11.git
synced 2025-12-06 09:02:03 +00:00
Current state
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8.1"/>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
|
||||
</startup>
|
||||
</configuration>
|
||||
|
||||
203
Perfect11/Form1.Designer.cs
generated
203
Perfect11/Form1.Designer.cs
generated
@@ -28,17 +28,30 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
|
||||
this.theme = new ReaLTaiizor.Forms.FormTheme();
|
||||
this.controlBoxEdit1 = new ReaLTaiizor.Controls.ControlBoxEdit();
|
||||
this.pages = new ReaLTaiizor.Controls.PoisonTabControl();
|
||||
this.welcomePage = new ReaLTaiizor.Controls.PoisonTabPage();
|
||||
this.poisonLabel2 = new ReaLTaiizor.Controls.PoisonLabel();
|
||||
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||
this.poisonLabel1 = new ReaLTaiizor.Controls.PoisonLabel();
|
||||
this.controlBoxEdit1 = new ReaLTaiizor.Controls.ControlBoxEdit();
|
||||
this.debloatPage = new ReaLTaiizor.Controls.PoisonTabPage();
|
||||
this.BtnRunUninstaller = new ReaLTaiizor.Controls.PoisonButton();
|
||||
this.LblRemoveCount = new ReaLTaiizor.Controls.PoisonLabel();
|
||||
this.LblInstalledCount = new ReaLTaiizor.Controls.PoisonLabel();
|
||||
this.ChkShowUWPSystem = new ReaLTaiizor.Controls.PoisonCheckBox();
|
||||
this.LstUWPRemove = new ReaLTaiizor.Controls.PoisonListView();
|
||||
this.removeAllButton = new ReaLTaiizor.Controls.PoisonButton();
|
||||
this.addAllButton = new ReaLTaiizor.Controls.PoisonButton();
|
||||
this.removeButton = new ReaLTaiizor.Controls.PoisonButton();
|
||||
this.addButton = new ReaLTaiizor.Controls.PoisonButton();
|
||||
this.LstUWP = new ReaLTaiizor.Controls.PoisonListView();
|
||||
this.theme.SuspendLayout();
|
||||
this.pages.SuspendLayout();
|
||||
this.welcomePage.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||
this.debloatPage.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// theme
|
||||
@@ -52,20 +65,33 @@
|
||||
this.theme.Location = new System.Drawing.Point(0, 0);
|
||||
this.theme.Name = "theme";
|
||||
this.theme.Padding = new System.Windows.Forms.Padding(3, 28, 3, 28);
|
||||
this.theme.Sizable = true;
|
||||
this.theme.Sizable = false;
|
||||
this.theme.Size = new System.Drawing.Size(1329, 788);
|
||||
this.theme.SmartBounds = true;
|
||||
this.theme.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.theme.TabIndex = 0;
|
||||
this.theme.Text = "Perfect11";
|
||||
//
|
||||
// controlBoxEdit1
|
||||
//
|
||||
this.controlBoxEdit1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.controlBoxEdit1.BackColor = System.Drawing.Color.Transparent;
|
||||
this.controlBoxEdit1.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.controlBoxEdit1.DefaultLocation = true;
|
||||
this.controlBoxEdit1.Location = new System.Drawing.Point(1248, -1);
|
||||
this.controlBoxEdit1.Name = "controlBoxEdit1";
|
||||
this.controlBoxEdit1.Size = new System.Drawing.Size(77, 19);
|
||||
this.controlBoxEdit1.TabIndex = 2;
|
||||
this.controlBoxEdit1.Text = "controlBoxEdit1";
|
||||
//
|
||||
// pages
|
||||
//
|
||||
this.pages.Controls.Add(this.welcomePage);
|
||||
this.pages.Controls.Add(this.debloatPage);
|
||||
this.pages.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pages.Location = new System.Drawing.Point(3, 28);
|
||||
this.pages.Name = "pages";
|
||||
this.pages.SelectedIndex = 0;
|
||||
this.pages.SelectedIndex = 1;
|
||||
this.pages.Size = new System.Drawing.Size(1323, 732);
|
||||
this.pages.TabIndex = 1;
|
||||
this.pages.UseSelectable = true;
|
||||
@@ -79,7 +105,7 @@
|
||||
this.welcomePage.Controls.Add(this.poisonLabel1);
|
||||
this.welcomePage.HorizontalScrollbarBarColor = true;
|
||||
this.welcomePage.HorizontalScrollbarHighlightOnWheel = false;
|
||||
this.welcomePage.HorizontalScrollbarSize = 20;
|
||||
this.welcomePage.HorizontalScrollbarSize = 8;
|
||||
this.welcomePage.Location = new System.Drawing.Point(4, 38);
|
||||
this.welcomePage.Name = "welcomePage";
|
||||
this.welcomePage.Size = new System.Drawing.Size(1315, 690);
|
||||
@@ -87,7 +113,7 @@
|
||||
this.welcomePage.Text = "Welcome";
|
||||
this.welcomePage.VerticalScrollbarBarColor = true;
|
||||
this.welcomePage.VerticalScrollbarHighlightOnWheel = false;
|
||||
this.welcomePage.VerticalScrollbarSize = 22;
|
||||
this.welcomePage.VerticalScrollbarSize = 27;
|
||||
//
|
||||
// poisonLabel2
|
||||
//
|
||||
@@ -95,7 +121,7 @@
|
||||
this.poisonLabel2.BackColor = System.Drawing.Color.Transparent;
|
||||
this.poisonLabel2.Location = new System.Drawing.Point(416, 379);
|
||||
this.poisonLabel2.Name = "poisonLabel2";
|
||||
this.poisonLabel2.Size = new System.Drawing.Size(465, 38);
|
||||
this.poisonLabel2.Size = new System.Drawing.Size(492, 40);
|
||||
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" +
|
||||
"stalls apps, remove bloatware, configure services and even more.";
|
||||
@@ -123,27 +149,157 @@
|
||||
this.poisonLabel1.Text = "Welcome to Perfect11, the tool that makes Windows 11 almost perfect.";
|
||||
this.poisonLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// controlBoxEdit1
|
||||
// debloatPage
|
||||
//
|
||||
this.controlBoxEdit1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.controlBoxEdit1.BackColor = System.Drawing.Color.Transparent;
|
||||
this.controlBoxEdit1.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.controlBoxEdit1.DefaultLocation = true;
|
||||
this.controlBoxEdit1.Location = new System.Drawing.Point(1246, 3);
|
||||
this.controlBoxEdit1.Name = "controlBoxEdit1";
|
||||
this.controlBoxEdit1.Size = new System.Drawing.Size(77, 19);
|
||||
this.controlBoxEdit1.TabIndex = 2;
|
||||
this.controlBoxEdit1.Text = "controlBoxEdit1";
|
||||
this.debloatPage.Controls.Add(this.BtnRunUninstaller);
|
||||
this.debloatPage.Controls.Add(this.LblRemoveCount);
|
||||
this.debloatPage.Controls.Add(this.LblInstalledCount);
|
||||
this.debloatPage.Controls.Add(this.ChkShowUWPSystem);
|
||||
this.debloatPage.Controls.Add(this.LstUWPRemove);
|
||||
this.debloatPage.Controls.Add(this.removeAllButton);
|
||||
this.debloatPage.Controls.Add(this.addAllButton);
|
||||
this.debloatPage.Controls.Add(this.removeButton);
|
||||
this.debloatPage.Controls.Add(this.addButton);
|
||||
this.debloatPage.Controls.Add(this.LstUWP);
|
||||
this.debloatPage.HorizontalScrollbarBarColor = true;
|
||||
this.debloatPage.HorizontalScrollbarHighlightOnWheel = false;
|
||||
this.debloatPage.HorizontalScrollbarSize = 8;
|
||||
this.debloatPage.Location = new System.Drawing.Point(4, 38);
|
||||
this.debloatPage.Name = "debloatPage";
|
||||
this.debloatPage.Size = new System.Drawing.Size(1315, 690);
|
||||
this.debloatPage.TabIndex = 1;
|
||||
this.debloatPage.Text = "Debloat";
|
||||
this.debloatPage.VerticalScrollbarBarColor = true;
|
||||
this.debloatPage.VerticalScrollbarHighlightOnWheel = false;
|
||||
this.debloatPage.VerticalScrollbarSize = 17;
|
||||
//
|
||||
// BtnRunUninstaller
|
||||
//
|
||||
this.BtnRunUninstaller.Location = new System.Drawing.Point(1198, 645);
|
||||
this.BtnRunUninstaller.Name = "BtnRunUninstaller";
|
||||
this.BtnRunUninstaller.Size = new System.Drawing.Size(112, 42);
|
||||
this.BtnRunUninstaller.TabIndex = 12;
|
||||
this.BtnRunUninstaller.Text = "Remove selected";
|
||||
this.BtnRunUninstaller.UseSelectable = true;
|
||||
this.BtnRunUninstaller.Click += new System.EventHandler(this.BtnRunUninstaller_Click);
|
||||
//
|
||||
// LblRemoveCount
|
||||
//
|
||||
this.LblRemoveCount.AutoSize = true;
|
||||
this.LblRemoveCount.FontSize = ReaLTaiizor.Extension.Poison.PoisonLabelSize.Tall;
|
||||
this.LblRemoveCount.Location = new System.Drawing.Point(1198, 13);
|
||||
this.LblRemoveCount.Name = "LblRemoveCount";
|
||||
this.LblRemoveCount.Size = new System.Drawing.Size(112, 25);
|
||||
this.LblRemoveCount.TabIndex = 11;
|
||||
this.LblRemoveCount.Text = "Removing (0)";
|
||||
//
|
||||
// LblInstalledCount
|
||||
//
|
||||
this.LblInstalledCount.AutoSize = true;
|
||||
this.LblInstalledCount.FontSize = ReaLTaiizor.Extension.Poison.PoisonLabelSize.Tall;
|
||||
this.LblInstalledCount.Location = new System.Drawing.Point(5, 13);
|
||||
this.LblInstalledCount.Name = "LblInstalledCount";
|
||||
this.LblInstalledCount.Size = new System.Drawing.Size(98, 25);
|
||||
this.LblInstalledCount.TabIndex = 9;
|
||||
this.LblInstalledCount.Text = "Installed (0)";
|
||||
//
|
||||
// ChkShowUWPSystem
|
||||
//
|
||||
this.ChkShowUWPSystem.Appearance = System.Windows.Forms.Appearance.Button;
|
||||
this.ChkShowUWPSystem.AutoSize = true;
|
||||
this.ChkShowUWPSystem.Location = new System.Drawing.Point(5, 650);
|
||||
this.ChkShowUWPSystem.Name = "ChkShowUWPSystem";
|
||||
this.ChkShowUWPSystem.Size = new System.Drawing.Size(134, 17);
|
||||
this.ChkShowUWPSystem.TabIndex = 8;
|
||||
this.ChkShowUWPSystem.Text = "Show System Apps";
|
||||
this.ChkShowUWPSystem.UseSelectable = true;
|
||||
this.ChkShowUWPSystem.CheckedChanged += new System.EventHandler(this.ChkShowUWPSystem_CheckedChanged);
|
||||
//
|
||||
// LstUWPRemove
|
||||
//
|
||||
this.LstUWPRemove.Font = new System.Drawing.Font("Segoe UI", 12F);
|
||||
this.LstUWPRemove.FullRowSelect = true;
|
||||
this.LstUWPRemove.Location = new System.Drawing.Point(792, 46);
|
||||
this.LstUWPRemove.Name = "LstUWPRemove";
|
||||
this.LstUWPRemove.OwnerDraw = true;
|
||||
this.LstUWPRemove.Size = new System.Drawing.Size(518, 579);
|
||||
this.LstUWPRemove.Sorting = System.Windows.Forms.SortOrder.Ascending;
|
||||
this.LstUWPRemove.TabIndex = 7;
|
||||
this.LstUWPRemove.TileSize = new System.Drawing.Size(348, 20);
|
||||
this.LstUWPRemove.UseCompatibleStateImageBehavior = false;
|
||||
this.LstUWPRemove.UseSelectable = true;
|
||||
this.LstUWPRemove.View = System.Windows.Forms.View.Tile;
|
||||
//
|
||||
// removeAllButton
|
||||
//
|
||||
this.removeAllButton.FontSize = ReaLTaiizor.Extension.Poison.PoisonButtonSize.Medium;
|
||||
this.removeAllButton.Location = new System.Drawing.Point(592, 412);
|
||||
this.removeAllButton.Name = "removeAllButton";
|
||||
this.removeAllButton.Size = new System.Drawing.Size(144, 43);
|
||||
this.removeAllButton.TabIndex = 6;
|
||||
this.removeAllButton.Text = "< Remove all";
|
||||
this.removeAllButton.UseSelectable = true;
|
||||
this.removeAllButton.Click += new System.EventHandler(this.removeAllButton_Click);
|
||||
//
|
||||
// addAllButton
|
||||
//
|
||||
this.addAllButton.FontSize = ReaLTaiizor.Extension.Poison.PoisonButtonSize.Medium;
|
||||
this.addAllButton.Location = new System.Drawing.Point(592, 342);
|
||||
this.addAllButton.Name = "addAllButton";
|
||||
this.addAllButton.Size = new System.Drawing.Size(144, 43);
|
||||
this.addAllButton.TabIndex = 5;
|
||||
this.addAllButton.Text = "Add all>";
|
||||
this.addAllButton.UseSelectable = true;
|
||||
this.addAllButton.Click += new System.EventHandler(this.addAllButton_Click);
|
||||
//
|
||||
// removeButton
|
||||
//
|
||||
this.removeButton.FontSize = ReaLTaiizor.Extension.Poison.PoisonButtonSize.Medium;
|
||||
this.removeButton.Location = new System.Drawing.Point(592, 265);
|
||||
this.removeButton.Name = "removeButton";
|
||||
this.removeButton.Size = new System.Drawing.Size(144, 43);
|
||||
this.removeButton.TabIndex = 4;
|
||||
this.removeButton.Text = "< Remove";
|
||||
this.removeButton.UseSelectable = true;
|
||||
this.removeButton.Click += new System.EventHandler(this.removeButton_Click);
|
||||
//
|
||||
// addButton
|
||||
//
|
||||
this.addButton.FontSize = ReaLTaiizor.Extension.Poison.PoisonButtonSize.Medium;
|
||||
this.addButton.Location = new System.Drawing.Point(592, 195);
|
||||
this.addButton.Name = "addButton";
|
||||
this.addButton.Size = new System.Drawing.Size(144, 43);
|
||||
this.addButton.TabIndex = 3;
|
||||
this.addButton.Text = "Add >";
|
||||
this.addButton.UseSelectable = true;
|
||||
this.addButton.Click += new System.EventHandler(this.addButton_Click);
|
||||
//
|
||||
// LstUWP
|
||||
//
|
||||
this.LstUWP.Font = new System.Drawing.Font("Segoe UI", 12F);
|
||||
this.LstUWP.FullRowSelect = true;
|
||||
this.LstUWP.Location = new System.Drawing.Point(5, 46);
|
||||
this.LstUWP.Name = "LstUWP";
|
||||
this.LstUWP.OwnerDraw = true;
|
||||
this.LstUWP.Size = new System.Drawing.Size(518, 579);
|
||||
this.LstUWP.Sorting = System.Windows.Forms.SortOrder.Ascending;
|
||||
this.LstUWP.Style = ReaLTaiizor.Enum.Poison.ColorStyle.Black;
|
||||
this.LstUWP.TabIndex = 2;
|
||||
this.LstUWP.TileSize = new System.Drawing.Size(348, 20);
|
||||
this.LstUWP.UseCompatibleStateImageBehavior = false;
|
||||
this.LstUWP.UseSelectable = true;
|
||||
this.LstUWP.View = System.Windows.Forms.View.Tile;
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 21F);
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
|
||||
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);
|
||||
this.Controls.Add(this.theme);
|
||||
this.Font = new System.Drawing.Font("Segoe UI", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.MinimumSize = new System.Drawing.Size(126, 50);
|
||||
this.Name = "Form1";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
@@ -155,6 +311,8 @@
|
||||
this.welcomePage.ResumeLayout(false);
|
||||
this.welcomePage.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||
this.debloatPage.ResumeLayout(false);
|
||||
this.debloatPage.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
@@ -168,6 +326,17 @@
|
||||
private System.Windows.Forms.PictureBox pictureBox1;
|
||||
private ReaLTaiizor.Controls.PoisonLabel poisonLabel2;
|
||||
private ReaLTaiizor.Controls.ControlBoxEdit controlBoxEdit1;
|
||||
private ReaLTaiizor.Controls.PoisonTabPage debloatPage;
|
||||
private ReaLTaiizor.Controls.PoisonListView LstUWP;
|
||||
private ReaLTaiizor.Controls.PoisonListView LstUWPRemove;
|
||||
private ReaLTaiizor.Controls.PoisonButton removeAllButton;
|
||||
private ReaLTaiizor.Controls.PoisonButton addAllButton;
|
||||
private ReaLTaiizor.Controls.PoisonButton removeButton;
|
||||
private ReaLTaiizor.Controls.PoisonButton addButton;
|
||||
private ReaLTaiizor.Controls.PoisonCheckBox ChkShowUWPSystem;
|
||||
private ReaLTaiizor.Controls.PoisonLabel LblInstalledCount;
|
||||
private ReaLTaiizor.Controls.PoisonLabel LblRemoveCount;
|
||||
private ReaLTaiizor.Controls.PoisonButton BtnRunUninstaller;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,21 +1,29 @@
|
||||
using System;
|
||||
using Microsoft.VisualBasic.ApplicationServices;
|
||||
using Perfect11.Library;
|
||||
using Perfect11.Properties;
|
||||
using ReaLTaiizor.Enum.Poison;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using ReaLTaiizor.Enum.Poison;
|
||||
|
||||
namespace Perfect11
|
||||
{
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
private List<string> _listSystemApps = new List<string>();
|
||||
public Form1()
|
||||
{
|
||||
InitializeComponent();
|
||||
DarkMode(true);
|
||||
GetUWPSystem();
|
||||
GetUWP();
|
||||
}
|
||||
public void DarkMode(bool status)
|
||||
{
|
||||
@@ -23,17 +31,229 @@ namespace Perfect11
|
||||
{
|
||||
pages.Theme = ThemeStyle.Dark;
|
||||
welcomePage.Theme = ThemeStyle.Dark;
|
||||
debloatPage.Theme = ThemeStyle.Dark;
|
||||
poisonLabel1.Theme = ThemeStyle.Dark;
|
||||
poisonLabel2.Theme = ThemeStyle.Dark;
|
||||
LblInstalledCount.Theme = ThemeStyle.Dark;
|
||||
LblRemoveCount.Theme = ThemeStyle.Dark;
|
||||
LstUWP.Theme = ThemeStyle.Dark;
|
||||
LstUWPRemove.Theme = ThemeStyle.Dark;
|
||||
ChkShowUWPSystem.Theme = ThemeStyle.Dark;
|
||||
BtnRunUninstaller.Theme = ThemeStyle.Dark;
|
||||
addAllButton.Theme = ThemeStyle.Dark;
|
||||
addButton.Theme = ThemeStyle.Dark;
|
||||
removeAllButton.Theme = ThemeStyle.Dark;
|
||||
removeButton.Theme = ThemeStyle.Dark;
|
||||
}
|
||||
else
|
||||
{
|
||||
pages.Theme = ThemeStyle.Light;
|
||||
welcomePage.Theme = ThemeStyle.Light;
|
||||
debloatPage.Theme = ThemeStyle.Light;
|
||||
}
|
||||
}
|
||||
private void Form1_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
private void GetUWP()
|
||||
{
|
||||
LstUWP.Items.Clear();
|
||||
|
||||
// Run PowerShell to get UWP app names
|
||||
string output = PowerShell.Execute("Get-AppxPackage -allusers | Select-Object -ExpandProperty Name");
|
||||
|
||||
// Split output into lines
|
||||
string[] lines = output.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
foreach (string line in lines)
|
||||
{
|
||||
string current = line.Trim();
|
||||
if (_listSystemApps != null)
|
||||
{
|
||||
if ((_listSystemApps.Any(current.Contains)) && !ChkShowUWPSystem.Checked)
|
||||
continue;
|
||||
}
|
||||
if (!LstUWP.Items.Cast<ListViewItem>().Any(item => item.Text.Equals(current, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
LstUWP.Items.Add(new ListViewItem(current));
|
||||
}
|
||||
}
|
||||
var compare = LstUWP.Items.Cast<ListViewItem>().Select(item => item.Text).ToList();
|
||||
foreach (ListViewItem removeItem in LstUWPRemove.Items)
|
||||
{
|
||||
if (compare.Contains(removeItem.Text))
|
||||
{
|
||||
var itemToRemove = LstUWP.Items
|
||||
.Cast<ListViewItem>()
|
||||
.FirstOrDefault(x => x.Text == removeItem.Text);
|
||||
if (itemToRemove != null)
|
||||
LstUWP.Items.Remove(itemToRemove);
|
||||
}
|
||||
}
|
||||
RefreshUWP();
|
||||
}
|
||||
private void RefreshUWP()
|
||||
{
|
||||
int installed = LstUWP.Items.Count;
|
||||
int remove = LstUWPRemove.Items.Count;
|
||||
LblInstalledCount.Text = "Installed (" + installed.ToString() + ")";
|
||||
LblRemoveCount.Text = "Removing (" + remove.ToString() + ")";
|
||||
|
||||
if (installed == 0)
|
||||
addAllButton.Enabled =
|
||||
addButton.Enabled =
|
||||
false;
|
||||
else
|
||||
addAllButton.Enabled =
|
||||
addButton.Enabled =
|
||||
true;
|
||||
|
||||
if (remove == 0)
|
||||
removeAllButton.Enabled =
|
||||
removeButton.Enabled =
|
||||
BtnRunUninstaller.Enabled =
|
||||
false;
|
||||
else
|
||||
removeAllButton.Enabled =
|
||||
removeButton.Enabled =
|
||||
BtnRunUninstaller.Enabled =
|
||||
true;
|
||||
}
|
||||
private void GetUWPSystem()
|
||||
{
|
||||
_listSystemApps.Clear(); // Optional: clear old entries
|
||||
|
||||
using (StringReader reader = new StringReader(Resources.UWPSystemAppList))
|
||||
{
|
||||
string line;
|
||||
while ((line = reader.ReadLine()) != null)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(line))
|
||||
_listSystemApps.Add(line.Trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
private string RemoveUWP()
|
||||
{
|
||||
string success = "Successfully removed:" + "\n";
|
||||
string failed = "Failed to remove:" + "\n";
|
||||
|
||||
foreach (var item in LstUWPRemove.Items)
|
||||
{
|
||||
string appName = item.ToString();
|
||||
|
||||
// Build the command
|
||||
string command = $"Get-AppxPackage -allusers -Name \"{appName}\" | Remove-AppxPackage -allusers";
|
||||
|
||||
try
|
||||
{
|
||||
string output = PowerShell.Execute(command);
|
||||
|
||||
// Basic success/failure logic (you can enhance this)
|
||||
if (!string.IsNullOrWhiteSpace(output) && !output.ToLower().Contains("error"))
|
||||
{
|
||||
success += "\t" + appName + "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
failed += "\t" + appName + "\n";
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
failed += $"\t{appName} ({ex.Message})\n";
|
||||
}
|
||||
}
|
||||
|
||||
// Return status summary
|
||||
return success + (failed != "Failed to remove:" + "\n" ? "\n" + failed : "");
|
||||
}
|
||||
|
||||
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);
|
||||
GetUWP();
|
||||
}
|
||||
|
||||
private void addAllButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var itemsToMove = LstUWP.Items.Cast<ListViewItem>().ToList();
|
||||
foreach (var item in itemsToMove)
|
||||
{
|
||||
LstUWPRemove.Items.Add((ListViewItem)item.Clone()); // Clone to avoid reference issues
|
||||
}
|
||||
LstUWP.Items.Clear();
|
||||
RefreshUWP();
|
||||
}
|
||||
|
||||
private void addButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (LstUWP.SelectedItems.Count == 0) return;
|
||||
foreach (ListViewItem selectedItem in LstUWP.SelectedItems.Cast<ListViewItem>().ToList())
|
||||
{
|
||||
LstUWPRemove.Items.Add((ListViewItem)selectedItem.Clone());
|
||||
LstUWP.Items.Remove(selectedItem);
|
||||
}
|
||||
RefreshUWP();
|
||||
}
|
||||
|
||||
private void removeButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (LstUWPRemove.SelectedItems.Count > 0)
|
||||
{
|
||||
// Create a temporary list to avoid modifying collection during iteration
|
||||
List<ListViewItem> selectedItems = new List<ListViewItem>();
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
private void Form1_Load(object sender, EventArgs e)
|
||||
private void removeAllButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
DarkMode(true);
|
||||
// Create a temporary list to hold items to move
|
||||
List<ListViewItem> itemsToMove = new List<ListViewItem>();
|
||||
|
||||
foreach (ListViewItem item in LstUWPRemove.Items)
|
||||
{
|
||||
// Clone the item to add to the other ListView
|
||||
itemsToMove.Add((ListViewItem)item.Clone());
|
||||
}
|
||||
|
||||
// Add to destination ListView
|
||||
LstUWP.Items.AddRange(itemsToMove.ToArray());
|
||||
|
||||
// Clear source ListView
|
||||
LstUWPRemove.Items.Clear();
|
||||
|
||||
RefreshUWP();
|
||||
}
|
||||
|
||||
private void BtnRunUninstaller_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (LstUWPRemove.Items.Count == 0) { MessageBox.Show("No items were selected for removal.","Perfect11", MessageBoxButtons.OK,MessageBoxIcon.Information); }
|
||||
else
|
||||
{
|
||||
Enabled = false;
|
||||
|
||||
MessageBox.Show(RemoveUWP());
|
||||
|
||||
LstUWPRemove.Items.Clear();
|
||||
GetUWP();
|
||||
Enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
2757
Perfect11/Form1.resx
2757
Perfect11/Form1.resx
File diff suppressed because it is too large
Load Diff
33
Perfect11/Library/PowerShell.cs
Normal file
33
Perfect11/Library/PowerShell.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using Microsoft.VisualBasic.ApplicationServices;
|
||||
using Microsoft.VisualBasic.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Perfect11.Library
|
||||
{
|
||||
public class PowerShell
|
||||
{
|
||||
public static string Execute(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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
20
Perfect11/Library/Utilities.cs
Normal file
20
Perfect11/Library/Utilities.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace Perfect11.Library
|
||||
{
|
||||
public class Utilities
|
||||
{
|
||||
public static bool IsWindows11()
|
||||
{
|
||||
string buildNumber = (string)Registry.GetValue(
|
||||
@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion",
|
||||
"CurrentBuildNumber", null);
|
||||
return int.TryParse(buildNumber, out int build) && build >= 22000;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>Perfect11</RootNamespace>
|
||||
<AssemblyName>Perfect11</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
@@ -52,10 +52,13 @@
|
||||
<PropertyGroup>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>Simpleicons-Team-Simple-Windows-11.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.VisualBasic" />
|
||||
<Reference Include="ReaLTaiizor, Version=3.8.1.3, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ReaLTaiizor.3.8.1.3\lib\net481\ReaLTaiizor.dll</HintPath>
|
||||
<HintPath>..\packages\ReaLTaiizor.3.8.1.3\lib\net48\ReaLTaiizor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
@@ -77,6 +80,8 @@
|
||||
<Compile Include="Form1.Designer.cs">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Library\PowerShell.cs" />
|
||||
<Compile Include="Library\Utilities.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="Form1.resx">
|
||||
@@ -122,5 +127,9 @@
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Resources\UWPSystemAppList.txt" />
|
||||
<Content Include="Simpleicons-Team-Simple-Windows-11.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Perfect11.Library;
|
||||
|
||||
namespace Perfect11
|
||||
{
|
||||
@@ -17,11 +18,19 @@ namespace Perfect11
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
|
||||
#if !DEBUG
|
||||
// Check if the system is Windows 11
|
||||
if (!Utilities.IsWindows11())
|
||||
{
|
||||
MessageBox.Show("This tool requires Windows 11!","Perfect11",MessageBoxButtons.OK,MessageBoxIcon.Error);
|
||||
}
|
||||
// Hide exception window because of some nags with the library.
|
||||
#if DEBUG
|
||||
Application.ThreadException += (s, e) =>
|
||||
{
|
||||
Console.WriteLine($"Errore: {e.Exception.Message}\n{e.Exception.StackTrace}"); // Nasconde la finestra eccezioni
|
||||
Console.WriteLine($"Errore: {e.Exception.Message}\n{e.Exception.StackTrace}");
|
||||
};
|
||||
#else
|
||||
Application.ThreadException += (s, e) => { };
|
||||
#endif
|
||||
Application.Run(new Form1());
|
||||
}
|
||||
|
||||
9
Perfect11/Properties/Resources.Designer.cs
generated
9
Perfect11/Properties/Resources.Designer.cs
generated
@@ -60,6 +60,15 @@ namespace Perfect11.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to .
|
||||
/// </summary>
|
||||
internal static string UWPSystemAppList {
|
||||
get {
|
||||
return ResourceManager.GetString("UWPSystemAppList", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
|
||||
@@ -118,6 +118,9 @@
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="UWPSystemAppList" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\UWPSystemAppList.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
|
||||
</data>
|
||||
<data name="win11logo" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Images\win11logo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
|
||||
59
Perfect11/Resources/UWPSystemAppList.txt
Normal file
59
Perfect11/Resources/UWPSystemAppList.txt
Normal file
@@ -0,0 +1,59 @@
|
||||
1527c705-839a-4832-9118-54d4Bd6a0c89
|
||||
c5e2524a-ea46-4f67-841f-6a9465d9d515
|
||||
E2A4F912-2574-4A75-9BB0-0D023378592B
|
||||
F46D4000-FD22-4DB4-AC8E-4E1DDDE828FE
|
||||
InputApp
|
||||
Microsoft.AAD.BrokerPlugin
|
||||
Microsoft.AccountsControl
|
||||
Microsoft.Advertising.Xaml
|
||||
Microsoft.AsyncTextService
|
||||
Microsoft.BioEnrollment
|
||||
Microsoft.CredDialogHost
|
||||
Microsoft.ECApp
|
||||
Microsoft.LockApp
|
||||
Microsoft.MicrosoftEdge
|
||||
Microsoft.MicrosoftEdgeDevToolsClient
|
||||
Microsoft.NET
|
||||
Microsoft.PPIProjection
|
||||
Microsoft.Services.Store.Engagement
|
||||
Microsoft.VCLibs
|
||||
Microsoft.Win32WebViewHost
|
||||
Microsoft.WindowsStore
|
||||
Microsoft.WindowsCalculator
|
||||
Microsoft.XboxGameCallableUI
|
||||
Microsoft.Windows.Apprep.ChxApp
|
||||
Microsoft.Windows.AssignedAccessLockApp
|
||||
Microsoft.Windows.CapturePicker
|
||||
Microsoft.Windows.CloudExperienceHost
|
||||
Microsoft.Windows.ContentDeliveryManager
|
||||
Microsoft.Windows.Cortana
|
||||
Microsoft.Windows.NarratorQuickStart
|
||||
Microsoft.Windows.OOBENetworkCaptivePortal
|
||||
Microsoft.Windows.OOBENetworkConnectionFlow
|
||||
Microsoft.Windows.ParentalControls
|
||||
Microsoft.Windows.PeopleExperienceHost
|
||||
Microsoft.Windows.PinningConfirmationDialog
|
||||
Microsoft.Windows.SecHealthUI
|
||||
Microsoft.Windows.SecureAssessmentBrowser
|
||||
Microsoft.Windows.ShellExperienceHost
|
||||
Microsoft.Windows.XGpuEjectDialog
|
||||
Windows.CBSPreview
|
||||
windows.immersivecontrolpanel
|
||||
Windows.PrintDialog
|
||||
Microsoft.WindowsAppRuntime.1.3
|
||||
Microsoft.WindowsAppRuntime.1.5
|
||||
Microsoft.WindowsAppRuntime.1.6
|
||||
Microsoft.WindowsAppRuntime.1.7
|
||||
Microsoft.WindowsAppRuntime.1.8
|
||||
Microsoft.WindowsAppRuntime.CBS
|
||||
Microsoft.WindowsAppRuntime.CBS.1.6
|
||||
Microsoft.UI.Xaml.2.8
|
||||
Microsoft.UI.Xaml.CBS
|
||||
Microsoft.StorePurchaseApp
|
||||
Microsoft.Windows.StartMenuExperienceHost
|
||||
Microsoft.Windows.PrintQueueActionCenter
|
||||
NcsiUwpApp
|
||||
Microsoft.DesktopAppInstaller
|
||||
Microsoft.SecHealthUI
|
||||
Microsoft.StartExperiencesApp
|
||||
Microsoft.Windows.AugLoop.CBS
|
||||
BIN
Perfect11/Simpleicons-Team-Simple-Windows-11.ico
Normal file
BIN
Perfect11/Simpleicons-Team-Simple-Windows-11.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 161 KiB |
@@ -3,7 +3,7 @@
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||
<security>
|
||||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
@@ -14,20 +14,7 @@
|
||||
</compatibility>
|
||||
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<windowsSettings>
|
||||
<!--<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>-->
|
||||
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
|
||||
</windowsSettings>
|
||||
</application>
|
||||
<!--<dependency>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity
|
||||
type="win32"
|
||||
name="Microsoft.Windows.Common-Controls"
|
||||
version="6.0.0.0"
|
||||
processorArchitecture="*"
|
||||
publicKeyToken="6595b64144ccf1df"
|
||||
language="*"
|
||||
/>
|
||||
</dependentAssembly>
|
||||
</dependency>-->
|
||||
</assembly>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="ReaLTaiizor" version="3.8.1.3" targetFramework="net481" />
|
||||
<package id="ReaLTaiizor" version="3.8.1.3" targetFramework="net48" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user