diff --git a/MSCFixer/FeatureBase.cs b/MSCFixer/Features/FeatureBase.cs similarity index 100% rename from MSCFixer/FeatureBase.cs rename to MSCFixer/Features/FeatureBase.cs diff --git a/MSCFixer/FeatureLoader.cs b/MSCFixer/Features/FeatureLoader.cs similarity index 100% rename from MSCFixer/FeatureLoader.cs rename to MSCFixer/Features/FeatureLoader.cs diff --git a/MSCFixer/FeatureManager.cs b/MSCFixer/Features/FeatureManager.cs similarity index 100% rename from MSCFixer/FeatureManager.cs rename to MSCFixer/Features/FeatureManager.cs diff --git a/MSCFixer/FeatureNode.cs b/MSCFixer/Features/FeatureNode.cs similarity index 100% rename from MSCFixer/FeatureNode.cs rename to MSCFixer/Features/FeatureNode.cs diff --git a/MSCFixer/Features/Issues/WingetUpgrade.cs b/MSCFixer/Features/Issues/WingetUpgrade.cs index 8da64db..fce85f5 100644 --- a/MSCFixer/Features/Issues/WingetUpgrade.cs +++ b/MSCFixer/Features/Issues/WingetUpgrade.cs @@ -9,7 +9,7 @@ namespace Settings.System { public override string GetFeatureDetails() { - return "Launches Windows Terminal to check and upgrade all installed apps via winget."; + return "winget upgrade --include-unknown"; } public override string ID() diff --git a/MSCFixer/Helpers/Utils.cs b/MSCFixer/Helpers/Utils.cs index ea42a11..3016a49 100644 --- a/MSCFixer/Helpers/Utils.cs +++ b/MSCFixer/Helpers/Utils.cs @@ -2,6 +2,8 @@ using System.Windows.Forms; using System; using System.Diagnostics; +using System.Linq; +using System.Net; // This file is part of MSCFixer. namespace Crapfixer @@ -78,6 +80,5 @@ namespace Crapfixer Logger.Log("Failed to restart Explorer: " + ex.Message, LogLevel.Error); } } - } } \ No newline at end of file diff --git a/MSCFixer/IniStateManager.cs b/MSCFixer/IniStateManager.cs new file mode 100644 index 0000000..fb87969 --- /dev/null +++ b/MSCFixer/IniStateManager.cs @@ -0,0 +1,69 @@ +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Windows.Forms; + +public static class IniStateManager +{ + // Saves the states of the TreeView nodes to an INI file + public static void Save(TreeView tree, string path) + { + using (var writer = new StreamWriter(path)) + { + // Iterates through all nodes and saves their state + WriteNodeStates(writer, tree.Nodes); + } + } + + // Loads the states of the TreeView nodes from an INI file + public static void Load(TreeView tree, string path) + { + if (!File.Exists(path)) return; + + var lines = File.ReadAllLines(path); + var states = lines.Select(l => l.Split(new[] { '=' }, 2)) + .Where(p => p.Length == 2) + .ToDictionary(p => p[0].Trim(), p => p[1].Trim().ToLower() == "true"); + + // Sets the state of the nodes based on the loaded data + ApplyStates(tree.Nodes, states); + } + + /// + /// Saves the state of each node in the TreeView recursively. + /// + /// + /// + private static void WriteNodeStates(StreamWriter writer, TreeNodeCollection nodes) + { + foreach (TreeNode node in nodes) + { + // Saves the node's name and its checked status + writer.WriteLine($"{node.Text.Trim()}={node.Checked}"); + // If the node has children, recursively go through all nodes + if (node.Nodes.Count > 0) + WriteNodeStates(writer, node.Nodes); + } + } + + /// + /// Applies the saved states to the TreeView nodes recursively. + /// + /// + /// + private static void ApplyStates(TreeNodeCollection nodes, Dictionary states) + { + foreach (TreeNode node in nodes) + { + string nodeName = node.Text.Trim(); + if (states.ContainsKey(nodeName)) + { + node.Checked = states[nodeName]; + } + + // Apply recursively to child nodes + if (node.Nodes.Count > 0) + ApplyStates(node.Nodes, states); + } + } +} diff --git a/MSCFixer/MSCFixer.csproj b/MSCFixer/MSCFixer.csproj index 2753731..f944cae 100644 --- a/MSCFixer/MSCFixer.csproj +++ b/MSCFixer/MSCFixer.csproj @@ -56,7 +56,7 @@ - + @@ -94,8 +94,8 @@ - - + + @@ -123,12 +123,24 @@ + + UserControl + + + AboutView.cs + UserControl SettingsView.cs + + UserControl + + + OptionsView.cs + MainForm.cs @@ -137,11 +149,17 @@ Designer Resources.Designer.cs + + AboutView.cs + SettingsView.cs + + OptionsView.cs + - + SettingsSingleFileGenerator Settings.Designer.cs diff --git a/MSCFixer/MainForm.Designer.cs b/MSCFixer/MainForm.Designer.cs index 95d584f..62944a4 100644 --- a/MSCFixer/MainForm.Designer.cs +++ b/MSCFixer/MainForm.Designer.cs @@ -52,7 +52,7 @@ this.lblHeader = new System.Windows.Forms.Label(); this.pictureHeader = new System.Windows.Forms.PictureBox(); this.btnRestore = new System.Windows.Forms.Button(); - this.linkHelp = new System.Windows.Forms.LinkLabel(); + this.linkUpdateCheck = new System.Windows.Forms.LinkLabel(); this.btnSettings = new System.Windows.Forms.Button(); this.btnHome = new System.Windows.Forms.Button(); this.linkSelection = new System.Windows.Forms.LinkLabel(); @@ -345,21 +345,22 @@ this.btnRestore.UseVisualStyleBackColor = true; this.btnRestore.Click += new System.EventHandler(this.btnRestore_Click); // - // linkHelp + // linkUpdateCheck // - this.linkHelp.ActiveLinkColor = System.Drawing.Color.Blue; - this.linkHelp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.linkHelp.AutoEllipsis = true; - this.linkHelp.AutoSize = true; - this.linkHelp.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.linkHelp.LinkColor = System.Drawing.Color.White; - this.linkHelp.Location = new System.Drawing.Point(620, 447); - this.linkHelp.Name = "linkHelp"; - this.linkHelp.Size = new System.Drawing.Size(63, 13); - this.linkHelp.TabIndex = 203; - this.linkHelp.TabStop = true; - this.linkHelp.Text = "GitHub Help"; - this.linkHelp.TextAlign = System.Drawing.ContentAlignment.TopCenter; + this.linkUpdateCheck.ActiveLinkColor = System.Drawing.Color.Blue; + this.linkUpdateCheck.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.linkUpdateCheck.AutoEllipsis = true; + this.linkUpdateCheck.AutoSize = true; + this.linkUpdateCheck.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.linkUpdateCheck.LinkColor = System.Drawing.Color.White; + this.linkUpdateCheck.Location = new System.Drawing.Point(595, 447); + this.linkUpdateCheck.Name = "linkUpdateCheck"; + this.linkUpdateCheck.Size = new System.Drawing.Size(95, 13); + this.linkUpdateCheck.TabIndex = 203; + this.linkUpdateCheck.TabStop = true; + this.linkUpdateCheck.Text = "Check for updates"; + this.linkUpdateCheck.TextAlign = System.Drawing.ContentAlignment.TopCenter; + this.linkUpdateCheck.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkUpdateCheck_LinkClicked); // // btnSettings // @@ -391,7 +392,7 @@ this.btnHome.Size = new System.Drawing.Size(99, 69); this.btnHome.TabIndex = 206; this.btnHome.TabStop = false; - this.btnHome.Text = "&Home"; + this.btnHome.Text = "&Fixer"; this.btnHome.UseVisualStyleBackColor = false; // // linkSelection @@ -422,7 +423,7 @@ this.Controls.Add(this.btnSettings); this.Controls.Add(this.panelHeader); this.Controls.Add(this.btnRestore); - this.Controls.Add(this.linkHelp); + this.Controls.Add(this.linkUpdateCheck); this.Controls.Add(this.panelContainer); this.Name = "MainForm"; this.ShowIcon = false; @@ -467,7 +468,7 @@ private System.Windows.Forms.CheckedListBox checkedListBoxApps; private System.Windows.Forms.ToolStripSeparator seperatorToolStripMenuItem; private System.Windows.Forms.Panel panelContent; - private System.Windows.Forms.LinkLabel linkHelp; + private System.Windows.Forms.LinkLabel linkUpdateCheck; private System.Windows.Forms.ToolStripMenuItem helpMarkedFeatureToolStripMenuItem; private System.Windows.Forms.TreeView treeFeatures; private System.Windows.Forms.Label lblOSInfo; diff --git a/MSCFixer/MainForm.cs b/MSCFixer/MainForm.cs index 98c8622..ecc0315 100644 --- a/MSCFixer/MainForm.cs +++ b/MSCFixer/MainForm.cs @@ -1,5 +1,6 @@ using MSCFixer; using MSCFixer.Properties; +using MSCFixer.Views; using System; using System.Diagnostics; using System.Drawing; @@ -8,15 +9,17 @@ using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; using Views; +using static System.Windows.Forms.VisualStyles.VisualStyleElement; namespace Crapfixer { public partial class MainForm : Form { + private readonly string iniPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Crapfixer.ini"); + private NavigationManager navigationManager; private NavigationHandler navigationHandler; private readonly AppManagerService appManager = new AppManagerService(); - private readonly string iniPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Crapfixer.ini"); public MainForm() { @@ -25,18 +28,17 @@ namespace Crapfixer Logger.OutputBox = rtbLogger; FeatureNodeManager.LoadFeatures(treeFeatures); PluginManager.LoadPlugins(treeFeatures); - + IniStateManager.Load(treeFeatures, iniPath); } private void MainForm_Shown(object sender, EventArgs e) { InitializeUI(); - IniStateManager.Load(treeFeatures, iniPath); } private void InitializeUI() { - navigationHandler = new NavigationHandler(btnHome, btnRestore, btnSettings); + navigationHandler = new NavigationHandler(btnHome, btnSettings); btnHome.Click += (s, e) => { @@ -44,25 +46,20 @@ namespace Crapfixer navigationHandler.SetActive(btnHome); }; - btnRestore.Click += (s, e) => - { - navigationHandler.SetActive(btnRestore); - }; - btnSettings.Click += (s, e) => { - navigationManager.SwitchView(new SettingsView(navigationManager)); + navigationManager.SwitchView(new OptionsView(navigationManager)); navigationHandler.SetActive(btnSettings); }; - linkHelp.Click += (s, e) => + linkUpdateCheck.Click += (s, e) => { Process.Start("https://github.com/builtbybel/Crapfixer/issues"); }; UpdateTitleWithOSVersion(); // Update OS version label - this.lblVersionInfo.Text = $"v{Program.GetCurrentVersionTostring()} "; // Update version label + this.lblVersionInfo.Text = $"v{Program.GetAppVersion()} "; // Update version label } private async void UpdateTitleWithOSVersion() @@ -106,7 +103,7 @@ namespace Crapfixer .Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries) .Select(s => s.Trim()).ToArray() ?? Array.Empty(); - // Logger.Log("Using built-in bloatware list.", LogLevel.Info); + // Logger.Log("Using built-in bloatware list.", LogLevel.Info); } else { @@ -127,7 +124,6 @@ namespace Crapfixer } } - private async void btnFix_Click(object sender, EventArgs e) { rtbLogger.Clear(); @@ -318,5 +314,16 @@ namespace Crapfixer { IniStateManager.Save(treeFeatures, iniPath); } + + private void linkUpdateCheck_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + string version = Program.GetAppVersion(); + string url = $"https://builtbybel.github.io/Crapfixer/update-check.html?version={version}"; + Process.Start(new ProcessStartInfo + { + FileName = url, + UseShellExecute = true + }); + } } } \ No newline at end of file diff --git a/MSCFixer/Program.cs b/MSCFixer/Program.cs index 745bf14..a84b426 100644 --- a/MSCFixer/Program.cs +++ b/MSCFixer/Program.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Reflection; using System.Threading.Tasks; using System.Windows.Forms; @@ -8,20 +9,28 @@ namespace Crapfixer { internal static class Program { - /// - /// Get app version - /// - internal static string GetCurrentVersionTostring() => new Version(Application.ProductVersion).ToString(3); - /// /// The main entry point for the application. /// [STAThread] - static void Main() + private static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm()); } + + /// + /// Retrieves the version of the app + /// + /// The application version in the format "major.minor.build" + public static string GetAppVersion() + { + // Get the version of the current executing assembly + Version version = Assembly.GetExecutingAssembly().GetName().Version; + + // Return the version in the format "major.minor.build" + return $"{version.Major}.{version.Minor}.{version.Build}"; + } } -} +} \ No newline at end of file diff --git a/MSCFixer/Properties/AssemblyInfo.cs b/MSCFixer/Properties/AssemblyInfo.cs index f815d86..e046a7a 100644 --- a/MSCFixer/Properties/AssemblyInfo.cs +++ b/MSCFixer/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, // indem Sie "*" wie unten gezeigt eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.50.135")] -[assembly: AssemblyFileVersion("0.50.135")] +[assembly: AssemblyVersion("0.55.160")] +[assembly: AssemblyFileVersion("0.55.160")] diff --git a/MSCFixer/Views/AboutView.Designer.cs b/MSCFixer/Views/AboutView.Designer.cs new file mode 100644 index 0000000..fb75eb4 --- /dev/null +++ b/MSCFixer/Views/AboutView.Designer.cs @@ -0,0 +1,153 @@ +namespace Views +{ + partial class AboutView + { + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Komponenten-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + this.lblHeader = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.lblVersionInfo = new System.Windows.Forms.Label(); + this.linkGitHub = new System.Windows.Forms.LinkLabel(); + this.btnDonate = new System.Windows.Forms.Button(); + this.panelSettings = new System.Windows.Forms.Panel(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.panelSettings.SuspendLayout(); + this.SuspendLayout(); + // + // lblHeader + // + this.lblHeader.AutoEllipsis = true; + this.lblHeader.AutoSize = true; + this.lblHeader.Font = new System.Drawing.Font("Tahoma", 10F, System.Drawing.FontStyle.Bold); + this.lblHeader.ForeColor = System.Drawing.Color.Black; + this.lblHeader.Location = new System.Drawing.Point(61, 19); + this.lblHeader.Name = "lblHeader"; + this.lblHeader.Size = new System.Drawing.Size(69, 21); + this.lblHeader.TabIndex = 235; + this.lblHeader.Text = "Crapfixer"; + this.lblHeader.UseCompatibleTextRendering = true; + // + // label1 + // + this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.label1.AutoEllipsis = true; + this.label1.Location = new System.Drawing.Point(18, 121); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(589, 26); + this.label1.TabIndex = 236; + this.label1.Text = "You can download the latest version, report bugs and submit feature requests at t" + + "he following GitHub page."; + // + // pictureBox1 + // + this.pictureBox1.Image = global::MSCFixer.Properties.Resources.AppIcon32; + this.pictureBox1.Location = new System.Drawing.Point(18, 19); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(37, 34); + this.pictureBox1.TabIndex = 237; + this.pictureBox1.TabStop = false; + // + // lblVersionInfo + // + this.lblVersionInfo.AutoSize = true; + this.lblVersionInfo.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.5F); + this.lblVersionInfo.ForeColor = System.Drawing.Color.Black; + this.lblVersionInfo.Location = new System.Drawing.Point(61, 40); + this.lblVersionInfo.Name = "lblVersionInfo"; + this.lblVersionInfo.Size = new System.Drawing.Size(13, 13); + this.lblVersionInfo.TabIndex = 238; + this.lblVersionInfo.Text = "v"; + // + // linkGitHub + // + this.linkGitHub.AutoSize = true; + this.linkGitHub.Location = new System.Drawing.Point(37, 156); + this.linkGitHub.Name = "linkGitHub"; + this.linkGitHub.Size = new System.Drawing.Size(190, 13); + this.linkGitHub.TabIndex = 239; + this.linkGitHub.TabStop = true; + this.linkGitHub.Text = "https://github.com/builtbybel/Crapfixer"; + this.linkGitHub.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkGitHub_LinkClicked); + // + // btnDonate + // + this.btnDonate.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(131)))), ((int)(((byte)(222))))); + this.btnDonate.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnDonate.FlatAppearance.BorderSize = 0; + this.btnDonate.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnDonate.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnDonate.ForeColor = System.Drawing.Color.White; + this.btnDonate.Location = new System.Drawing.Point(60, 68); + this.btnDonate.Name = "btnDonate"; + this.btnDonate.Size = new System.Drawing.Size(207, 39); + this.btnDonate.TabIndex = 240; + this.btnDonate.Text = "Like Crapfixer? Support future updates on Ko-fi or PayPal"; + this.btnDonate.UseVisualStyleBackColor = false; + this.btnDonate.Click += new System.EventHandler(this.btnDonate_Click); + // + // panelSettings + // + this.panelSettings.Controls.Add(this.btnDonate); + this.panelSettings.Controls.Add(this.lblHeader); + this.panelSettings.Controls.Add(this.linkGitHub); + this.panelSettings.Controls.Add(this.label1); + this.panelSettings.Controls.Add(this.lblVersionInfo); + this.panelSettings.Controls.Add(this.pictureBox1); + this.panelSettings.Dock = System.Windows.Forms.DockStyle.Fill; + this.panelSettings.Location = new System.Drawing.Point(0, 0); + this.panelSettings.Name = "panelSettings"; + this.panelSettings.Size = new System.Drawing.Size(625, 395); + this.panelSettings.TabIndex = 242; + // + // AboutView + // + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; + this.AutoScroll = true; + this.BackColor = System.Drawing.Color.White; + this.Controls.Add(this.panelSettings); + this.Name = "AboutView"; + this.Size = new System.Drawing.Size(625, 395); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.panelSettings.ResumeLayout(false); + this.panelSettings.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + private System.Windows.Forms.Label lblHeader; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.PictureBox pictureBox1; + private System.Windows.Forms.Label lblVersionInfo; + private System.Windows.Forms.LinkLabel linkGitHub; + private System.Windows.Forms.Button btnDonate; + private System.Windows.Forms.Panel panelSettings; + } +} diff --git a/MSCFixer/Views/AboutView.cs b/MSCFixer/Views/AboutView.cs new file mode 100644 index 0000000..3d33afa --- /dev/null +++ b/MSCFixer/Views/AboutView.cs @@ -0,0 +1,67 @@ +using Crapfixer; +using MSCFixer.Views; +using System; +using System.Diagnostics; +using System.Windows.Forms; + +namespace Views +{ + public partial class AboutView : UserControl + + { + + public AboutView() + { + InitializeComponent(); + InitializeUI(); + } + + private void InitializeUI() + { + // Update version label + this.lblVersionInfo.Text = $"v{Program.GetAppVersion()} "; + } + + private void linkGitHub_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + Process.Start("https://github.com/builtbybel/Crapfixer/releases"); + } + + private void btnDonate_Click(object sender, EventArgs e) + { + var result = MessageBox.Show( + "Hi! I'm building Crapfixer solo. Want to support me and help launch Version 1.0?", + "Support Crapfixer ❤️", + MessageBoxButtons.YesNo, + MessageBoxIcon.Information); + + if (result == DialogResult.Yes) + { + var donationChoice = MessageBox.Show( + "Would you like to donate via PayPal? (Click No for Ko-fi)", + "Choose Your Support Method", + MessageBoxButtons.YesNoCancel, + MessageBoxIcon.Question); + + if (donationChoice == DialogResult.Yes) + { + System.Diagnostics.Process.Start(new ProcessStartInfo + { + FileName = "https://www.paypal.com/donate/?hosted_button_id=M9DW4VNKH9ECQ", + UseShellExecute = true + }); + } + else if (donationChoice == DialogResult.No) + { + System.Diagnostics.Process.Start(new ProcessStartInfo + { + FileName = "https://ko-fi.com/builtbybel", + UseShellExecute = true + }); + } + } + } + + + } +} \ No newline at end of file diff --git a/MSCFixer/Views/AboutView.resx b/MSCFixer/Views/AboutView.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/MSCFixer/Views/AboutView.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/MSCFixer/Views/OptionsView.Designer.cs b/MSCFixer/Views/OptionsView.Designer.cs new file mode 100644 index 0000000..6e8a797 --- /dev/null +++ b/MSCFixer/Views/OptionsView.Designer.cs @@ -0,0 +1,108 @@ +namespace MSCFixer.Views +{ + partial class OptionsView + { + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Komponenten-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + this.panelSettings = new System.Windows.Forms.Panel(); + this.panelSubContent = new System.Windows.Forms.Panel(); + this.btnAboutMenu = new System.Windows.Forms.Button(); + this.btnSettingsMenu = new System.Windows.Forms.Button(); + this.panelSettings.SuspendLayout(); + this.SuspendLayout(); + // + // panelSettings + // + this.panelSettings.BackColor = System.Drawing.Color.White; + this.panelSettings.Controls.Add(this.panelSubContent); + this.panelSettings.Controls.Add(this.btnAboutMenu); + this.panelSettings.Controls.Add(this.btnSettingsMenu); + this.panelSettings.Dock = System.Windows.Forms.DockStyle.Fill; + this.panelSettings.Location = new System.Drawing.Point(0, 0); + this.panelSettings.Name = "panelSettings"; + this.panelSettings.Size = new System.Drawing.Size(625, 395); + this.panelSettings.TabIndex = 243; + // + // panelSubContent + // + this.panelSubContent.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.panelSubContent.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panelSubContent.Location = new System.Drawing.Point(135, 14); + this.panelSubContent.Name = "panelSubContent"; + this.panelSubContent.Size = new System.Drawing.Size(474, 363); + this.panelSubContent.TabIndex = 246; + // + // btnAboutMenu + // + this.btnAboutMenu.BackColor = System.Drawing.Color.White; + this.btnAboutMenu.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(153)))), ((int)(((byte)(180)))), ((int)(((byte)(209))))); + this.btnAboutMenu.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnAboutMenu.Font = new System.Drawing.Font("Tahoma", 8F); + this.btnAboutMenu.Location = new System.Drawing.Point(14, 53); + this.btnAboutMenu.Name = "btnAboutMenu"; + this.btnAboutMenu.Size = new System.Drawing.Size(107, 34); + this.btnAboutMenu.TabIndex = 242; + this.btnAboutMenu.Text = "About"; + this.btnAboutMenu.UseVisualStyleBackColor = false; + this.btnAboutMenu.Click += new System.EventHandler(this.btnAboutMenu_Click); + // + // btnSettingsMenu + // + this.btnSettingsMenu.BackColor = System.Drawing.Color.White; + this.btnSettingsMenu.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(153)))), ((int)(((byte)(180)))), ((int)(((byte)(209))))); + this.btnSettingsMenu.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnSettingsMenu.Font = new System.Drawing.Font("Tahoma", 8F); + this.btnSettingsMenu.Location = new System.Drawing.Point(14, 13); + this.btnSettingsMenu.Name = "btnSettingsMenu"; + this.btnSettingsMenu.Size = new System.Drawing.Size(107, 34); + this.btnSettingsMenu.TabIndex = 241; + this.btnSettingsMenu.Text = "Settings"; + this.btnSettingsMenu.UseVisualStyleBackColor = false; + this.btnSettingsMenu.Click += new System.EventHandler(this.btnSettingsMenu_Click); + // + // OptionsView + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.panelSettings); + this.Name = "OptionsView"; + this.Size = new System.Drawing.Size(625, 395); + this.panelSettings.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel panelSettings; + private System.Windows.Forms.Button btnSettingsMenu; + private System.Windows.Forms.Button btnAboutMenu; + private System.Windows.Forms.Panel panelSubContent; + } +} diff --git a/MSCFixer/Views/OptionsView.cs b/MSCFixer/Views/OptionsView.cs new file mode 100644 index 0000000..a4c1884 --- /dev/null +++ b/MSCFixer/Views/OptionsView.cs @@ -0,0 +1,28 @@ +using System; +using System.Windows.Forms; +using Views; + +namespace MSCFixer.Views +{ + public partial class OptionsView : UserControl + { + private NavigationManager subNavigation; + + public OptionsView(NavigationManager navigationManager) + { + InitializeComponent(); + subNavigation = new NavigationManager(panelSubContent); + subNavigation.SwitchView(new AboutView()); // Startsite + } + + private void btnAboutMenu_Click(object sender, EventArgs e) + { + subNavigation.SwitchView(new AboutView()); + } + + private void btnSettingsMenu_Click(object sender, EventArgs e) + { + subNavigation.SwitchView(new SettingsView()); + } + } +} \ No newline at end of file diff --git a/MSCFixer/Views/OptionsView.resx b/MSCFixer/Views/OptionsView.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/MSCFixer/Views/OptionsView.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/MSCFixer/Views/SettingsView.Designer.cs b/MSCFixer/Views/SettingsView.Designer.cs index dd781cf..fbed524 100644 --- a/MSCFixer/Views/SettingsView.Designer.cs +++ b/MSCFixer/Views/SettingsView.Designer.cs @@ -1,4 +1,4 @@ -namespace Views +namespace MSCFixer.Views { partial class SettingsView { @@ -28,159 +28,72 @@ /// private void InitializeComponent() { - this.lblHeader = new System.Windows.Forms.Label(); - this.label1 = new System.Windows.Forms.Label(); - this.pictureBox1 = new System.Windows.Forms.PictureBox(); - this.lblVersionInfo = new System.Windows.Forms.Label(); - this.linkGitHub = new System.Windows.Forms.LinkLabel(); - this.btnDonate = new System.Windows.Forms.Button(); - this.panelSettings = new System.Windows.Forms.Panel(); + this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.checkBox2 = new System.Windows.Forms.CheckBox(); this.button1 = new System.Windows.Forms.Button(); - this.button2 = new System.Windows.Forms.Button(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); - this.panelSettings.SuspendLayout(); this.SuspendLayout(); // - // lblHeader + // checkBox1 // - this.lblHeader.AutoEllipsis = true; - this.lblHeader.AutoSize = true; - this.lblHeader.Font = new System.Drawing.Font("Tahoma", 10F, System.Drawing.FontStyle.Bold); - this.lblHeader.ForeColor = System.Drawing.Color.Black; - this.lblHeader.Location = new System.Drawing.Point(195, 16); - this.lblHeader.Name = "lblHeader"; - this.lblHeader.Size = new System.Drawing.Size(69, 21); - this.lblHeader.TabIndex = 235; - this.lblHeader.Text = "Crapfixer"; - this.lblHeader.UseCompatibleTextRendering = true; + this.checkBox1.AutoSize = true; + this.checkBox1.Checked = true; + this.checkBox1.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBox1.Enabled = false; + this.checkBox1.Location = new System.Drawing.Point(15, 44); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size(135, 17); + this.checkBox1.TabIndex = 0; + this.checkBox1.Text = "Save settings to INI file"; + this.checkBox1.UseVisualStyleBackColor = true; // - // label1 + // checkBox2 // - this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label1.AutoEllipsis = true; - this.label1.Location = new System.Drawing.Point(168, 118); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(454, 26); - this.label1.TabIndex = 236; - this.label1.Text = "You can download the latest version, report bugs and submit feature requests at t" + - "he following GitHub page."; - // - // pictureBox1 - // - this.pictureBox1.Image = global::MSCFixer.Properties.Resources.AppIcon32; - this.pictureBox1.Location = new System.Drawing.Point(152, 16); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(37, 34); - this.pictureBox1.TabIndex = 237; - this.pictureBox1.TabStop = false; - // - // lblVersionInfo - // - this.lblVersionInfo.AutoSize = true; - this.lblVersionInfo.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.5F); - this.lblVersionInfo.ForeColor = System.Drawing.Color.Black; - this.lblVersionInfo.Location = new System.Drawing.Point(195, 37); - this.lblVersionInfo.Name = "lblVersionInfo"; - this.lblVersionInfo.Size = new System.Drawing.Size(13, 13); - this.lblVersionInfo.TabIndex = 238; - this.lblVersionInfo.Text = "v"; - // - // linkGitHub - // - this.linkGitHub.AutoSize = true; - this.linkGitHub.Location = new System.Drawing.Point(183, 156); - this.linkGitHub.Name = "linkGitHub"; - this.linkGitHub.Size = new System.Drawing.Size(190, 13); - this.linkGitHub.TabIndex = 239; - this.linkGitHub.TabStop = true; - this.linkGitHub.Text = "https://github.com/builtbybel/Crapfixer"; - this.linkGitHub.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkGitHub_LinkClicked); - // - // btnDonate - // - this.btnDonate.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(131)))), ((int)(((byte)(222))))); - this.btnDonate.Cursor = System.Windows.Forms.Cursors.Hand; - this.btnDonate.FlatAppearance.BorderSize = 0; - this.btnDonate.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnDonate.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnDonate.ForeColor = System.Drawing.Color.White; - this.btnDonate.Location = new System.Drawing.Point(194, 65); - this.btnDonate.Name = "btnDonate"; - this.btnDonate.Size = new System.Drawing.Size(207, 39); - this.btnDonate.TabIndex = 240; - this.btnDonate.Text = "Like Crapfixer? Support future updates on Ko-fi or PayPal"; - this.btnDonate.UseVisualStyleBackColor = false; - this.btnDonate.Click += new System.EventHandler(this.btnDonate_Click); - // - // panelSettings - // - this.panelSettings.Controls.Add(this.button1); - this.panelSettings.Controls.Add(this.btnDonate); - this.panelSettings.Controls.Add(this.lblHeader); - this.panelSettings.Controls.Add(this.linkGitHub); - this.panelSettings.Controls.Add(this.label1); - this.panelSettings.Controls.Add(this.lblVersionInfo); - this.panelSettings.Controls.Add(this.pictureBox1); - this.panelSettings.Controls.Add(this.button2); - this.panelSettings.Dock = System.Windows.Forms.DockStyle.Fill; - this.panelSettings.Location = new System.Drawing.Point(0, 0); - this.panelSettings.Name = "panelSettings"; - this.panelSettings.Size = new System.Drawing.Size(625, 395); - this.panelSettings.TabIndex = 242; + this.checkBox2.AutoSize = true; + this.checkBox2.Checked = true; + this.checkBox2.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBox2.Enabled = false; + this.checkBox2.Location = new System.Drawing.Point(15, 67); + this.checkBox2.Name = "checkBox2"; + this.checkBox2.Size = new System.Drawing.Size(211, 17); + this.checkBox2.TabIndex = 1; + this.checkBox2.Text = "Activate Plugins for PowerShell Tooling"; + this.checkBox2.UseVisualStyleBackColor = true; // // button1 // - this.button1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(242)))), ((int)(((byte)(242)))), ((int)(((byte)(242))))); - this.button1.Enabled = false; - this.button1.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(153)))), ((int)(((byte)(180)))), ((int)(((byte)(209))))); + this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.button1.BackColor = System.Drawing.Color.WhiteSmoke; + this.button1.FlatAppearance.BorderColor = System.Drawing.Color.Gainsboro; this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.button1.Font = new System.Drawing.Font("Tahoma", 8F); - this.button1.Location = new System.Drawing.Point(10, 53); + this.button1.Location = new System.Drawing.Point(15, 10); this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(107, 34); - this.button1.TabIndex = 241; - this.button1.Text = "Settings"; + this.button1.Padding = new System.Windows.Forms.Padding(20, 0, 0, 0); + this.button1.Size = new System.Drawing.Size(594, 25); + this.button1.TabIndex = 2; + this.button1.Text = "Basic settings"; + this.button1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.button1.UseVisualStyleBackColor = false; // - // button2 - // - this.button2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(242)))), ((int)(((byte)(242)))), ((int)(((byte)(242))))); - this.button2.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(153)))), ((int)(((byte)(180)))), ((int)(((byte)(209))))); - this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.button2.Font = new System.Drawing.Font("Tahoma", 8F); - this.button2.Location = new System.Drawing.Point(10, 13); - this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(107, 34); - this.button2.TabIndex = 242; - this.button2.Text = "About"; - this.button2.UseVisualStyleBackColor = false; - // // SettingsView // - this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; - this.AutoScroll = true; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.White; - this.Controls.Add(this.panelSettings); + this.Controls.Add(this.button1); + this.Controls.Add(this.checkBox2); + this.Controls.Add(this.checkBox1); this.Name = "SettingsView"; this.Size = new System.Drawing.Size(625, 395); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); - this.panelSettings.ResumeLayout(false); - this.panelSettings.PerformLayout(); this.ResumeLayout(false); + this.PerformLayout(); } #endregion - private System.Windows.Forms.Label lblHeader; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.PictureBox pictureBox1; - private System.Windows.Forms.Label lblVersionInfo; - private System.Windows.Forms.LinkLabel linkGitHub; - private System.Windows.Forms.Button btnDonate; - private System.Windows.Forms.Panel panelSettings; + + private System.Windows.Forms.CheckBox checkBox1; + private System.Windows.Forms.CheckBox checkBox2; private System.Windows.Forms.Button button1; - private System.Windows.Forms.Button button2; } } diff --git a/MSCFixer/Views/SettingsView.cs b/MSCFixer/Views/SettingsView.cs index 6060150..bf86eb0 100644 --- a/MSCFixer/Views/SettingsView.cs +++ b/MSCFixer/Views/SettingsView.cs @@ -3,65 +3,15 @@ using System; using System.Diagnostics; using System.Windows.Forms; -namespace Views +namespace MSCFixer.Views { public partial class SettingsView : UserControl - { - private NavigationManager navigationManager; - - public SettingsView(NavigationManager navigationManager) + public SettingsView() { InitializeComponent(); - this.navigationManager = navigationManager; - InitializeUI(); - } - - private void InitializeUI() - { - // Update version label - this.lblVersionInfo.Text = $"v{Program.GetCurrentVersionTostring()} "; - } - - private void linkGitHub_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) - { - Process.Start("https://github.com/builtbybel/Crapfixer/releases"); - } - - private void btnDonate_Click(object sender, EventArgs e) - { - var result = MessageBox.Show( - "Hi! I'm building Crapfixer solo. Want to support me and help launch Version 1.0?", - "Support Crapfixer ❤️", - MessageBoxButtons.YesNo, - MessageBoxIcon.Information); - - if (result == DialogResult.Yes) - { - var donationChoice = MessageBox.Show( - "Would you like to donate via PayPal? (Click No for Ko-fi)", - "Choose Your Support Method", - MessageBoxButtons.YesNoCancel, - MessageBoxIcon.Question); - - if (donationChoice == DialogResult.Yes) - { - System.Diagnostics.Process.Start(new ProcessStartInfo - { - FileName = "https://www.paypal.com/donate/?hosted_button_id=M9DW4VNKH9ECQ", - UseShellExecute = true - }); - } - else if (donationChoice == DialogResult.No) - { - System.Diagnostics.Process.Start(new ProcessStartInfo - { - FileName = "https://ko-fi.com/builtbybel", - UseShellExecute = true - }); - } - } } + } } \ No newline at end of file diff --git a/README.md b/README.md index 3a32917..21f4f20 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,21 @@ -# Crapfixer: The Tool That Says What Everyone's Thinking +# Crapf🧼xer -## Because Microsoft Would Build This, If They Hated Bloatware As Much As We Do +# the tool that says what everyone's thinking +## the tool Microsoft would build, if they hated bloatware as much as we do -Remember the good old days of registry cleaners and "Top 10 Windows Optimizers"? You'd think sleek OSes like Windows 11 would make them obsolete. Instead, we're "blessed" with new frustrations: Start menu ads, invasive data collection, and pre-installed junk apps you can't easily ditch. It's wild that we still need tools like this in 2025. +Remember the days when you'd run a registry cleaner even if you didn't really need it? (Or maybe we did need it? I was probably too young to figure that out, too young for that crap 😅). +Back then, cleaner tools like CCleaner were everywhere - it felt like every other tech forum had a "top 10 Windows Optimizers" list. + +You'd think that stuff would be over by now with sleek, modern OSes like Windows 11. Well... the built-in Windows cleaner might be enough, sure. +But instead, the "modern OS" blesses us with a whole new batch of problems: ads in the Start menu, creepy data collection, preinstalled junk apps you didn't ask for and can't easily remove. +It's kind of wild that we still need tools like this in 2025. And they don't even sound that different, like this one here: Crapfixer. +What can I say? The tech world is a bitch. Enter **Crapfixer**. -This isn't just another cleaner. It's my personal IT toolbox, honed over 7+ years and recently given a full refresh, especially for Windows 11 (also works great on Windows 10). I've stripped out the old enterprise scripts, resulting in a **lightweight, easy-to-use, and safe application.** The best part? **Almost every change you make can be undone**, so you can tweak without fear. +This isn't just another cleaner. It's my personal IT toolbox, honed over 7+ years and recently given a full refresh, especially for Windows 11 (it also works great on Windows 10). I've stripped out the old enterprise scripts, resulting in a **lightweight, easy-to-use, and safe application**. The best part? **Almost every change you make can be undone**, so you can tweak without fear. -Crapfixer proudly sports a look from the Windows XP era (think CCleaner vibes!) – and that's intentional. Sometimes, simple just beats fancy. It's all about **two clicks: 'Analyze', review, 'Fix' – done.** No drama, no bloat. +Crapfixer proudly sports a look from the Windows XP era (think CCleaner vibes!) - and that's intentional. Sometimes, simple just beats fancy. It's all about **two clicks: 'Analyze', review, 'Fix' - done.** No drama, no bloat. While cleaning up my GitHub (slashing 30+ repos down to 20 and tidying thousands of lines of code), Crapfixer is one of the keepers. It's fast, straightforward, and practically bulletproof. (Seriously, I haven't managed to break anything with it yet. 😉) @@ -29,13 +36,13 @@ _Heads up: The updated code for Crapfixer will be committed to GitHub soon if th Using Crapfixer is designed to be straightforward: -1. **Launch the Tool:** All optimization options are enabled by default to save you time. -2. **Analyze Your System:** Simply click the "Analyze" button. Crapfixer will check your system against the selected options. - - Items marked in **red** are recommended fixes. - - Items in **gray** are already configured correctly. -3. **Apply Fixes:** Then just smash that "Run CFixer!" button and you're good to go. +1. **Launch the Tool:** All optimization options are enabled by default to save you time. +2. **Analyze Your System:** Simply click the "Analyze" button. Crapfixer will check your system against the selected options. + - Items marked in **red** are recommended fixes. + - Items in **gray** are already configured correctly. +3. **Apply Fixes:** Then just smash that "Run CFixer!" button and you're good to go. -_For full functionality, it's recommended to run the app as Administrator, since certain features – like editing registry values under HKEY_LOCAL_MACHINE – require elevated permissions._ +_For full functionality, it's recommended to run the app as Administrator, since certain features - like editing registry values under HKEY_LOCAL_MACHINE - require elevated permissions._ ## System Requirements @@ -45,4 +52,4 @@ _For full functionality, it's recommended to run the app as Administrator, since ## License -This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details. \ No newline at end of file +This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details. diff --git a/docs/update-check.html b/docs/update-check.html new file mode 100644 index 0000000..a9cdda3 --- /dev/null +++ b/docs/update-check.html @@ -0,0 +1,115 @@ + + + + + + Crapfixer Update Check + + + +

🔍 Crapfixer Update Check

+

Checking version...

+ + + + + + + +