From 8ec65905b1679f2d8259ee78144dd4e1a78edffb Mon Sep 17 00:00:00 2001 From: Peter Date: Tue, 13 May 2025 01:18:42 +1000 Subject: [PATCH 1/4] refactor(views): update AutoScaleMode to DPI in SettingsView and OptionsView This change ensures better scaling behavior for high-DPI displays by switching from Font-based scaling to DPI-based scaling. The modification improves the visual consistency of the application across different screen resolutions. --- MSCFixer/Views/OptionsView.Designer.cs | 36 ++++++++++++------------- MSCFixer/Views/SettingsView.Designer.cs | 30 ++++++++++----------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/MSCFixer/Views/OptionsView.Designer.cs b/MSCFixer/Views/OptionsView.Designer.cs index 6e8a797..887396e 100644 --- a/MSCFixer/Views/OptionsView.Designer.cs +++ b/MSCFixer/Views/OptionsView.Designer.cs @@ -2,12 +2,12 @@ { partial class OptionsView { - /// + /// /// Erforderliche Designervariable. /// private System.ComponentModel.IContainer components = null; - /// + /// /// Verwendete Ressourcen bereinigen. /// /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. @@ -22,8 +22,8 @@ #region Vom Komponenten-Designer generierter Code - /// - /// Erforderliche Methode für die Designerunterstützung. + /// + /// Erforderliche Methode für die Designerunterstützung. /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. /// private void InitializeComponent() @@ -34,9 +34,9 @@ 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); @@ -46,20 +46,20 @@ 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) + // + 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; @@ -71,9 +71,9 @@ 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; @@ -85,11 +85,11 @@ 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.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.Controls.Add(this.panelSettings); this.Name = "OptionsView"; this.Size = new System.Drawing.Size(625, 395); diff --git a/MSCFixer/Views/SettingsView.Designer.cs b/MSCFixer/Views/SettingsView.Designer.cs index fbed524..e5538b4 100644 --- a/MSCFixer/Views/SettingsView.Designer.cs +++ b/MSCFixer/Views/SettingsView.Designer.cs @@ -2,12 +2,12 @@ { partial class SettingsView { - /// + /// /// Erforderliche Designervariable. /// private System.ComponentModel.IContainer components = null; - /// + /// /// Verwendete Ressourcen bereinigen. /// /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. @@ -22,8 +22,8 @@ #region Vom Komponenten-Designer generierter Code - /// - /// Erforderliche Methode für die Designerunterstützung. + /// + /// Erforderliche Methode für die Designerunterstützung. /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. /// private void InitializeComponent() @@ -32,9 +32,9 @@ this.checkBox2 = new System.Windows.Forms.CheckBox(); this.button1 = new System.Windows.Forms.Button(); this.SuspendLayout(); - // + // // checkBox1 - // + // this.checkBox1.AutoSize = true; this.checkBox1.Checked = true; this.checkBox1.CheckState = System.Windows.Forms.CheckState.Checked; @@ -45,9 +45,9 @@ this.checkBox1.TabIndex = 0; this.checkBox1.Text = "Save settings to INI file"; this.checkBox1.UseVisualStyleBackColor = true; - // + // // checkBox2 - // + // this.checkBox2.AutoSize = true; this.checkBox2.Checked = true; this.checkBox2.CheckState = System.Windows.Forms.CheckState.Checked; @@ -58,10 +58,10 @@ this.checkBox2.TabIndex = 1; this.checkBox2.Text = "Activate Plugins for PowerShell Tooling"; this.checkBox2.UseVisualStyleBackColor = true; - // + // // button1 - // - this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + // + 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; @@ -74,11 +74,11 @@ this.button1.Text = "Basic settings"; this.button1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.button1.UseVisualStyleBackColor = false; - // + // // SettingsView - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + // + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.BackColor = System.Drawing.Color.White; this.Controls.Add(this.button1); this.Controls.Add(this.checkBox2); From 2e2b4fd5c850ce76f46c530c5bb97f1e627b4ee4 Mon Sep 17 00:00:00 2001 From: Peter Date: Sun, 18 May 2025 00:05:19 +1000 Subject: [PATCH 2/4] refactor(plugins): improve script readability and admin checks - Standardized spacing and formatting in CFEnhancer.txt - Added admin privilege checks and warnings in Restart Explorer.ps1, Uninstall OneDrive.ps1, Restore all built-in apps.ps1 - Simplified admin check logic in Create Restore Point.ps1 - Enhanced success reporting in Restore all built-in apps.ps1 - Grouped apps by Microsoft and third-party in Remove default apps.ps1 --- plugins/CFEnhancer.txt | 8 ++++---- plugins/Create Restore Point.ps1 | 9 ++++----- plugins/Remove default apps.ps1 | 11 ++++++----- plugins/Restart Explorer.ps1 | 13 +++++++++++-- plugins/Restore all built-in apps.ps1 | 17 +++++++++++++++-- plugins/Uninstall OneDrive.ps1 | 13 +++++++++++-- 6 files changed, 51 insertions(+), 20 deletions(-) diff --git a/plugins/CFEnhancer.txt b/plugins/CFEnhancer.txt index 051c206..232edfc 100644 --- a/plugins/CFEnhancer.txt +++ b/plugins/CFEnhancer.txt @@ -1,6 +1,6 @@ -Solitaire,CandyCrush,Netflix,TikTok,Facebook,Twitter,Instagram,Spotify, -Skype,OneNote,OneDrive, Mail, Calendar, Weather,News,Maps, -Groove, Movies,TV, Phone, Camera,Feedback,FeedbackHub, GetHelp, +Solitaire,CandyCrush,Netflix,TikTok,Facebook,Twitter,Instagram,Spotify, +Skype,OneNote,OneDrive,Mail,Calendar,Weather,News,Maps, +Groove,Movies,TV,Phone,Camera,Feedback,FeedbackHub,GetHelp, GetStarted,Messaging,Office,Paint3D,Print3D,StickyNotes,Wallet, YourPhone,3DViewer,Alarms,VoiceRecorder,ToDo,Whiteboard,ZuneMusic, -ZuneVideo,3DViewer, DevHome, Copilot \ No newline at end of file +ZuneVideo,DevHome,Copilot \ No newline at end of file diff --git a/plugins/Create Restore Point.ps1 b/plugins/Create Restore Point.ps1 index 24c0888..55a6ae2 100644 --- a/plugins/Create Restore Point.ps1 +++ b/plugins/Create Restore Point.ps1 @@ -1,6 +1,5 @@ # Run as Admin -if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) -{ +if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Write-Warning "You need to run this script as an Administrator!" exit } @@ -15,7 +14,7 @@ $restorePointType = 12 # MODIFY_SETTINGS = 12 # Function to create restore point with progress reporting function Create-RestorePoint { Write-Host "Starting to create restore point..." -ForegroundColor Yellow - + # Simulate progress for ($i = 0; $i -le 100; $i += 10) { Write-Progress -Activity "Creating Restore Point" -Status "$i% Complete" -PercentComplete $i @@ -28,10 +27,10 @@ function Create-RestorePoint { } Write-Host "Restore point created successfully." -ForegroundColor Green - + # Show completion message [System.Windows.Forms.MessageBox]::Show("Restore point has been created successfully!", "Completion", [System.Windows.Forms.MessageBoxButtons]::OK, [System.Windows.Forms.MessageBoxIcon]::Information) } # Execute the restore point creation -Create-RestorePoint +Create-RestorePoint \ No newline at end of file diff --git a/plugins/Remove default apps.ps1 b/plugins/Remove default apps.ps1 index 98a1ce4..b5d57d5 100644 --- a/plugins/Remove default apps.ps1 +++ b/plugins/Remove default apps.ps1 @@ -10,7 +10,8 @@ do {} until (Elevate-Privileges SeTakeOwnershipPrivilege) Write-Output "Uninstalling default apps" $apps = @( - # default Windows 10 apps + # Group by Microsoft and third-party + # Microsoft Apps "Microsoft.549981C3F5F10" #Cortana "Microsoft.3DBuilder" "Microsoft.Appconnector" @@ -90,7 +91,7 @@ $apps = @( "A278AB0D.DisneyMagicKingdoms" "A278AB0D.MarchofEmpires" "ActiproSoftwareLLC.562882FEEB491" # next one is for the Code Writer from Actipro Software LLC - "CAF9E577.Plex" + "CAF9E577.Plex" "ClearChannelRadioDigital.iHeartRadio" "D52A8D61.FarmVille2CountryEscape" "D5EA27B7.Duolingo-LearnLanguagesforFree" @@ -138,8 +139,8 @@ foreach ($app in $apps) { Get-AppxPackage -Name $app -AllUsers | Remove-AppxPackage -AllUsers - ($appxprovisionedpackage).Where( {$_.DisplayName -EQ $app}) | - Remove-AppxProvisionedPackage -Online + ($appxprovisionedpackage).Where( { $_.DisplayName -EQ $app }) | + Remove-AppxProvisionedPackage -Online } Write-Host "Clippy has completed the process and removed all possible apps." # Prevents Apps from re-installing @@ -169,4 +170,4 @@ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\WindowsStore" "AutoDow # Prevents "Suggested Applications" returning New-FolderForced -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" "DisableWindowsConsumerFeatures" 1 +Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" "DisableWindowsConsumerFeatures" 1 \ No newline at end of file diff --git a/plugins/Restart Explorer.ps1 b/plugins/Restart Explorer.ps1 index e926aa9..27bcb23 100644 --- a/plugins/Restart Explorer.ps1 +++ b/plugins/Restart Explorer.ps1 @@ -1,4 +1,13 @@ -# Function to show a message box +#Requires -RunAsAdministrator + +# Check if running as Administrator +if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { + Write-Warning "This script is recommended to be run as Administrator for best results." + # Decide if you want to force exit or just warn + # exit # Uncomment to force admin +} + +# Function to show a message box function Show-MessageBox { param ( [string]$message, @@ -15,4 +24,4 @@ Stop-Process -Name explorer -Force Start-Process explorer # Show message box -Show-MessageBox -message "Windows Explorer has been restarted successfully." -title "Crapfixer" +Show-MessageBox -message "Windows Explorer has been restarted successfully." -title "Crapfixer" \ No newline at end of file diff --git a/plugins/Restore all built-in apps.ps1 b/plugins/Restore all built-in apps.ps1 index 0db23e8..fa54a00 100644 --- a/plugins/Restore all built-in apps.ps1 +++ b/plugins/Restore all built-in apps.ps1 @@ -1,3 +1,12 @@ +#Requires -RunAsAdministrator + +# Check if running as Administrator +if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { + Write-Warning "This script must be run as Administrator." + Start-Process powershell.exe -Verb RunAs -ArgumentList ("-File `"{0}`"" -f $MyInvocation.MyCommand.Path) + exit +} + # Get all installed Windows apps for all users $allApps = Get-AppxPackage -AllUsers @@ -16,7 +25,8 @@ foreach ($app in $allApps) { Add-AppxPackage -Register "$($app.InstallLocation)\appxmanifest.xml" -DisableDevelopmentMode -ErrorAction Stop Write-Host "[$currentAppIndex / $totalApps] $($app.Name) reinstalled successfully." -ForegroundColor Green $reinstalledCount++ - } catch { + } + catch { Write-Host "[$currentAppIndex / $totalApps] Error occurred while reinstalling $($app.Name): $_" -ForegroundColor Red } @@ -28,4 +38,7 @@ foreach ($app in $allApps) { if ($reinstalledCount -eq $totalApps) { Write-Host "All apps reinstalled successfully." -ForegroundColor Green Write-Host "Flyby11 has reinstalled everything possible." -ForegroundColor Cyan -} + # Add success percentage reporting + $successPercentage = [math]::Round(($reinstalledCount / $totalApps) * 100, 2) + Write-Host "Completed with $successPercentage% success rate ($reinstalledCount of $totalApps apps reinstalled)" -ForegroundColor Cyan +} \ No newline at end of file diff --git a/plugins/Uninstall OneDrive.ps1 b/plugins/Uninstall OneDrive.ps1 index 6567bd3..4604e42 100644 --- a/plugins/Uninstall OneDrive.ps1 +++ b/plugins/Uninstall OneDrive.ps1 @@ -1,3 +1,12 @@ +#Requires -RunAsAdministrator + +# Check if running as Administrator +if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { + Write-Warning "This script must be run as Administrator." + Start-Process powershell.exe -Verb RunAs -ArgumentList ("-File `"{0}`"" -f $MyInvocation.MyCommand.Path) + exit +} + Import-Module -DisableNameChecking $PSScriptRoot\..\lib\force-mkdir.psm1 Import-Module -DisableNameChecking $PSScriptRoot\..\lib\take-own.psm1 @@ -50,11 +59,11 @@ Write-Output "Restarting explorer" Start-Process "explorer.exe" Write-Output "Waiting for explorer to complete loading" -Start-Sleep 10 +Start-Sleep 10 # Consider if this sleep is always necessary or could be shorter/conditional Write-Output "Removing additional OneDrive leftovers" foreach ($item in (Get-ChildItem "$env:WinDir\WinSxS\*onedrive*")) { Takeown-Folder $item.FullName Remove-Item -Recurse -Force $item.FullName } -Write-Output "Bloatynosy NueEx can confirm the uninstallation of the OneDrive app." +Write-Output "Bloatynosy NueEx can confirm the uninstallation of the OneDrive app." \ No newline at end of file From 275227bc2e20460ce3175bfa2cc6fcc6af0ff7b6 Mon Sep 17 00:00:00 2001 From: Peter Date: Sun, 18 May 2025 00:12:11 +1000 Subject: [PATCH 3/4] Revert "refactor(views): update AutoScaleMode to DPI in SettingsView and OptionsView" This reverts commit 8ec65905b1679f2d8259ee78144dd4e1a78edffb. --- MSCFixer/Views/OptionsView.Designer.cs | 36 ++++++++++++------------- MSCFixer/Views/SettingsView.Designer.cs | 30 ++++++++++----------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/MSCFixer/Views/OptionsView.Designer.cs b/MSCFixer/Views/OptionsView.Designer.cs index 887396e..6e8a797 100644 --- a/MSCFixer/Views/OptionsView.Designer.cs +++ b/MSCFixer/Views/OptionsView.Designer.cs @@ -2,12 +2,12 @@ { partial class OptionsView { - /// + /// /// Erforderliche Designervariable. /// private System.ComponentModel.IContainer components = null; - /// + /// /// Verwendete Ressourcen bereinigen. /// /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. @@ -22,8 +22,8 @@ #region Vom Komponenten-Designer generierter Code - /// - /// Erforderliche Methode für die Designerunterstützung. + /// + /// Erforderliche Methode für die Designerunterstützung. /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. /// private void InitializeComponent() @@ -34,9 +34,9 @@ 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); @@ -46,20 +46,20 @@ 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) + // + 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; @@ -71,9 +71,9 @@ 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; @@ -85,11 +85,11 @@ this.btnSettingsMenu.Text = "Settings"; this.btnSettingsMenu.UseVisualStyleBackColor = false; this.btnSettingsMenu.Click += new System.EventHandler(this.btnSettingsMenu_Click); - // + // // OptionsView - // - this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; + // + 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); diff --git a/MSCFixer/Views/SettingsView.Designer.cs b/MSCFixer/Views/SettingsView.Designer.cs index e5538b4..fbed524 100644 --- a/MSCFixer/Views/SettingsView.Designer.cs +++ b/MSCFixer/Views/SettingsView.Designer.cs @@ -2,12 +2,12 @@ { partial class SettingsView { - /// + /// /// Erforderliche Designervariable. /// private System.ComponentModel.IContainer components = null; - /// + /// /// Verwendete Ressourcen bereinigen. /// /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. @@ -22,8 +22,8 @@ #region Vom Komponenten-Designer generierter Code - /// - /// Erforderliche Methode für die Designerunterstützung. + /// + /// Erforderliche Methode für die Designerunterstützung. /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. /// private void InitializeComponent() @@ -32,9 +32,9 @@ this.checkBox2 = new System.Windows.Forms.CheckBox(); this.button1 = new System.Windows.Forms.Button(); this.SuspendLayout(); - // + // // checkBox1 - // + // this.checkBox1.AutoSize = true; this.checkBox1.Checked = true; this.checkBox1.CheckState = System.Windows.Forms.CheckState.Checked; @@ -45,9 +45,9 @@ this.checkBox1.TabIndex = 0; this.checkBox1.Text = "Save settings to INI file"; this.checkBox1.UseVisualStyleBackColor = true; - // + // // checkBox2 - // + // this.checkBox2.AutoSize = true; this.checkBox2.Checked = true; this.checkBox2.CheckState = System.Windows.Forms.CheckState.Checked; @@ -58,10 +58,10 @@ this.checkBox2.TabIndex = 1; this.checkBox2.Text = "Activate Plugins for PowerShell Tooling"; this.checkBox2.UseVisualStyleBackColor = true; - // + // // button1 - // - this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + // + 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; @@ -74,11 +74,11 @@ this.button1.Text = "Basic settings"; this.button1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.button1.UseVisualStyleBackColor = false; - // + // // SettingsView - // - this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; + // + 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.button1); this.Controls.Add(this.checkBox2); From 1a76d1380f14a019c45c4b1f75d3a3b25acb9584 Mon Sep 17 00:00:00 2001 From: Peter Date: Sun, 18 May 2025 00:26:00 +1000 Subject: [PATCH 4/4] style: improve code formatting and readability in HTML and Markdown files Refactor HTML and Markdown files to enhance readability by fixing indentation, line breaks, and spacing. No functional changes were made, only formatting improvements. --- README.md | 5 +- docs/log-analyzer/index.html | 379 ++++++++++++++++++----------------- docs/update-check.html | 11 +- 3 files changed, 209 insertions(+), 186 deletions(-) diff --git a/README.md b/README.md index a29644a..3e07d5f 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,9 @@ While cleaning up my GitHub (30+ repos down to 20 now), I also cleaned up thousa All optimization options are enabled by default – no need to tweak anything. 2. **Analyze Your System** - Click **"Analyze"** to scan your system based on the selected settings. - - **Red** items = Recommended fixes + Click **"Analyze"** to scan your system based on the selected settings. + + - **Red** items = Recommended fixes - **Gray** items = Already optimized 3. **Apply Fixes** diff --git a/docs/log-analyzer/index.html b/docs/log-analyzer/index.html index 0b46998..614a127 100644 --- a/docs/log-analyzer/index.html +++ b/docs/log-analyzer/index.html @@ -1,212 +1,231 @@ - - - Crapfixer Log Analyzer - - - - -
-

🧠 Crapfixer Log Analyzer

-
- GitHub - PayPal - Ko-fi -
-
+ .btn-group { + margin-top: 1rem; + } + + + + +
+

🧠 Crapfixer Log Analyzer

+
+ GitHub + PayPal + Ko-fi +
+
- -
-

How it works:

-
    -
  1. Run the analysis in Crapfixer and copy the full log.
  2. -
  3. Paste it into the box below.
  4. -
  5. Click Analyze to get results.
  6. -
+ +
+

How it works:

+
    +
  1. Run the analysis in Crapfixer and copy the full log.
  2. +
  3. Paste it into the box below.
  4. +
  5. Click Analyze to get results.
  6. +
- - + + - -
- - - - - -
+ +
+ + + + + +
- -
-
+ +
+
- - + // Native share (for mobile browsers) + function shareResult() { + const text = document.getElementById("output").innerText; + if (navigator.share) { + navigator + .share({ + title: "Crapfixer Analysis Results", + text: text, + }) + .catch((err) => console.log("Share failed:", err)); + } else { + alert("Sharing is not supported by your browser."); + } + } - - - + // Share the result as an image on Twitter/X + function shareOnTwitter() { + const outputEl = document.getElementById("output"); + if (!outputEl.innerText.trim()) return alert("No results to share yet."); + + // Create screenshot from result div + html2canvas(outputEl).then((canvas) => { + const dataUrl = canvas.toDataURL("image/png"); + + // Convert image to base64 string (can't upload directly to Twitter) + // Instead, show preview and user uploads manually via prompt + const win = window.open(); + win.document.write(`

📷 Screenshot ready for X / Twitter

`); + win.document.write( + `

Right-click the image below and save it to upload on Twitter manually.

` + ); + win.document.write( + `` + ); + win.document.write( + `

➡️ Click here to post on X

` + ); + }); + } + + + + + diff --git a/docs/update-check.html b/docs/update-check.html index a198470..0034370 100644 --- a/docs/update-check.html +++ b/docs/update-check.html @@ -131,8 +131,12 @@ 💖 Support Crapfixer Every donation helps me provide more updates. – Thanks, Belim 🙏

- 💸 PayPal - ☕ Ko-fi + 💸 PayPal + ☕ Ko-fi
@@ -158,8 +162,7 @@ const status = document.getElementById("status"); if (!userVersion) { - status.innerText = - "❓ No version found. Please open this page from the Crapfixer app."; + status.innerText = "❓ No version found. Please open this page from the Crapfixer app."; } else { const result = compareVersions(userVersion, latestVersion);