Compare commits

...
22 Commits
Author SHA1 Message Date
Belim b8a8fa58bb Merge branch 'main' of https://github.com/builtbybel/Flyby11 2024-10-30 21:33:51 +01:00
Belim 9ff59e15a4 Init-0.14 2024-10-30 21:33:40 +01:00
Belim 655ad8fc16 Update Resore all built-in apps.ps1 2024-10-28 17:57:59 +01:00
Belim c4fb8ef510 Update Uninstall OneDrive.ps1 2024-10-28 17:57:31 +01:00
Belim f2a9f78155 Update Create Restore Point.ps1 2024-10-28 17:57:17 +01:00
Belim 41d97ab904 Update Restart Explorer.ps1 2024-10-28 17:56:54 +01:00
Belim 256ae0cfdb Windows Old Remover 2024-10-28 16:56:00 +01:00
Belim b847323d11 Add files via upload 2024-10-28 16:55:00 +01:00
Belim 98a41f8ca8 Update plugins_manifest.json 2024-10-28 15:45:42 +01:00
Belim 186f1c6216 Update plugins_manifest.json 2024-10-28 15:45:13 +01:00
Belim 329b96e4c7 Windows Rollback Timer 2024-10-28 15:43:49 +01:00
Belim d23582262d Update plugins_manifest.json 2024-10-28 13:09:18 +01:00
Belim f31bc66ec5 Add plugins (beta) 2024-10-28 12:28:14 +01:00
Belim f1db5ae1e1 Merge branch 'main' of https://github.com/builtbybel/Flyby11 2024-10-26 09:25:55 +02:00
Belim b2f5ae8979 push 0.13 2024-10-26 09:25:41 +02:00
Belim 45742ce546 Update README.md 2024-10-22 16:00:51 +02:00
Belim 3ca2557d4a Update NativePatcher.cs 2024-10-22 12:46:54 +02:00
Belim 335b6b4a70 Initial commit
lets build something awesome...
2024-10-22 12:29:53 +02:00
Belim f30f280fb1 Update README.md 2024-10-20 11:42:27 +02:00
Belim 322f0f6807 Update README.md 2024-10-20 11:40:32 +02:00
Belim b5b62ef8a9 Update README.md 2024-10-20 11:38:19 +02:00
Belim d56e5ad5d4 Update README.md 2024-10-20 08:44:44 +02:00
61 changed files with 5907 additions and 3 deletions

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.11.35327.3
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlybyScript", "FlybyScript\FlybyScript.csproj", "{66DDC36A-9095-4053-941C-8829D44F5F20}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{66DDC36A-9095-4053-941C-8829D44F5F20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{66DDC36A-9095-4053-941C-8829D44F5F20}.Debug|Any CPU.Build.0 = Debug|Any CPU
{66DDC36A-9095-4053-941C-8829D44F5F20}.Release|Any CPU.ActiveCfg = Release|Any CPU
{66DDC36A-9095-4053-941C-8829D44F5F20}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {81315C08-1240-44F0-AAEF-36C5A1C885B8}
EndGlobalSection
EndGlobal
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
</configuration>
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

+71
View File
@@ -0,0 +1,71 @@
using FlybyScript;
using Microsoft.Win32;
using System;
using System.Drawing;
namespace Settings.Privacy
{
internal class ActivityHistory : FeatureBase
{
public ActivityHistory(Logger logger) : base(logger)
{
}
private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Privacy";
private const string valueName = "ActivityHistoryEnabled";
private const int desiredValue = 0;
public override string GetRegistryKey()
{
return $"{keyName} | Value: {valueName} | Desired Value: {desiredValue}";
}
public override string ID()
{
return "Disable activity history";
}
public override string Info()
{
return "Disable activity history (prevents Windows from tracking and storing your activity)";
}
public override bool CheckFeature()
{
return (
Utils.IntEquals(keyName, valueName, desiredValue)
);
}
public override bool DoFeature()
{
try
{
Registry.SetValue(keyName, valueName, 0, RegistryValueKind.DWord);
return true;
}
catch (Exception ex)
{
logger.Log("Code red in " + ex.Message, Color.Red);
}
return false;
}
public override bool UndoFeature()
{
try
{
Registry.SetValue(keyName, valueName, 1, RegistryValueKind.DWord);
return true;
}
catch (Exception ex)
{
logger.Log("Code red in " + ex.Message, Color.Red);
}
return false;
}
}
}
+26
View File
@@ -0,0 +1,26 @@
namespace FlybyScript
{
public abstract class FeatureBase
{
protected readonly Logger logger;
public Logger Logger => logger;
protected FeatureBase(Logger logger)
{
this.logger = logger;
}
public abstract string ID();
public abstract string Info();
public abstract bool CheckFeature();
public abstract bool DoFeature();
public abstract bool UndoFeature();
public abstract string GetRegistryKey();
}
}
+15
View File
@@ -0,0 +1,15 @@
using System.Windows.Forms;
namespace FlybyScript
{
internal class FeatureNode : TreeNode
{
public FeatureBase Feature { get; private set; }
public FeatureNode(FeatureBase feature)
{
Feature = feature;
Text = Feature.ID();
}
}
}
+147
View File
@@ -0,0 +1,147 @@
using System;
using System.Drawing;
using System.Windows.Forms;
namespace FlybyScript
{
internal class FeaturePanel : Panel
{
private FeatureBase feature;
private Logger logger;
private Label statusLabel;
public FeaturePanel(FeatureBase feature, Logger logger)
{
this.feature = feature;
this.logger = logger;
// Create a FlowLayoutPanel
FlowLayoutPanel flowLayout = new FlowLayoutPanel
{
Dock = DockStyle.Top,
AutoSize = true,
FlowDirection = FlowDirection.TopDown,
WrapContents = false,
AutoScroll = true
};
// Add Components
var descriptionLabel = CreateDescriptionLabel();
var checkBox = CreateCheckBox();
var linkLabel = CreateLinkLabel();
statusLabel = CreateStatusLabel(); // Init status label
// Event Handlers
linkLabel.Click += LinkLabel_Click;
checkBox.CheckedChanged += CheckBox_CheckedChanged;
// Add Controls to FlowLayoutPanel
flowLayout.Controls.Add(descriptionLabel);
flowLayout.Controls.Add(checkBox);
flowLayout.Controls.Add(linkLabel);
flowLayout.Controls.Add(statusLabel);
// Add FlowLayoutPanel to the main panel
Controls.Add(flowLayout);
}
private Label CreateDescriptionLabel()
{
return new Label
{
Text = feature.Info(),
AutoSize = true,
Font = new Font("Segoe UI", 10, FontStyle.Regular),
ForeColor = Color.Black,
Padding = new Padding(0, 0, 0, 5) // Padding for better spacing
};
}
private CheckBox CreateCheckBox()
{
return new CheckBox
{
Text = feature.ID(),
AutoSize = true,
Checked = feature.CheckFeature(),
Dock = DockStyle.Top,
Font = new Font("Segoe UI", 10, FontStyle.Bold),
ForeColor = Color.Black
};
}
private LinkLabel CreateLinkLabel()
{
return new LinkLabel
{
Text = "Show Details",
AutoSize = true,
LinkColor = Color.Blue,
Font = new Font("Segoe UI", 10, FontStyle.Italic),
Cursor = Cursors.Hand,
Padding = new Padding(0, 0, 10, 0) // Adding some padding
};
}
private Label CreateStatusLabel()
{
return new Label
{
Text = feature.CheckFeature() ? "Accepted" : "Declined",
AutoSize = true,
Font = new Font("Segoe UI", 10, FontStyle.Italic),
ForeColor = Color.Gray,
TextAlign = ContentAlignment.MiddleRight,
Padding = new Padding(10, 0, 0, 0)
};
}
private void LinkLabel_Click(object sender, EventArgs e)
{
// Copy the registry key associated with the feature to the clipboard
string registryKey = feature.GetRegistryKey();
if (!string.IsNullOrEmpty(registryKey))
{
Clipboard.SetText(registryKey);
MessageBox.Show($"Registry key '{registryKey}", "Copied to clipboard", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
MessageBox.Show("No registry key available for this feature.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void CheckBox_CheckedChanged(object sender, EventArgs e)
{
var checkBox = sender as CheckBox;
bool success = false;
if (checkBox != null)
{
if (checkBox.Checked)
{
success = feature.DoFeature(); // Enable feature
if (success)
{
logger.Log($"{feature.ID()} enabled", Color.Green);
statusLabel.Text = "Accepted"; // Update status label
}
}
else
{
success = feature.UndoFeature(); // Disable feature
if (success)
{
logger.Log($"{feature.ID()} disabled", Color.Red);
statusLabel.Text = "Declined";
}
}
}
if (!success)
{
MessageBox.Show("Failed to update feature status", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}
+68
View File
@@ -0,0 +1,68 @@
using FlybyScript;
using Microsoft.Win32;
using System;
using System.Drawing;
namespace Settings.Ads
{
internal class FileExplorerAds : FeatureBase
{
public FileExplorerAds(Logger logger) : base(logger)
{
}
private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced";
private const string valueName = "ShowSyncProviderNotifications";
private const int desiredValue = 0;
public override string GetRegistryKey()
{
return $"{keyName} | Value: {valueName} | Desired Value: {desiredValue}";
}
public override string ID()
{
return "Disable File Explorer Ads";
}
public override string Info()
{
return "This feature will disable ads in File Explorer.";
}
public override bool CheckFeature()
{
return (Utils.IntEquals(keyName, valueName, desiredValue));
}
public override bool DoFeature()
{
try
{
Registry.SetValue(keyName, valueName, 0, RegistryValueKind.DWord);
return true;
}
catch (Exception ex)
{
logger.Log("Code red in " + ex.Message, Color.Red);
}
return false;
}
public override bool UndoFeature()
{
try
{
Registry.SetValue(keyName, valueName, 1, RegistryValueKind.DWord);
return true;
}
catch (Exception ex)
{
logger.Log("Code red in " + ex.Message, Color.Red);
}
return false;
}
}
}
+71
View File
@@ -0,0 +1,71 @@
using FlybyScript;
using Microsoft.Win32;
using System;
using System.Drawing;
namespace Settings.Privacy
{
internal class FindMyDevice : FeatureBase
{
public FindMyDevice(Logger logger) : base(logger)
{
}
private const string keyName = @"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location";
private const string valueName = "Value";
private const string desiredValue = @"Allow";
public override string GetRegistryKey()
{
return $"{keyName} | Value: {valueName} | Desired Value: {desiredValue}";
}
public override string ID()
{
return "Disable Find my device";
}
public override string Info()
{
return "This feature will disable find my device.";
}
public override bool CheckFeature()
{
return !(
Utils.StringEquals(keyName, valueName, desiredValue)
);
}
public override bool DoFeature()
{
try
{
Registry.SetValue(keyName, valueName, "Deny", RegistryValueKind.String);
return true;
}
catch (Exception ex)
{
logger.Log("Code red in " + ex.Message, Color.Red);
}
return false;
}
public override bool UndoFeature()
{
try
{
Registry.SetValue(keyName, valueName, desiredValue, RegistryValueKind.String);
return true;
}
catch (Exception ex)
{
logger.Log("Code red in " + ex.Message, Color.Red);
}
return false;
}
}
}
+64
View File
@@ -0,0 +1,64 @@
using FlybyScript;
using Microsoft.Win32;
using System;
using System.Drawing;
namespace Settings.Ads
{
public class FinishSetupAds : FeatureBase
{
public FinishSetupAds(Logger logger) : base(logger)
{
}
private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\UserProfileEngagement";
private const string valueName = "ScoobeSystemSettingEnabled";
private const int desiredValue = 0;
public override string ID() => "Disable Finish Setup Ads";
public override string Info() => "This feature will disable the \"Lets finish setting up your device\" and other advertising.";
public override string GetRegistryKey()
{
return $"{keyName} | Value: {valueName} | Desired Value: {desiredValue}";
}
public override bool CheckFeature()
{
return Utils.IntEquals(keyName, valueName, 0);
}
public override bool DoFeature()
{
try
{
Registry.SetValue(keyName, valueName, 0, Microsoft.Win32.RegistryValueKind.DWord);
return true;
}
catch (Exception ex)
{
logger.Log("Code red in " + ex.Message, Color.Red);
}
return false;
}
public override bool UndoFeature()
{
try
{
Registry.SetValue(keyName, valueName, 1, Microsoft.Win32.RegistryValueKind.DWord);
return true;
}
catch (Exception ex)
{
logger.Log("Code red in " + ex.Message, Color.Red);
}
return false;
}
}
}
@@ -0,0 +1,69 @@
using FlybyScript;
using Microsoft.Win32;
using System;
using System.Drawing;
namespace Settings.Privacy
{
internal class LocationTracking : FeatureBase
{
public LocationTracking(Logger logger) : base(logger)
{
}
private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\LocationAndSensors";
private const string valueName = "LocationEnabled";
private const int desiredValue = 0;
public override string GetRegistryKey()
{
return $"{keyName} | Value: {valueName} | Desired Value: {desiredValue}";
}
public override string ID()
{
return "Disable location tracking";
}
public override string Info()
{
return "Disable location tracking (prevents Windows from accessing your location)";
}
public override bool CheckFeature()
{
return Utils.IntEquals(keyName, valueName,desiredValue);
}
public override bool DoFeature()
{
try
{
Registry.SetValue(keyName, valueName, 0, RegistryValueKind.DWord);
return true;
}
catch (Exception ex)
{
logger.Log("Code red in " + ex.Message, Color.Red);
}
return false;
}
public override bool UndoFeature()
{
try
{
Registry.SetValue(keyName, valueName, 1, RegistryValueKind.DWord);
return true;
}
catch (Exception ex)
{
logger.Log("Code red in " + ex.Message, Color.Red);
}
return false;
}
}
}
+69
View File
@@ -0,0 +1,69 @@
using FlybyScript;
using Microsoft.Win32;
using System;
using System.Drawing;
namespace Settings.Ads
{
internal class LockScreenAds : FeatureBase
{
public LockScreenAds(Logger logger) : base(logger)
{
}
private const string keyName = @"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager";
private const string valueName = "RotatingLockScreenOverlayEnabled";
private const string valueName2 = "SubscribedContent-338387Enabled";
private const int desiredValue = 0;
public override string ID() => "Disable Lock Screen Tips and Ads";
public override string Info() => "This feature will disable tips and ads on the lock screen.";
public override string GetRegistryKey()
{
return $"{keyName} | Value: {valueName} | Desired Value: {desiredValue}";
}
public override bool CheckFeature()
{
return (Utils.IntEquals(keyName, valueName, desiredValue) &&
Utils.IntEquals(keyName, valueName2, desiredValue)
);
}
public override bool DoFeature()
{
try
{
Registry.SetValue(keyName, valueName, 0, Microsoft.Win32.RegistryValueKind.DWord);
Registry.SetValue(keyName, valueName2, 0, Microsoft.Win32.RegistryValueKind.DWord);
return true;
}
catch (Exception ex)
{
logger.Log("Code red in " + ex.Message, Color.Red);
}
return false;
}
public override bool UndoFeature()
{
try
{
Registry.SetValue(keyName, valueName, 1, Microsoft.Win32.RegistryValueKind.DWord);
Registry.SetValue(keyName, valueName2, 1, Microsoft.Win32.RegistryValueKind.DWord);
return true;
}
catch (Exception ex)
{
logger.Log("Code red in " + ex.Message, Color.Red);
}
return false;
}
}
}
+64
View File
@@ -0,0 +1,64 @@
using FlybyScript;
using Microsoft.Win32;
using System;
using System.Drawing;
namespace Settings.Ads
{
public class PersonalizedAds : FeatureBase
{
public PersonalizedAds(Logger logger) : base(logger)
{
}
private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo";
private const string valueName = "Enabled";
private const int desiredValue = 0;
public override string ID() => "Disable Personalized Ads";
public override string Info() => "This feature will disable personalized ads.";
public override string GetRegistryKey()
{
return $"{keyName} | Value: {valueName} | Desired Value: {desiredValue}";
}
public override bool CheckFeature()
{
return Utils.IntEquals(keyName, valueName, 0);
}
public override bool DoFeature()
{
try
{
Registry.SetValue(keyName, valueName, 0, Microsoft.Win32.RegistryValueKind.DWord);
return true;
}
catch (Exception ex)
{
logger.Log("Code red in " + ex.Message, Color.Red);
}
return false;
}
public override bool UndoFeature()
{
try
{
Registry.SetValue(keyName, valueName, 1, Microsoft.Win32.RegistryValueKind.DWord);
return true;
}
catch (Exception ex)
{
logger.Log("Code red in " + ex.Message, Color.Red);
}
return false;
}
}
}
@@ -0,0 +1,64 @@
using FlybyScript;
using Microsoft.Win32;
using System;
using System.Drawing;
namespace Settings.Privacy
{
public class PrivacyExperience : FeatureBase
{
public PrivacyExperience(Logger logger) : base(logger)
{
}
private const string keyName = @"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OOBE";
private const string valueName = "DisablePrivacyExperience";
private const int desiredValue = 0;
public override string ID() => "Disable Privacy Settings Experience at sign-in";
public override string Info() => "This feature will disable Privacy Settings Experience at sign-in.";
public override string GetRegistryKey()
{
return $"{keyName} | Value: {valueName} | Desired Value: {desiredValue}";
}
public override bool CheckFeature()
{
return !Utils.IntEquals(keyName, valueName, desiredValue);
}
public override bool DoFeature()
{
try
{
Registry.SetValue(keyName, valueName, 1, Microsoft.Win32.RegistryValueKind.DWord);
return true;
}
catch (Exception ex)
{
logger.Log("Code red in " + ex.Message, Color.Red);
}
return false;
}
public override bool UndoFeature()
{
try
{
Registry.SetValue(keyName, valueName, 0, Microsoft.Win32.RegistryValueKind.DWord);
return true;
}
catch (Exception ex)
{
logger.Log("Code red in " + ex.Message, Color.Red);
}
return false;
}
}
}
+74
View File
@@ -0,0 +1,74 @@
using FlybyScript;
using Microsoft.Win32;
using System;
using System.Drawing;
namespace Settings.Ads
{
internal class SettingsAds : FeatureBase
{
public SettingsAds(Logger logger) : base(logger)
{
}
private const string keyName = @"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager";
private const string valueName = "SubscribedContent-338393Enabled";
private const string valueName2 = "SubscribedContent-353694Enabled";
private const string valueName3 = "SubscribedContent-353696Enabled";
private const int desiredValue = 0;
public override string ID() => "Disable Settings Ads";
public override string Info() => "This feature will disable ads in settings.";
public override string GetRegistryKey()
{
return $"{keyName} | Value: {valueName} + {valueName2} + {valueName3} | Desired Value: {desiredValue}";
}
public override bool CheckFeature()
{
return (Utils.IntEquals(keyName, valueName, desiredValue) &&
Utils.IntEquals(keyName, valueName2, desiredValue) &&
Utils.IntEquals(keyName, valueName3, desiredValue)
);
}
public override bool DoFeature()
{
try
{
Registry.SetValue(keyName, valueName, 0, Microsoft.Win32.RegistryValueKind.DWord);
Registry.SetValue(keyName, valueName2, 0, Microsoft.Win32.RegistryValueKind.DWord);
Registry.SetValue(keyName, valueName3, 0, Microsoft.Win32.RegistryValueKind.DWord);
return true;
}
catch (Exception ex)
{
logger.Log("Code red in " + ex.Message, Color.Red);
}
return false;
}
public override bool UndoFeature()
{
try
{
Registry.SetValue(keyName, valueName, 1, Microsoft.Win32.RegistryValueKind.DWord);
Registry.SetValue(keyName, valueName2, 1, Microsoft.Win32.RegistryValueKind.DWord);
Registry.SetValue(keyName, valueName3, 1, Microsoft.Win32.RegistryValueKind.DWord);
return true;
}
catch (Exception ex)
{
logger.Log("Code red in " + ex.Message, Color.Red);
}
return false;
}
}
}
+70
View File
@@ -0,0 +1,70 @@
using FlybyScript;
using Microsoft.Win32;
using System;
using System.Drawing;
namespace Settings.Ads
{
internal class StartmenuAds : FeatureBase
{
public StartmenuAds(Logger logger) : base(logger)
{
}
private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced";
private const string valueName = "Start_IrisRecommendations";
private const int desiredValue = 0;
public override string GetRegistryKey()
{
return $"{keyName} | Value: {valueName} | Desired Value: {desiredValue}";
}
public override string ID()
{
return "Disable Start menu Ads";
}
public override string Info()
{
return "This feature will disable ads in the start menu.";
}
public override bool CheckFeature()
{
return (
Utils.IntEquals(keyName, valueName, desiredValue)
);
}
public override bool DoFeature()
{
try
{
Registry.SetValue(keyName, valueName, 0, RegistryValueKind.DWord);
return true;
}
catch (Exception ex)
{
logger.Log("Code red in " + ex.Message, Color.Red);
}
return false;
}
public override bool UndoFeature()
{
try
{
Registry.SetValue(keyName, valueName, 1, RegistryValueKind.DWord);
return true;
}
catch (Exception ex)
{
logger.Log("Code red in " + ex.Message, Color.Red);
}
return false;
}
}
}
@@ -0,0 +1,70 @@
using FlybyScript;
using Microsoft.Win32;
using System;
using System.Drawing;
namespace Settings.Ads
{
internal class TailoredExperiences : FeatureBase
{
public TailoredExperiences(Logger logger) : base(logger)
{
}
private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Privacy";
private const string valueName = "TailoredExperiencesWithDiagnosticDataEnabled";
private const int desiredValue = 0;
public override string GetRegistryKey()
{
return $"{keyName} | Value: {valueName} | Desired Value: {desiredValue}";
}
public override string ID()
{
return "Disable Tailored experiences";
}
public override string Info()
{
return "Tailored Experiences allows Microsoft to get information from you to deliver personalized tips, ads, and recommendations. Many people would call this telemetry, or even spying.";
}
public override bool CheckFeature()
{
return (
Utils.IntEquals(keyName, valueName, desiredValue)
);
}
public override bool DoFeature()
{
try
{
Registry.SetValue(keyName, valueName, 0, RegistryValueKind.DWord);
return true;
}
catch (Exception ex)
{
logger.Log("Code red in " + ex.Message, Color.Red);
}
return false;
}
public override bool UndoFeature()
{
try
{
Registry.SetValue(keyName, valueName, 1, RegistryValueKind.DWord);
return true;
}
catch (Exception ex)
{
logger.Log("Code red in " + ex.Message, Color.Red);
}
return false;
}
}
}
+69
View File
@@ -0,0 +1,69 @@
using FlybyScript;
using Microsoft.Win32;
using System;
using System.Drawing;
namespace Settings.Privacy
{
public class Telemetry : FeatureBase
{
public Telemetry(Logger logger) : base(logger)
{
}
private const string dataCollection = @"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\DataCollection";
private const string diagTrack = @"HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\DiagTrack";
public override string ID() => "Turn off Telemetry data collection";
public override string Info() => "This feature will turn off telemetry data collection and prevent the data from being sent to Microsoft.";
public override string GetRegistryKey()
{
return $"{dataCollection} | {diagTrack}";
}
public override bool CheckFeature()
{
return (
Utils.IntEquals(dataCollection, "AllowTelemetry", 0) &&
Utils.IntEquals(diagTrack, "Start", 2)
);
}
public override bool DoFeature()
{
try
{
Registry.SetValue(dataCollection, "AllowTelemetry", 0, RegistryValueKind.DWord);
Registry.SetValue(diagTrack, "Start", 2, RegistryValueKind.DWord);
return true;
}
catch (Exception ex)
{
logger.Log("Code red in " + ex.Message, Color.Red);
}
return false;
}
public override bool UndoFeature()
{
try
{
Registry.SetValue(dataCollection, "AllowTelemetry", 1, RegistryValueKind.DWord);
Registry.SetValue(diagTrack, "Start", 4, RegistryValueKind.DWord);
return true;
}
catch (Exception ex)
{
logger.Log("Code red in " + ex.Message, Color.Red);
}
return false;
}
}
}
@@ -0,0 +1,65 @@
using FlybyScript;
using Microsoft.Win32;
using System;
using System.Drawing;
namespace Settings.Ads
{
internal class TipsAndSuggestions : FeatureBase
{
public TipsAndSuggestions(Logger logger) : base(logger)
{
}
private const string keyName = @"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager";
private const string valueName = "SubscribedContent-338389Enabled";
private const int desiredValue = 0;
public override string ID() => "Disable General Tips and Ads";
public override string Info() => "This feature will disable general tips and ads.";
public override string GetRegistryKey()
{
return $"{keyName} | Value: {valueName} | Desired Value: {desiredValue}";
}
public override bool CheckFeature()
{
return (Utils.IntEquals(keyName, valueName, desiredValue)
);
}
public override bool DoFeature()
{
try
{
Registry.SetValue(keyName, valueName, 0, Microsoft.Win32.RegistryValueKind.DWord);
return true;
}
catch (Exception ex)
{
logger.Log("Code red in " + ex.Message, Color.Red);
}
return false;
}
public override bool UndoFeature()
{
try
{
Registry.SetValue(keyName, valueName, 1, Microsoft.Win32.RegistryValueKind.DWord);
return true;
}
catch (Exception ex)
{
logger.Log("Code red in " + ex.Message, Color.Red);
}
return false;
}
}
}
@@ -0,0 +1,64 @@
using FlybyScript;
using Microsoft.Win32;
using System;
using System.Drawing;
namespace Settings.Ads
{
public class WelcomeExperienceAds : FeatureBase
{
public WelcomeExperienceAds(Logger logger) : base(logger)
{
}
private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager";
private const string valueName = "SubscribedContent-310093Enabled";
private const int desiredValue = 0;
public override string ID() => "Disable Welcome Experience Ads";
public override string Info() => "This feature will disable ads in the welcome experience.";
public override string GetRegistryKey()
{
return $"{keyName} | Value: {valueName} | Desired Value: {desiredValue}";
}
public override bool CheckFeature()
{
return Utils.IntEquals(keyName, valueName, 0);
}
public override bool DoFeature()
{
try
{
Registry.SetValue(keyName, valueName, 0, Microsoft.Win32.RegistryValueKind.DWord);
return true;
}
catch (Exception ex)
{
logger.Log("Code red in " + ex.Message, Color.Red);
}
return false;
}
public override bool UndoFeature()
{
try
{
Registry.SetValue(keyName, valueName, 1, Microsoft.Win32.RegistryValueKind.DWord);
return true;
}
catch (Exception ex)
{
logger.Log("Code red in " + ex.Message, Color.Red);
}
return false;
}
}
}
+152
View File
@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{66DDC36A-9095-4053-941C-8829D44F5F20}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>FlybyScript</RootNamespace>
<AssemblyName>Flyby11</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>x64</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>AppIcon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Experience\ActivityHistory.cs" />
<Compile Include="Experience\FeaturePanel.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Experience\FileExplorerAds.cs" />
<Compile Include="Experience\FinishSetupAds.cs" />
<Compile Include="Experience\LocationTracking.cs" />
<Compile Include="Experience\LockScreenAds.cs" />
<Compile Include="Experience\PersonalizedAds.cs" />
<Compile Include="Experience\PrivacyExperience.cs" />
<Compile Include="Experience\SettingsAds.cs" />
<Compile Include="Experience\StartmenuAds.cs" />
<Compile Include="Experience\TailoredExperiences.cs" />
<Compile Include="Experience\Telemetry.cs" />
<Compile Include="Experience\TipsAndSuggestions.cs" />
<Compile Include="Experience\WelcomeExperienceAds.cs" />
<Compile Include="Helper\Utils.cs" />
<Compile Include="Helper\Views.cs" />
<Compile Include="Patcher\ScriptPatcher.cs" />
<Compile Include="Helper\Logger.cs" />
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="PluginsForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="PluginsForm.Designer.cs">
<DependentUpon>PluginsForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Patcher\PSPatcher.cs" />
<Compile Include="Patcher\NativePatcher.cs" />
<Compile Include="Experience\FeatureBase.cs" />
<Compile Include="Experience\FeatureNode.cs" />
<Compile Include="USBManagement.cs" />
<Compile Include="Views\ExperienceView.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Views\ExperienceView.Designer.cs">
<DependentUpon>ExperienceView.cs</DependentUpon>
</Compile>
<Compile Include="Views\MediaView.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Views\MediaView.Designer.cs">
<DependentUpon>MediaView.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="PluginsForm.resx">
<DependentUpon>PluginsForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<EmbeddedResource Include="Views\ExperienceView.resx">
<DependentUpon>ExperienceView.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Views\MediaView.resx">
<DependentUpon>MediaView.cs</DependentUpon>
</EmbeddedResource>
<None Include="app.manifest" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Content Include="AppIcon.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
+35
View File
@@ -0,0 +1,35 @@
using System;
using System.Drawing;
using System.Windows.Forms;
namespace FlybyScript
{
public class Logger
{
private RichTextBox rtbDescription;
public Logger(RichTextBox rtbDescription)
{
this.rtbDescription = rtbDescription;
}
public void Log(string message, Color color)
{
if (rtbDescription.InvokeRequired)
{
rtbDescription.Invoke(new Action(() => LogMessage(message, color)));
}
else
{
LogMessage(message, color);
}
}
private void LogMessage(string message, Color color)
{
rtbDescription.SelectionColor = color;
rtbDescription.AppendText($"{DateTime.Now:HH:mm:ss} - {message}\n");
rtbDescription.ScrollToCaret();
}
}
}
+67
View File
@@ -0,0 +1,67 @@
using Microsoft.Win32;
using System;
using System.Diagnostics;
using System.Windows.Forms;
namespace FlybyScript
{
internal class Utils
{
// Check registry int equal
public static bool IntEquals(string keyName, string valueName, int expectedValue)
{
try
{
var value = Registry.GetValue(keyName, valueName, null);
return (value != null && (int)value == expectedValue);
}
catch (Exception ex)
{
MessageBox.Show(keyName, ex.Message, MessageBoxButtons.OK);
return false;
}
}
// Check registry strings equal
public static bool StringEquals(string keyName, string valueName, string expectedValue)
{
try
{
var value = Registry.GetValue(keyName, valueName, null);
return (value != null && (string)value == expectedValue);
}
catch (Exception ex)
{
MessageBox.Show(keyName, ex.Message, MessageBoxButtons.OK);
return false;
}
}
public static bool KeyExists(string keyPath)
{
return Registry.GetValue(keyPath, null, null) != null;
}
public static bool IsProcessRunning(string processName)
{
Process[] processes = Process.GetProcessesByName(processName);
return processes.Length > 0;
}
// Launch Urls in richText control
public static void LaunchUri(string url)
{
if (IsHttpURL(url)) Process.Start(url);
}
// Check Urls in in richText control
public static bool IsHttpURL(string url)
{
return
((!string.IsNullOrWhiteSpace(url)) &&
(url.ToLower().StartsWith("http")));
}
}
}
+47
View File
@@ -0,0 +1,47 @@
using System.Windows.Forms;
namespace Views
{
public static class SwitchView
{
public static Control PreviousView { get; private set; }
public static Control DefaultView { get; set; } // Store the default view (panelMain)
// Switch to a new view
public static void SetView(Control newView, Panel targetPanel)
{
// If there's already a view in the panel, save it as PreviousView
if (targetPanel.Controls.Count > 0)
{
// Only save the previous view if it's not the default view (panelMain)
if (PreviousView == null)
{
PreviousView = targetPanel.Controls[0]; // Store current view as PreviousView
}
}
newView.Dock = DockStyle.Fill;
targetPanel.Controls.Clear();
targetPanel.Controls.Add(newView); // Add new view to the panel
}
// Go back to the previous view
public static void GoBack(Panel targetPanel)
{
if (PreviousView != null)
{
targetPanel.Controls.Clear(); // Clear the current view
targetPanel.Controls.Add(PreviousView); // Add the previous view back
PreviousView.Dock = DockStyle.Fill;
PreviousView = null; // Reset PreviousView after returning to it
}
else if (DefaultView != null)
{
// If there's no PreviousView, return to the default (panelMain)
targetPanel.Controls.Clear();
targetPanel.Controls.Add(DefaultView);
DefaultView.Dock = DockStyle.Fill;
}
}
}
}
+280
View File
@@ -0,0 +1,280 @@
namespace FlybyScript
{
partial class MainForm
{
/// <summary>
/// Erforderliche Designervariable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Verwendete Ressourcen bereinigen.
/// </summary>
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Vom Windows Form-Designer generierter Code
/// <summary>
/// Erforderliche Methode für die Designerunterstützung.
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.rtbDescription = new System.Windows.Forms.RichTextBox();
this.btnTogglePatch = new System.Windows.Forms.Button();
this.linkGitHub = new System.Windows.Forms.LinkLabel();
this.btnMountRun = new System.Windows.Forms.Button();
this.lblHeader = new System.Windows.Forms.Label();
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.linkLabel2 = new System.Windows.Forms.LinkLabel();
this.panelMain = new System.Windows.Forms.Panel();
this.treeSettings = new System.Windows.Forms.TreeView();
this.checkInstallationMedia = new System.Windows.Forms.CheckBox();
this.linkChangeExperience = new System.Windows.Forms.LinkLabel();
this.panelForm = new System.Windows.Forms.Panel();
this.panelMain.SuspendLayout();
this.panelForm.SuspendLayout();
this.SuspendLayout();
//
// rtbDescription
//
this.rtbDescription.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.rtbDescription.BackColor = System.Drawing.Color.White;
this.rtbDescription.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.rtbDescription.Font = new System.Drawing.Font("Segoe UI Variable Small Light", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rtbDescription.ForeColor = System.Drawing.Color.Black;
this.rtbDescription.Location = new System.Drawing.Point(34, 346);
this.rtbDescription.Name = "rtbDescription";
this.rtbDescription.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Vertical;
this.rtbDescription.Size = new System.Drawing.Size(867, 123);
this.rtbDescription.TabIndex = 199;
this.rtbDescription.TabStop = false;
this.rtbDescription.Text = "";
//
// btnTogglePatch
//
this.btnTogglePatch.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnTogglePatch.BackColor = System.Drawing.Color.White;
this.btnTogglePatch.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnTogglePatch.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(112)))), ((int)(((byte)(192)))));
this.btnTogglePatch.FlatAppearance.BorderSize = 2;
this.btnTogglePatch.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(112)))), ((int)(((byte)(192)))));
this.btnTogglePatch.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnTogglePatch.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnTogglePatch.Location = new System.Drawing.Point(629, 484);
this.btnTogglePatch.Name = "btnTogglePatch";
this.btnTogglePatch.Size = new System.Drawing.Size(222, 40);
this.btnTogglePatch.TabIndex = 201;
this.btnTogglePatch.TabStop = false;
this.btnTogglePatch.Text = "Start";
this.btnTogglePatch.UseCompatibleTextRendering = true;
this.btnTogglePatch.UseVisualStyleBackColor = false;
this.btnTogglePatch.Click += new System.EventHandler(this.btnTogglePatch_Click);
//
// linkGitHub
//
this.linkGitHub.ActiveLinkColor = System.Drawing.Color.RoyalBlue;
this.linkGitHub.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.linkGitHub.AutoEllipsis = true;
this.linkGitHub.AutoSize = true;
this.linkGitHub.Font = new System.Drawing.Font("Segoe UI Variable Small", 8.75F);
this.linkGitHub.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
this.linkGitHub.LinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(241)))), ((int)(((byte)(65)))), ((int)(((byte)(17)))));
this.linkGitHub.Location = new System.Drawing.Point(167, 558);
this.linkGitHub.Name = "linkGitHub";
this.linkGitHub.Size = new System.Drawing.Size(45, 16);
this.linkGitHub.TabIndex = 202;
this.linkGitHub.TabStop = true;
this.linkGitHub.Text = "GitHub";
this.linkGitHub.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkGitHub_LinkClicked);
//
// btnMountRun
//
this.btnMountRun.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnMountRun.AutoEllipsis = true;
this.btnMountRun.BackColor = System.Drawing.Color.White;
this.btnMountRun.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnMountRun.FlatAppearance.BorderColor = System.Drawing.Color.Gray;
this.btnMountRun.FlatAppearance.BorderSize = 2;
this.btnMountRun.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(112)))), ((int)(((byte)(192)))));
this.btnMountRun.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnMountRun.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnMountRun.Location = new System.Drawing.Point(403, 484);
this.btnMountRun.Name = "btnMountRun";
this.btnMountRun.Size = new System.Drawing.Size(220, 40);
this.btnMountRun.TabIndex = 203;
this.btnMountRun.TabStop = false;
this.btnMountRun.Text = "Mount and Run ISO";
this.btnMountRun.UseVisualStyleBackColor = false;
this.btnMountRun.Click += new System.EventHandler(this.btnMountRun_Click);
//
// lblHeader
//
this.lblHeader.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblHeader.AutoEllipsis = true;
this.lblHeader.Font = new System.Drawing.Font("Segoe UI Variable Small Light", 21.25F);
this.lblHeader.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(35)))), ((int)(((byte)(115)))), ((int)(((byte)(193)))));
this.lblHeader.Location = new System.Drawing.Point(30, 38);
this.lblHeader.Name = "lblHeader";
this.lblHeader.Size = new System.Drawing.Size(780, 82);
this.lblHeader.TabIndex = 205;
this.lblHeader.Text = "Use FlybyScript to bypass Windows 11 restrictions and install on unsupported devi" +
"ces";
//
// linkLabel1
//
this.linkLabel1.ActiveLinkColor = System.Drawing.Color.RoyalBlue;
this.linkLabel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.linkLabel1.AutoEllipsis = true;
this.linkLabel1.AutoSize = true;
this.linkLabel1.Font = new System.Drawing.Font("Segoe UI Variable Small", 8.75F);
this.linkLabel1.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
this.linkLabel1.LinkColor = System.Drawing.Color.Gray;
this.linkLabel1.Location = new System.Drawing.Point(31, 558);
this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.Size = new System.Drawing.Size(119, 16);
this.linkLabel1.TabIndex = 206;
this.linkLabel1.TabStop = true;
this.linkLabel1.Text = "A Belim app creation";
//
// linkLabel2
//
this.linkLabel2.ActiveLinkColor = System.Drawing.Color.RoyalBlue;
this.linkLabel2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.linkLabel2.AutoEllipsis = true;
this.linkLabel2.AutoSize = true;
this.linkLabel2.Font = new System.Drawing.Font("Segoe UI Variable Small", 8.75F);
this.linkLabel2.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
this.linkLabel2.LinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(127)))), ((int)(((byte)(186)))), ((int)(((byte)(0)))));
this.linkLabel2.Location = new System.Drawing.Point(233, 558);
this.linkLabel2.Name = "linkLabel2";
this.linkLabel2.Size = new System.Drawing.Size(51, 16);
this.linkLabel2.TabIndex = 208;
this.linkLabel2.TabStop = true;
this.linkLabel2.Text = "0.14.107";
//
// panelMain
//
this.panelMain.Controls.Add(this.treeSettings);
this.panelMain.Controls.Add(this.checkInstallationMedia);
this.panelMain.Controls.Add(this.linkLabel2);
this.panelMain.Controls.Add(this.linkChangeExperience);
this.panelMain.Controls.Add(this.lblHeader);
this.panelMain.Controls.Add(this.linkLabel1);
this.panelMain.Controls.Add(this.rtbDescription);
this.panelMain.Controls.Add(this.btnMountRun);
this.panelMain.Controls.Add(this.btnTogglePatch);
this.panelMain.Controls.Add(this.linkGitHub);
this.panelMain.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelMain.Location = new System.Drawing.Point(0, 0);
this.panelMain.Name = "panelMain";
this.panelMain.Size = new System.Drawing.Size(943, 592);
this.panelMain.TabIndex = 209;
//
// treeSettings
//
this.treeSettings.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.treeSettings.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.treeSettings.CheckBoxes = true;
this.treeSettings.Font = new System.Drawing.Font("Segoe UI Variable Text Light", 11.25F);
this.treeSettings.FullRowSelect = true;
this.treeSettings.HotTracking = true;
this.treeSettings.Location = new System.Drawing.Point(36, 168);
this.treeSettings.Name = "treeSettings";
this.treeSettings.ShowLines = false;
this.treeSettings.ShowNodeToolTips = true;
this.treeSettings.ShowPlusMinus = false;
this.treeSettings.Size = new System.Drawing.Size(865, 172);
this.treeSettings.TabIndex = 210;
this.treeSettings.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.treeSettings_AfterCheck);
this.treeSettings.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.treeSettings_NodeMouseClick);
//
// checkInstallationMedia
//
this.checkInstallationMedia.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.checkInstallationMedia.AutoSize = true;
this.checkInstallationMedia.Cursor = System.Windows.Forms.Cursors.Hand;
this.checkInstallationMedia.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.checkInstallationMedia.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(112)))), ((int)(((byte)(192)))));
this.checkInstallationMedia.Location = new System.Drawing.Point(34, 527);
this.checkInstallationMedia.Name = "checkInstallationMedia";
this.checkInstallationMedia.Size = new System.Drawing.Size(249, 18);
this.checkInstallationMedia.TabIndex = 209;
this.checkInstallationMedia.Text = "I want to create Windows 11 installation media";
this.checkInstallationMedia.UseVisualStyleBackColor = true;
this.checkInstallationMedia.CheckedChanged += new System.EventHandler(this.checkInstallationMedia_CheckedChanged);
//
// linkChangeExperience
//
this.linkChangeExperience.ActiveLinkColor = System.Drawing.Color.RoyalBlue;
this.linkChangeExperience.AutoEllipsis = true;
this.linkChangeExperience.AutoSize = true;
this.linkChangeExperience.Font = new System.Drawing.Font("Segoe UI Variable Small Semilig", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.linkChangeExperience.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
this.linkChangeExperience.LinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(112)))), ((int)(((byte)(192)))));
this.linkChangeExperience.Location = new System.Drawing.Point(33, 139);
this.linkChangeExperience.Name = "linkChangeExperience";
this.linkChangeExperience.Size = new System.Drawing.Size(209, 16);
this.linkChangeExperience.TabIndex = 1;
this.linkChangeExperience.TabStop = true;
this.linkChangeExperience.Text = "Change how you experience Windows";
this.linkChangeExperience.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkChangeExperience_LinkClicked);
this.linkChangeExperience.Paint += new System.Windows.Forms.PaintEventHandler(this.linkChangeExperience_Paint);
//
// panelForm
//
this.panelForm.Controls.Add(this.panelMain);
this.panelForm.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelForm.Location = new System.Drawing.Point(0, 0);
this.panelForm.Name = "panelForm";
this.panelForm.Size = new System.Drawing.Size(943, 592);
this.panelForm.TabIndex = 210;
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(943, 592);
this.Controls.Add(this.panelForm);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "MainForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Flyby11 Upgrading Assistant";
this.Load += new System.EventHandler(this.MainForm_Load);
this.panelMain.ResumeLayout(false);
this.panelMain.PerformLayout();
this.panelForm.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
public System.Windows.Forms.RichTextBox rtbDescription;
private System.Windows.Forms.Button btnTogglePatch;
private System.Windows.Forms.LinkLabel linkGitHub;
private System.Windows.Forms.Button btnMountRun;
private System.Windows.Forms.Label lblHeader;
private System.Windows.Forms.LinkLabel linkLabel1;
private System.Windows.Forms.LinkLabel linkLabel2;
private System.Windows.Forms.Panel panelMain;
private System.Windows.Forms.LinkLabel linkChangeExperience;
private System.Windows.Forms.Panel panelForm;
private System.Windows.Forms.CheckBox checkInstallationMedia;
private System.Windows.Forms.TreeView treeSettings;
}
}
+276
View File
@@ -0,0 +1,276 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using Views;
namespace FlybyScript
{
public partial class MainForm : Form
{
private Dictionary<TreeNode, bool> pendingChanges = new Dictionary<TreeNode, bool>(); // Store pending changes
private PSPatcher PSPatcher;
private Logger logger;
public MainForm()
{
InitializeComponent();
// Initialize the logger
logger = new Logger(rtbDescription);
// Set the default view to the main panel
SwitchView.DefaultView = panelMain;
// Subscribe to the AfterSelect event for importing plugins
treeSettings.AfterSelect += TreeSettings_AfterSelect;
}
private async void MainForm_Load(object sender, EventArgs e)
{
// Add NativePatcher parent node
TreeNode nativePatcherNode = new TreeNode("Native (Recommended)");
treeSettings.Nodes.Add(nativePatcherNode);
// Add Method 1 as a child of NativePatcher
TreeNode method1Node = new TreeNode("(Method 1) Inplace Upgrade via Server Setup")
{
Tag = "Method1",
BackColor = Color.LightBlue
};
nativePatcherNode.Nodes.Add(method1Node);
// Load plugins
await ScriptPatcher.LoadPlugins("upgraider", treeSettings.Nodes, logger);
// Load PowerShell plugins
PSPatcher = new PSPatcher();
PSPatcher.LoadPowerShellPlugins(treeSettings);
// Add the Import node at the end
TreeNode importNode = new TreeNode("Import [...]")
{
NodeFont = new Font(treeSettings.Font, FontStyle.Italic),
Checked = false,
ForeColor = Color.Black
};
treeSettings.Nodes.Add(importNode);
// Expand all nodes
ExpandAllNodes(treeSettings.Nodes);
}
private void TreeSettings_AfterSelect(object sender, TreeViewEventArgs e)
{
if (e.Node.Text == "Import [...]")
{
OpenPluginsForm();
}
}
private void OpenPluginsForm()
{
var pluginsForm = new PluginsForm(this);
pluginsForm.ShowDialog();
}
// Refresh the tree view
public void RefreshTreeView()
{
treeSettings.Nodes.Clear();
// Reload
MainForm_Load(this, EventArgs.Empty);
}
// Expand all nodes
private void ExpandAllNodes(TreeNodeCollection nodes)
{
foreach (TreeNode node in nodes)
{
node.Expand();
ExpandAllNodes(node.Nodes);
}
}
private async void btnTogglePatch_Click(object sender, EventArgs e)
{
btnTogglePatch.Enabled = false;
foreach (var entry in pendingChanges)
{
var node = entry.Key; // The TreeNode
bool shouldApply = entry.Value; // Whether this patch should be applied (true) or undone (false)
// Check if the entry is Method2 and if the patch is enabled
if (node.Tag?.ToString() == "Method1" && shouldApply)
{
// Start Method2 (Setup Server variant)
logger.Log("(Method 1) Automating Windows 11 Inplace Upgrade...", Color.Blue);
NativePatcher automation = new NativePatcher(logger);
await automation.AutomateWindowsInstallation();
node.BackColor = Color.LightGreen;
logger.Log("Method 1 Started: Windows 11 Installation Automated", Color.Black);
}
else if (node.Tag is ScriptPatcher plugin)
{
if (shouldApply)
{
// Apply the patch
logger.Log($"Applying patch: {plugin.PlugID}", Color.Blue);
plugin.PlugDoFeature();
node.BackColor = Color.LightGreen;
logger.Log($"Activated patch: {plugin.PlugID}", Color.Black);
}
else
{
// Undo the patch
logger.Log($"Undoing patch: {plugin.PlugID}", Color.Blue);
plugin.PlugUndoFeature();
node.BackColor = Color.LightGray;
logger.Log($"Deactivated patch: {plugin.PlugID}", Color.Crimson);
}
}
// Handle PowerShell scripts
else if (node.Tag is string psScriptPath)
{
if (shouldApply)
{
// Log and execute the PowerShell script
logger.Log($"Executing PowerShell script: {Path.GetFileName(psScriptPath)}", Color.Blue);
var PSPatcher = new PSPatcher();
await PSPatcher.ExecutePlugin(psScriptPath, logger);
node.BackColor = Color.LightGreen;
logger.Log($"Executed PowerShell script: {Path.GetFileName(psScriptPath)}", Color.Black);
}
else
{
// Log for deactivation (not reversible for PS scripts)
logger.Log($"PowerShell script cannot be undone: {Path.GetFileName(psScriptPath)}", Color.Crimson);
node.BackColor = Color.LightGray;
}
}
}
// Clear pending changes after applying
pendingChanges.Clear();
btnTogglePatch.Enabled = true;
}
private void treeSettings_AfterCheck(object sender, TreeViewEventArgs e)
{
// Check if the node's checked status has changed
if (e.Node.Checked)
{
// Add the node and set its status to true (enabled)
pendingChanges[e.Node] = true;
e.Node.BackColor = Color.LightGreen; // Mark the node as active
// Check the type of node (either JSONPluginLoader/Patch or PowerShell script)
if (e.Node.Tag is ScriptPatcher jsonPlugin)
{
logger.Log($"Patch activated: {jsonPlugin.PlugID}", Color.Black);
}
else if (e.Node.Tag is string psScriptPath)
{
logger.Log($"PowerShell script activated: {Path.GetFileName(psScriptPath)}", Color.Black);
}
}
else
{
// Add the node and set its status to false (disabled)
pendingChanges[e.Node] = false;
e.Node.BackColor = Color.LightGray; // Mark the node as inactive
// Check the type of node again (either JSONPluginLoader or PowerShell script)
if (e.Node.Tag is ScriptPatcher jsonPlugin)
{
logger.Log($"Patch deactivated: {jsonPlugin.PlugID}", Color.Crimson);
}
else if (e.Node.Tag is string psScriptPath)
{
logger.Log($"PowerShell script deactivated: {Path.GetFileName(psScriptPath)}", Color.Crimson);
}
}
// Synchronize parent-child node states, so when a child node is checked or unchecked, its parent node automatically reflects this change
if (e.Node.Parent != null)
{
e.Node.Parent.Checked = e.Node.Checked;
}
}
private void treeSettings_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
{
TreeNode node = treeSettings.GetNodeAt(e.Location);
if (node != null)
{
// Check if the node's Tag is the native "Method1"
if (node.Tag?.ToString() == "Method1")
{
rtbDescription.Text = "(Current release: Windows 11 2024 Update l Version 24H2)\nThis method leverages the Windows Server variant of the Windows setup, " +
"which skips most hardware compatibility checks. It allows Windows 11 to be installed on unsupported PCs, " +
"bypassing the usual system requirements. Importantly, while the setup runs in server mode, " +
"it installs the standard Windows 11 (not the server version).\n\nHow it works:\n1. " +
"The app automatically downloads the Windows 11 version 24H2 ISO using the 'Fido' dependency script.\n2. " +
"The ISO image is mounted automatically.\n3. Simply follow the on-screen instructions to complete the upgrade.\n\n" +
"**Technical Note:** The POPCNT requirement cannot be bypassed; it is essential for running Windows 11 (24H2), as the operating system requires this feature to be supported by the CPU. " +
"POPCNT has been included in CPUs since around 2010. However, the patch is expected to work for most users with compatible hardware." +
"Please do not blame me; I am working within the constraints of what is technically possible."
;
}
else if (node.Tag is ScriptPatcher plugin) // Handle JSON plugin description
{
string pluginInfo = $"ID: {plugin.PlugID}\nHow-to:\n{plugin.PlugInfo}";
rtbDescription.Text = pluginInfo;
}
else if (node.Tag is string psScriptPath) // Handle PowerShell script description
{
rtbDescription.Clear();
string scriptInfo = $"PowerShell Script: {Path.GetFileName(psScriptPath)}\nPath: {psScriptPath}";
rtbDescription.Text = scriptInfo;
}
else // Clear description if no node is hovered
{
rtbDescription.Clear();
}
}
}
private void linkGitHub_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Process.Start("https://github.com/builtbybel/Flyby11");
}
private async void btnMountRun_Click(object sender, EventArgs e)
{
NativePatcher patcher = new NativePatcher(logger);
await patcher.RunSetupFromMountedISO();
}
private void linkChangeExperience_Paint(object sender, PaintEventArgs e)
{
// Linkoption gains focus, so trigger a vivid focus rectangle
ControlPaint.DrawFocusRectangle(e.Graphics, linkChangeExperience.ClientRectangle);
}
private void linkChangeExperience_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
ExperienceView experienceView = new ExperienceView();
SwitchView.SetView(experienceView, panelForm);
}
private void checkInstallationMedia_CheckedChanged(object sender, EventArgs e)
{
checkInstallationMedia.Checked = false;
MediaView installMediaView = new MediaView();
SwitchView.SetView(installMediaView, panelForm);
}
}
}
+149
View File
@@ -0,0 +1,149 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAAAAAAAEAIABeBQAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAEAAAABAAgGAAAAXHKoZgAAAAFv
ck5UAc+id5oAAAUYSURBVHja7dwxSsNQAMfhgJObbp7AE/QOgmKrYCk4ODg4CgXBWhGxi4jg4Kg36KCD
DQrSRVwERw/h6A1q3uYamtr3wveH35gML823NVlmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZma13kZvtNw6
zTtKp2Y/b5R9zuEaZ5dW4d2cOQDhh1E0UTpt9kd3ZZ9zuMbZJVcDAAIAAP4PgM5grAjbPnupDIBwL2ca
Z3MH4Pr5RxF2cPtZGQDhXs40zgAgAAAAAAIAAAAgAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAQAAABAAAAAAAUAAEAAE
AAFAABAABAABQAAQAAQAAUAAEAAEAAFAABAABAABQAAQAAQAAUAAEAAEAAFAABAABAABQAAQAAQAAABA
AAAAAAQAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAIAAAAgAAAAAAKAACAACAACgAAgAAgAAoAAIAAIAAKAACAA
CAACgAAgAAgAAoAAIAAIAAKAACAACAACgAAgAAgAAoAAIAAIAAAAgAAAAAAIAAAAgAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJwpAAAA
AAEAAAAQAAAAAAHAQwCAACAACAACgAAgAAgAAoAAIAAIAAKAACAACAACgOoAwN7VuyJs5+K1MgDCvZxp
nM0dAMXftAAomQAgAABghls/Gq0UP45jpVOr/7RW9jmHa5xdWoV3MzMzMzMzMzMzMzMzMzMzMzMzMzMz
MzMzM/u7rV6+2jwZjZVU3bLPOVzj3NIqvJszB8Dfgf0dWL4H4LABIADkk8P7L0XY7uVbZQCEeznTOPNR
UPkoqI+CAkAAAAAABAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAIAAAAAACAAAAIAAIAAKAACAACAACgAAgAAgAAoAAIAAI
AAKAACAACAACgAAgAAgAAoAAIAAIAAKAACAACAACgAAgAAgAAoAAAAAACAAAAIAAAAAACAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAABAAAAEAAAAAABAAAAEAAEAAEAAFAABAABAABQAAQAAQAAUAAEAAEAAFAABAABAABQAAQAAQAAUAA
EAAEAAFAABAABAABQAAQAAQAAQAAABAAAAAAAQAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAzBQAAACAAAAAAAgAAACAAeAgAEAAE
AAFAABAABAABQAAQAAQAAUAAEAAEAAFAAFAdABg8fCvC9m8+KgMg3MuZxtncAVD8TQuAkgkAAgAAACAA
AGAWa7eHC63zxyWlU7s7XCz9nItrnF1iz7l4NzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM6v1fgFi3pGw
zf9AVwAAAABJRU5ErkJggg==
</value>
</data>
</root>
+343
View File
@@ -0,0 +1,343 @@
using System;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
/*
* NativePatcher class is responsible for automating the Windows 11 24H2 installation process.
* It uses the Fido.ps1 script https://github.com/pbatard/Fido to download the ISO, mounts the ISO, and runs Server setupprep.exe
*/
namespace FlybyScript
{
public class NativePatcher
{
private Logger _logger;
private string _fidoScriptPath;
public NativePatcher(Logger logger)
{
this._fidoScriptPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "upgraider", "Fido.ps1");
this._logger = logger;
}
public async Task AutomateWindowsInstallation()
{
// Step 1: Download Windows 24H2 ISO using Fido.ps1
await DownloadISO();
// Step 2: Allow user to select the ISO after download
MessageBox.Show("Please select the ISO file to mount.", "ISO Selection", MessageBoxButtons.OK, MessageBoxIcon.Information);
// Step 3: Mount the ISO and get the mounted drive letter
string mountedDriveLetter = await MountISO();
if (string.IsNullOrEmpty(mountedDriveLetter))
{
_logger.Log("Failed to mount ISO. Exiting.", Color.Crimson);
return;
}
// Step 2: Run the setup process with the mounted drive letter
await RunSetup(mountedDriveLetter);
}
// Step 1: Download Windows 24H2 ISO by running the Fido.ps1 script
private async Task DownloadISO()
{
try
{
_logger.Log("Starting the download of the Windows 24H2 ISO...", Color.Blue);
// Run Fido.ps1 to download the ISO (PowerShell script)
string downloadCommand = $"& \"{_fidoScriptPath}\"";
await ExecutePowerShellCommand(downloadCommand);
_logger.Log("Windows 24H2 ISO download completed.", System.Drawing.Color.Green);
MessageBox.Show("Please wait for the ISO file to download, and then select the ISO file.",
"Information",
MessageBoxButtons.OK,
MessageBoxIcon.Information);
_logger.Log("Please wait for the ISO file to download, and then select the ISO file. " +
"If you cancel the process here and wait for the ISO download, you will need to restart the patching process, " +
"but you can skip the ISO download.", System.Drawing.Color.Black);
}
catch (Exception ex)
{
_logger.Log($"Error during ISO download: {ex.Message}", System.Drawing.Color.Crimson);
}
}
private async Task<string> MountISO()
{
try
{
string isoFilePath = SelectISOFile();
if (!string.IsNullOrEmpty(isoFilePath))
{
MessageBox.Show($"Selected ISO file: {isoFilePath}. Now mounting the ISO.", "ISO Selected", MessageBoxButtons.OK, MessageBoxIcon.Information);
_logger.Log($"Mounting ISO: {isoFilePath}...", System.Drawing.Color.Blue);
string mountCommand = $"Mount-DiskImage -ImagePath \"{isoFilePath}\"";
await ExecutePowerShellCommand(mountCommand); // Run asynchronously for mounting
// After mounting, try to get the drive letter
string mountedDriveLetter = await GetMountedDriveLetter();
if (string.IsNullOrEmpty(mountedDriveLetter))
{
_logger.Log("Failed to get mounted drive letter.", System.Drawing.Color.Crimson);
return null;
}
else
{
_logger.Log($"ISO mounted successfully. Drive letter: {mountedDriveLetter}", System.Drawing.Color.Green);
return mountedDriveLetter; // Return the mounted drive letter
}
}
else
{
_logger.Log("No ISO file selected.", System.Drawing.Color.Black);
return null;
}
}
catch (Exception ex)
{
_logger.Log($"Error mounting ISO: {ex.Message}", System.Drawing.Color.Crimson);
return null;
}
}
private async Task RunSetup(string mountedDriveLetter)
{
if (string.IsNullOrEmpty(mountedDriveLetter))
{
_logger.Log("No mounted drive found. Exiting.", System.Drawing.Color.Crimson);
return;
}
// Log the drive letter and build the sources folder path
string sourcesFolderPath = Path.Combine(mountedDriveLetter, "sources");
_logger.Log($"Mounted drive letter: {mountedDriveLetter}", System.Drawing.Color.Gray);
_logger.Log($"Checking Sources folder at: {sourcesFolderPath}", System.Drawing.Color.Gray);
// Check if Sources folder exists
if (!Directory.Exists(sourcesFolderPath))
{
_logger.Log($"Sources folder not found at {sourcesFolderPath}.", System.Drawing.Color.Crimson);
return;
}
await LaunchSetupFromSourcesFolder(sourcesFolderPath);
}
private async Task LaunchSetupFromSourcesFolder(string sourcesFolderPath)
{
var processInfo = new ProcessStartInfo
{
FileName = Path.Combine(sourcesFolderPath, "setupprep.exe"),
Arguments = "/product server",
RedirectStandardOutput = true,
RedirectStandardError = true,
UseShellExecute = false,
CreateNoWindow = true
};
try
{
using (var process = Process.Start(processInfo))
{
// Capture output and wait for exit
string output = await process.StandardOutput.ReadToEndAsync();
string error = await process.StandardError.ReadToEndAsync();
await process.WaitForExitAsync();
// Log output and errors if any
if (!string.IsNullOrEmpty(output)) _logger.Log($"Output: {output}", System.Drawing.Color.Gray);
if (!string.IsNullOrEmpty(error)) _logger.Log($"Error: {error}", System.Drawing.Color.Crimson);
}
MessageBox.Show("Follow the Windows Server Setup window now. You can close this message box and the FlybyScript.",
"Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
_logger.Log($"Error running setupprep.exe: {ex.Message}", System.Drawing.Color.Crimson);
}
}
public async Task RunSetupFromMountedISO()
{
// Choose an ISO file
string isoFilePath = SelectISOFile();
if (isoFilePath == null) return;
try
{
_logger.Log($"Please wait...", System.Drawing.Color.Crimson);
// Mount the selected ISO
await ExecutePowerShellCommand($"Mount-DiskImage -ImagePath \"{isoFilePath}\"");
// Get the mounted drive letter
string mountedDriveLetter = await GetMountedDriveLetter();
if (string.IsNullOrEmpty(mountedDriveLetter))
{
_logger.Log("Failed to get mounted drive letter.", System.Drawing.Color.Crimson);
return;
}
_logger.Log($"Mounted drive letter: {mountedDriveLetter}", System.Drawing.Color.Gray);
// Define Sources folder path and check if it exists
string sourcesFolderPath = Path.Combine(mountedDriveLetter, "sources");
if (Directory.Exists(sourcesFolderPath))
{
await LaunchSetupFromSourcesFolder(sourcesFolderPath);
}
else
{
_logger.Log($"Sources folder not found at {sourcesFolderPath}.", System.Drawing.Color.Crimson);
}
}
catch (Exception ex)
{
_logger.Log($"Error mounting ISO or launching setup: {ex.Message}", System.Drawing.Color.Crimson);
}
}
private void ProcessStart(string command)
{
try
{
using (var process = new Process())
{
process.StartInfo.FileName = "cmd.exe";
process.StartInfo.Arguments = command;
process.StartInfo.UseShellExecute = true;
process.StartInfo.CreateNoWindow = false;
// Start the process
process.Start();
// Wait for the process to finish
process.WaitForExit();
}
}
catch (Exception ex)
{
_logger.Log($"Error executing CMD command: {ex.Message}", System.Drawing.Color.Crimson);
}
}
private async Task<string> ExecutePowerShellCommand(string command)
{
try
{
using (var process = new Process())
{
process.StartInfo.FileName = "powershell.exe";
process.StartInfo.Arguments = $"-NoProfile -ExecutionPolicy Bypass -Command \"{command}\"";
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.UseShellExecute = false;
process.StartInfo.CreateNoWindow = true;
// Output and error handlers
var outputBuilder = new StringBuilder();
var errorBuilder = new StringBuilder();
process.OutputDataReceived += (sender, args) =>
{
if (args.Data != null)
{
outputBuilder.AppendLine(args.Data); // Collect output data
_logger.Log(args.Data, System.Drawing.Color.LightPink);
}
};
process.ErrorDataReceived += (sender, args) =>
{
if (args.Data != null)
{
errorBuilder.AppendLine(args.Data); // Collect error data
_logger.Log(args.Data, System.Drawing.Color.Crimson);
}
};
// Start the process
process.Start();
process.BeginOutputReadLine();
process.BeginErrorReadLine();
// Wait for the process to exit
await Task.Run(() => process.WaitForExit());
// Combine the full output and error logs
string output = outputBuilder.ToString();
string error = errorBuilder.ToString();
if (!string.IsNullOrEmpty(error))
{
_logger.Log(error, System.Drawing.Color.Crimson);
}
// Return the entire output of ps command
return output;
}
}
catch (Exception ex)
{
_logger.Log($"PowerShell command execution failed: {ex.Message}", System.Drawing.Color.Crimson);
return string.Empty; // Return an empty string if an error occurs
}
}
// Get the mounted drive letter
private async Task<string> GetMountedDriveLetter()
{
try
{
// List all the drives to find the mounted drive letter
var drives = DriveInfo.GetDrives();
foreach (var drive in drives)
{
// Check if the drive is a CD/DVD and if it's mounted
if (drive.DriveType == DriveType.CDRom && drive.IsReady)
{
// Return the letter of the mounted drive
return drive.Name.Substring(0, 2);
}
}
return null; // Return null if no mounted drive is found
}
catch (Exception ex)
{
_logger.Log($"Error getting mounted drive letter: {ex.Message}", System.Drawing.Color.Crimson);
return null;
}
}
private string SelectISOFile()
{
using (var openFileDialog = new OpenFileDialog
{
Title = "Select Windows 11 ISO File",
Filter = "ISO Files (*.iso)|*.iso|All Files (*.*)|*.*",
InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyComputer)
})
{
return openFileDialog.ShowDialog() == DialogResult.OK ? openFileDialog.FileName : null;
}
}
}
}
+98
View File
@@ -0,0 +1,98 @@
using FlybyScript;
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
public class PSPatcher
{
public void LoadPowerShellPlugins(TreeView treeView)
{
var scriptDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "upgraider");
if (!Directory.Exists(scriptDirectory))
{
MessageBox.Show("upgraider directory does not exist.");
return;
}
// Create a Dependencies category in the TreeView
TreeNode dependencyCategory = new TreeNode("Dependencies");
treeView.Nodes.Add(dependencyCategory);
var scriptFiles = Directory.GetFiles(scriptDirectory, "*.ps1");
foreach (var file in scriptFiles)
{
var scriptName = Path.GetFileNameWithoutExtension(file);
// Create a TreeNode for each ps script
var scriptNode = new TreeNode
{
ToolTipText = file,
Text = $"{scriptName} [PS]",
Tag = file // Store the file path as the Tag
};
// Add the script node to the Dependecy category
dependencyCategory.Nodes.Add(scriptNode);
}
}
// Execute the selected PowerShell script
public async Task ExecutePlugin(string pluginPath, Logger logger)
{
try
{
using (var process = new Process())
{
process.StartInfo.FileName = "powershell.exe";
process.StartInfo.Arguments = $"-NoProfile -ExecutionPolicy Bypass -File \"{pluginPath}\"";
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.UseShellExecute = false;
process.StartInfo.CreateNoWindow = true;
var outputBuilder = new StringBuilder();
var errorBuilder = new StringBuilder();
// Handle output from PowerShell script
process.OutputDataReceived += (sender, e) =>
{
if (!string.IsNullOrEmpty(e.Data))
{
outputBuilder.AppendLine(e.Data);
logger.Log($"PowerShell script output: {e.Data}", System.Drawing.Color.Black);
}
};
// Handle error from PowerShell script
process.ErrorDataReceived += (sender, e) =>
{
if (!string.IsNullOrEmpty(e.Data))
{
errorBuilder.AppendLine(e.Data);
logger.Log($"PowerShell script error: {e.Data}", System.Drawing.Color.Crimson);
}
};
process.Start();
process.BeginOutputReadLine();
process.BeginErrorReadLine();
await Task.Run(() =>
{
process.WaitForExit();
});
logger.Log($"PowerShell script executed successfully: {pluginPath}", System.Drawing.Color.Green);
}
}
catch (Exception ex)
{
logger.Log($"Error executing PowerShell script: {pluginPath}. Exception: {ex.Message}", System.Drawing.Color.Crimson);
}
}
}
+238
View File
@@ -0,0 +1,238 @@
using Newtonsoft.Json;
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
/*
* Imported from my xd-AntiSpy app https://github.com/builtbybel/xd-AntiSpy
*/
namespace FlybyScript
{
public class ScriptPatcher
{
public string PlugID { get; set; }
public string PlugInfo { get; set; }
public string[] PlugCheck { get; set; }
public string[] PlugDo { get; set; }
public string[] PlugUndo { get; set; }
public string PlugCategory { get; set; }
private Logger logger;
public ScriptPatcher(Logger logger)
{
this.logger = logger;
}
public bool PlugCheckFeature()
{
bool isFeatureActive = true;
foreach (var command in PlugCheck)
{
if (!ExecuteCommandAndCheckResult(command))
{
isFeatureActive = false;
break;
}
}
logger.Log($"Feature '{PlugID}' is {(isFeatureActive ? "active" : "inactive")}", System.Drawing.Color.Black);
return isFeatureActive;
}
// PlugCheck Helper to execute commands and check the result
private bool ExecuteCommandAndCheckResult(string command)
{
try
{
var process = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = "cmd.exe",
Arguments = $"/c {command}",
RedirectStandardOutput = true,
UseShellExecute = false,
CreateNoWindow = true,
}
};
process.Start();
process.WaitForExit();
// Read the output of the command
string output = process.StandardOutput.ReadToEnd();
// Check if output contains "1" (indicating active) or "0" (indicating inactive)
bool isActive = output.Contains("1");
// logger.Log($"Plugin executed successfully: {command}. Result: {(isActive ? "active" : "inactive")}", System.Drawing.Color.Black);
return isActive;
}
catch (Exception ex)
{
logger.Log($"Error executing plugin: {command}. Exception: {ex.Message}", System.Drawing.Color.Crimson);
return false;
}
}
public async void PlugDoFeature()
{
await ExecuteFeatureCommands(PlugDo);
}
public async void PlugUndoFeature()
{
await ExecuteFeatureCommands(PlugUndo);
}
private async Task ExecuteFeatureCommands(string[] commands)
{
foreach (var command in commands)
{
await ExecuteCommand(command);
}
}
private async Task ExecuteCommand(string command)
{
try
{
var process = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = IsPowerShellCommand(command) ? "powershell.exe" : "cmd.exe",
Arguments = IsPowerShellCommand(command) ? $"-Command \"{command}\"" : $"/c \"{command}\"",
RedirectStandardOutput = true,
RedirectStandardError = true,
UseShellExecute = false,
CreateNoWindow = true,
}
};
// Event handler for handling output data
process.OutputDataReceived += (sender, e) =>
{
if (!string.IsNullOrEmpty(e.Data))
{
logger.Log($"Output: {e.Data}", System.Drawing.Color.Green);
}
};
// Event handler for handling error data
process.ErrorDataReceived += (sender, e) =>
{
if (!string.IsNullOrEmpty(e.Data))
{
logger.Log($"Error: {e.Data}", System.Drawing.Color.Crimson);
}
};
process.Start();
// Begin asynchronous reading of the output and error streams
process.BeginOutputReadLine();
process.BeginErrorReadLine();
// Wait for the process to exit
await process.WaitForExitAsync();
// Log command execution
logger.Log($"Plugin executed command: {command}", System.Drawing.Color.Green);
}
catch (Exception ex)
{
logger.Log($"Error executing plugin: {command}. Exception: {ex.Message}", System.Drawing.Color.Crimson);
}
}
// Determine if our command should be run with PowerShell
private bool IsPowerShellCommand(string command)
{
return command.StartsWith("powershell.exe") || command.Contains("Get-") || command.Contains("Set-");
}
// Get plugin information
public string GetPluginInformation()
{
return $"{PlugInfo.Replace("\\n", Environment.NewLine)}";
}
private static void AddToPluginCategory(TreeNodeCollection pluginCategory, TreeNode node, string category)
{
if (pluginCategory == null)
throw new ArgumentNullException(nameof(pluginCategory));
var existingCategory = pluginCategory.Cast<TreeNode>().FirstOrDefault(n => n.Text == category);
if (existingCategory == null)
{
existingCategory = new TreeNode(category)
{
// BackColor = System.Drawing.Color.LightBlue,
ForeColor = System.Drawing.Color.Black
};
pluginCategory.Add(existingCategory);
}
existingCategory.Nodes.Add(node);
}
public static async Task LoadPlugins(string pluginDirectory, TreeNodeCollection pluginCategory, Logger logger)
{
if (Directory.Exists(pluginDirectory))
{
var pluginFiles = Directory.GetFiles(pluginDirectory, "*.json");
foreach (var file in pluginFiles)
{
// Exclude JSON files of our DLL Plugins as they are loaded separately
if (Path.GetFileName(file).IndexOf("Plugin", StringComparison.OrdinalIgnoreCase) >= 0)
continue;
try
{
var json = File.ReadAllText(file);
var plugin = JsonConvert.DeserializeObject<ScriptPatcher>(json);
if (plugin != null)
{
plugin.logger = logger; // Set logger for the plugin
// Execute all commands for the plugin to check its feature
bool isActive = plugin.PlugCheckFeature();
var pluginNode = new TreeNode(plugin.PlugID)
{
ToolTipText = plugin.PlugInfo,
Checked = isActive,
Tag = plugin // Store plugin object in Tag property
};
// Add to the appropriate category
AddToPluginCategory(pluginCategory, pluginNode, plugin.PlugCategory);
}
}
catch (Exception ex)
{
logger.Log($"Error loading plugin from file '{file}': {ex.Message}", System.Drawing.Color.Crimson);
}
}
}
}
}
}
// Extension method to make WaitForExit async in ExecuteCommand
public static class ProcessExtensions
{
public static async Task WaitForExitAsync(this Process process)
{
var tcs = new TaskCompletionSource<bool>();
process.EnableRaisingEvents = true;
process.Exited += (sender, args) => tcs.TrySetResult(true);
await tcs.Task;
}
}
+217
View File
@@ -0,0 +1,217 @@
namespace FlybyScript
{
partial class PluginsForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.checkedListBoxPlugins = new System.Windows.Forms.CheckedListBox();
this.textDescription = new System.Windows.Forms.TextBox();
this.btnDownload = new System.Windows.Forms.Button();
this.progressBar = new System.Windows.Forms.ProgressBar();
this.lblHeader = new System.Windows.Forms.Label();
this.btnUninstall = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.btnImport = new System.Windows.Forms.Button();
this.panelBottom = new System.Windows.Forms.Panel();
this.linkPluginsDirectory = new System.Windows.Forms.LinkLabel();
this.panelBottom.SuspendLayout();
this.SuspendLayout();
//
// checkedListBoxPlugins
//
this.checkedListBoxPlugins.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.checkedListBoxPlugins.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240)))));
this.checkedListBoxPlugins.Font = new System.Drawing.Font("Segoe UI Variable Text Light", 10.25F);
this.checkedListBoxPlugins.ForeColor = System.Drawing.Color.Black;
this.checkedListBoxPlugins.FormattingEnabled = true;
this.checkedListBoxPlugins.Location = new System.Drawing.Point(-1, 50);
this.checkedListBoxPlugins.Name = "checkedListBoxPlugins";
this.checkedListBoxPlugins.Size = new System.Drawing.Size(275, 340);
this.checkedListBoxPlugins.TabIndex = 0;
this.checkedListBoxPlugins.ThreeDCheckBoxes = true;
this.checkedListBoxPlugins.SelectedIndexChanged += new System.EventHandler(this.checkedListBoxPlugins_SelectedIndexChanged);
//
// textDescription
//
this.textDescription.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.textDescription.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(252)))), ((int)(((byte)(252)))));
this.textDescription.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textDescription.Font = new System.Drawing.Font("Segoe UI Variable Small Light", 9.75F);
this.textDescription.Location = new System.Drawing.Point(281, 50);
this.textDescription.Multiline = true;
this.textDescription.Name = "textDescription";
this.textDescription.Size = new System.Drawing.Size(348, 309);
this.textDescription.TabIndex = 1;
//
// btnDownload
//
this.btnDownload.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnDownload.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(221)))), ((int)(((byte)(221)))), ((int)(((byte)(221)))));
this.btnDownload.FlatAppearance.BorderColor = System.Drawing.Color.Gray;
this.btnDownload.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnDownload.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnDownload.ForeColor = System.Drawing.Color.Black;
this.btnDownload.Location = new System.Drawing.Point(536, 9);
this.btnDownload.Name = "btnDownload";
this.btnDownload.Size = new System.Drawing.Size(93, 24);
this.btnDownload.TabIndex = 2;
this.btnDownload.Text = "Install";
this.btnDownload.UseVisualStyleBackColor = false;
this.btnDownload.Click += new System.EventHandler(this.btnDownload_Click);
//
// progressBar
//
this.progressBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.progressBar.Location = new System.Drawing.Point(281, 360);
this.progressBar.Name = "progressBar";
this.progressBar.Size = new System.Drawing.Size(348, 23);
this.progressBar.TabIndex = 3;
//
// lblHeader
//
this.lblHeader.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblHeader.AutoEllipsis = true;
this.lblHeader.Font = new System.Drawing.Font("Segoe UI Variable Small", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblHeader.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.lblHeader.Location = new System.Drawing.Point(277, 15);
this.lblHeader.Name = "lblHeader";
this.lblHeader.Size = new System.Drawing.Size(356, 30);
this.lblHeader.TabIndex = 206;
this.lblHeader.Text = "Welcome to Plugins Manager";
//
// btnUninstall
//
this.btnUninstall.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnUninstall.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(221)))), ((int)(((byte)(221)))), ((int)(((byte)(221)))));
this.btnUninstall.FlatAppearance.BorderColor = System.Drawing.Color.Gray;
this.btnUninstall.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnUninstall.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnUninstall.Location = new System.Drawing.Point(437, 9);
this.btnUninstall.Name = "btnUninstall";
this.btnUninstall.Size = new System.Drawing.Size(93, 24);
this.btnUninstall.TabIndex = 207;
this.btnUninstall.Text = "Uninstall";
this.btnUninstall.UseVisualStyleBackColor = false;
this.btnUninstall.Click += new System.EventHandler(this.btnUninstall_Click);
//
// label1
//
this.label1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(65)))), ((int)(((byte)(65)))));
this.label1.Font = new System.Drawing.Font("Segoe UI Variable Text", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.ForeColor = System.Drawing.Color.White;
this.label1.Location = new System.Drawing.Point(-1, 18);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(100, 33);
this.label1.TabIndex = 208;
this.label1.Text = "Available";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// btnImport
//
this.btnImport.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnImport.Font = new System.Drawing.Font("Segoe UI Variable Text", 9F);
this.btnImport.Location = new System.Drawing.Point(96, 18);
this.btnImport.Name = "btnImport";
this.btnImport.Size = new System.Drawing.Size(100, 33);
this.btnImport.TabIndex = 209;
this.btnImport.Text = "Import";
this.btnImport.UseVisualStyleBackColor = true;
this.btnImport.Click += new System.EventHandler(this.btnImport_Click);
//
// panelBottom
//
this.panelBottom.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238)))));
this.panelBottom.Controls.Add(this.linkPluginsDirectory);
this.panelBottom.Controls.Add(this.btnUninstall);
this.panelBottom.Controls.Add(this.btnDownload);
this.panelBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panelBottom.Location = new System.Drawing.Point(0, 401);
this.panelBottom.Name = "panelBottom";
this.panelBottom.Size = new System.Drawing.Size(646, 45);
this.panelBottom.TabIndex = 210;
//
// linkPluginsDirectory
//
this.linkPluginsDirectory.ActiveLinkColor = System.Drawing.Color.RoyalBlue;
this.linkPluginsDirectory.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.linkPluginsDirectory.AutoEllipsis = true;
this.linkPluginsDirectory.AutoSize = true;
this.linkPluginsDirectory.Font = new System.Drawing.Font("Segoe UI Variable Small", 8.75F);
this.linkPluginsDirectory.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
this.linkPluginsDirectory.LinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(112)))), ((int)(((byte)(192)))));
this.linkPluginsDirectory.Location = new System.Drawing.Point(12, 17);
this.linkPluginsDirectory.Name = "linkPluginsDirectory";
this.linkPluginsDirectory.Size = new System.Drawing.Size(97, 16);
this.linkPluginsDirectory.TabIndex = 208;
this.linkPluginsDirectory.TabStop = true;
this.linkPluginsDirectory.Text = "Plugins directory";
this.linkPluginsDirectory.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkPluginsDirectory_LinkClicked);
//
// PluginsForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(248)))), ((int)(((byte)(248)))), ((int)(((byte)(248)))));
this.ClientSize = new System.Drawing.Size(646, 446);
this.Controls.Add(this.panelBottom);
this.Controls.Add(this.btnImport);
this.Controls.Add(this.label1);
this.Controls.Add(this.lblHeader);
this.Controls.Add(this.progressBar);
this.Controls.Add(this.textDescription);
this.Controls.Add(this.checkedListBoxPlugins);
this.Name = "PluginsForm";
this.ShowIcon = false;
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Plugins-Manager";
this.panelBottom.ResumeLayout(false);
this.panelBottom.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.CheckedListBox checkedListBoxPlugins;
private System.Windows.Forms.TextBox textDescription;
private System.Windows.Forms.Button btnDownload;
private System.Windows.Forms.ProgressBar progressBar;
private System.Windows.Forms.Label lblHeader;
private System.Windows.Forms.Button btnUninstall;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btnImport;
private System.Windows.Forms.Panel panelBottom;
private System.Windows.Forms.LinkLabel linkPluginsDirectory;
}
}
+220
View File
@@ -0,0 +1,220 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using System.Windows.Forms;
using Newtonsoft.Json;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
namespace FlybyScript
{
public partial class PluginsForm : Form
{
private const string PluginJsonUrl = "https://raw.githubusercontent.com/builtbybel/Flyby11/main/plugins/plugins_manifest.json";
private const string PluginBaseUrl = "https://github.com/builtbybel/Flyby11/raw/main/plugins/";
// Dictionary to store plugin filenames and descriptions
private Dictionary<string, string> pluginDescriptions;
private readonly string pluginsDirectory = Path.Combine(Application.StartupPath, "upgraider");
private MainForm _mainForm;
public PluginsForm(MainForm mainForm)
{
InitializeComponent();
_mainForm = mainForm;
LoadPlugins();
}
private async void LoadPlugins()
{
try
{
var json = await DownloadJsonAsync(PluginJsonUrl);
pluginDescriptions = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);
foreach (var pluginFileName in pluginDescriptions.Keys)
{
// Add each plugin to the CheckedListBox
bool isInstalled = File.Exists(Path.Combine(pluginsDirectory, pluginFileName));
int index = checkedListBoxPlugins.Items.Add(pluginFileName);
// Check the item if the plugin is installed
checkedListBoxPlugins.SetItemChecked(index, isInstalled);
}
}
catch (Exception ex)
{
MessageBox.Show($"Error loading plugins: {ex.Message}");
}
}
private async Task<string> DownloadJsonAsync(string url)
{
using (HttpClient client = new HttpClient())
{
return await client.GetStringAsync(url);
}
}
private void checkedListBoxPlugins_SelectedIndexChanged(object sender, EventArgs e)
{
var selectedPlugin = checkedListBoxPlugins.SelectedItem?.ToString();
if (selectedPlugin != null && pluginDescriptions.ContainsKey(selectedPlugin))
{
textDescription.Text = pluginDescriptions[selectedPlugin];
}
}
private async void btnDownload_Click(object sender, EventArgs e)
{
var selectedPlugins = new List<string>();
foreach (var plugin in checkedListBoxPlugins.CheckedItems)
{
selectedPlugins.Add(plugin.ToString());
}
if (selectedPlugins.Count > 0)
{
await DownloadPluginsAsync(selectedPlugins);
}
else
{
MessageBox.Show("Please select at least one plugin to download.");
}
}
private async Task DownloadPluginsAsync(List<string> plugins)
{
progressBar.Value = 0;
progressBar.Maximum = plugins.Count;
using (HttpClient client = new HttpClient())
{
foreach (var pluginFileName in plugins)
{
try
{
var pluginUrl = $"{PluginBaseUrl}{pluginFileName}";
var downloadPath = Path.Combine(pluginsDirectory, pluginFileName);
var data = await client.GetByteArrayAsync(pluginUrl);
await WriteAllBytesAsync(downloadPath, data);
progressBar.Value += 1;
}
catch (Exception ex)
{
MessageBox.Show($"Failed to download {pluginFileName}: {ex.Message}");
}
}
}
MessageBox.Show("All selected plugins have been downloaded.");
}
private async Task WriteAllBytesAsync(string path, byte[] data)
{
using (var fs = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.None, 4096, useAsync: true))
{
await fs.WriteAsync(data, 0, data.Length);
}
}
protected override void OnFormClosing(FormClosingEventArgs e)
{
base.OnFormClosing(e);
_mainForm.RefreshTreeView();
}
private void btnUninstall_Click(object sender, EventArgs e)
{
var pluginsToRemove = new List<string>();
foreach (var plugin in checkedListBoxPlugins.CheckedItems)
{
pluginsToRemove.Add(plugin.ToString());
}
foreach (var pluginFileName in pluginsToRemove)
{
try
{
var filePath = Path.Combine("upgraider", pluginFileName);
if (File.Exists(filePath))
{
File.Delete(filePath);
checkedListBoxPlugins.Items.Remove(pluginFileName);
}
}
catch (Exception ex)
{
MessageBox.Show($"Failed to uninstall {pluginFileName}: {ex.Message}");
}
}
MessageBox.Show("Selected plugins have been uninstalled.");
checkedListBoxPlugins.Items.Clear();
LoadPlugins(); // Refresh the list of plugins
}
private void btnImport_Click(object sender, EventArgs e)
{
using (var folderBrowserDialog = new FolderBrowserDialog())
{
// Open the folder browser dialog to select the source directory
if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
{
string sourceDirectory = folderBrowserDialog.SelectedPath;
string[] files = Directory.GetFiles(sourceDirectory, "*.*", SearchOption.TopDirectoryOnly)
.Where(file => file.EndsWith(".json") || file.EndsWith(".ps1")).ToArray();
List<string> importedPlugins = new List<string>(); // List to store imported plugin names
foreach (var file in files)
{
try
{
string fileName = Path.GetFileName(file);
string destinationPath = Path.Combine(pluginsDirectory, fileName);
File.Copy(file, destinationPath, true); // Overwrite if file exists
importedPlugins.Add(fileName); // Add to the imported plugins list
}
catch (Exception ex)
{
MessageBox.Show($"Failed to import {file}: {ex.Message}");
}
}
// Show message box with the names of the imported plugins
if (importedPlugins.Count > 0)
{
string message = "Imported Plugins:\n" + string.Join("\n", importedPlugins);
MessageBox.Show(message, "Import Completed", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
MessageBox.Show("No plugins were imported.", "Import Completed", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
}
private void linkPluginsDirectory_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
try
{
Process.Start("explorer.exe", pluginsDirectory);
}
catch (Exception ex)
{
MessageBox.Show($"Failed to open plugins directory: {ex.Message}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+16
View File
@@ -0,0 +1,16 @@
using System;
using System.Windows.Forms;
namespace FlybyScript
{
internal static class Program
{
[STAThread]
private static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
}
}
+32
View File
@@ -0,0 +1,32 @@
using System.Reflection;
using System.Runtime.InteropServices;
// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die einer Assembly zugeordnet sind.
[assembly: AssemblyTitle("Flyby11")]
[assembly: AssemblyDescription("Bypassing Windows 11 hardware requirements")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Builtbybel")]
[assembly: AssemblyProduct("Flyby11")]
[assembly: AssemblyCopyright("Copyright © 2024 A Belim app creation")]
[assembly: AssemblyTrademark("Builtbybel")]
[assembly: AssemblyCulture("")]
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
[assembly: ComVisible(false)]
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
[assembly: Guid("66ddc36a-9095-4053-941c-8829d44f5f20")]
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
//
// Hauptversion
// Nebenversion
// Buildnummer
// Revision
//
[assembly: AssemblyVersion("0.14.107")]
[assembly: AssemblyFileVersion("0.14.107")]
+63
View File
@@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.42000
//
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------
namespace FlybyScript.Properties {
using System;
/// <summary>
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
/// </summary>
// Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
// -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
// mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FlybyScript.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
/// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
+117
View File
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+26
View File
@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.42000
//
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------
namespace FlybyScript.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.11.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}
+7
View File
@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
+448
View File
@@ -0,0 +1,448 @@
using System;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Net.Http;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace FlybyScript
{
public class USBManagement
{
private readonly Logger _logger;
private ProgressBar _progressBar;
public Action<string> UpdateLabelStatus;
private int currentStep = 0;
private static readonly HttpClient httpClient = new HttpClient();
public USBManagement(Logger logger, Action<string> updateLabelStatus, ProgressBar progressBar)
{
_logger = logger;
_progressBar = progressBar;
UpdateLabelStatus = updateLabelStatus; // Set the delegate to update UI
}
private string[] steps = new[]
{
"Format and Boot USB Drive",
"Mount ISO",
"Copy ISO to USB",
"Split Install.wim",
"Finalize Installation Media (Install.wim)"
};
/// <summary>
/// Updates the LabelStatus with the current step
/// </summary>
public void UpdateStatusLabel()
{
currentStep++;
if (currentStep <= steps.Length)
{
string statusText = $"{currentStep}/{steps.Length} - {steps[currentStep - 1]}";
// Call the delegate to update the label in the user control
UpdateLabelStatus?.Invoke(statusText);
// Log to the logger as well
_logger.Log($"Step {currentStep}: {steps[currentStep - 1]} started.", Color.Blue);
}
}
/// <summary>
/// Updates the progress bar with the specified value
/// </summary>
private void UpdateProgress(int value)
{
if (_progressBar.InvokeRequired)
{
_progressBar.Invoke(new Action(() => _progressBar.Value = value));
}
else
{
_progressBar.Value = value;
}
}
/// <summary>
/// Formats the USB drive using DiskPart
/// </summary>
/// <param name="diskNumber">Diskpart Device ID</param>
/// <returns></returns>
public async Task FormatDriveAsync(string diskNumber, string partitionScheme)
{
await Task.Run(() =>
{
try
{
ProcessStartInfo processInfo = new ProcessStartInfo
{
FileName = "diskpart.exe",
RedirectStandardInput = true,
RedirectStandardOutput = true,
UseShellExecute = false,
CreateNoWindow = true
};
using (Process process = Process.Start(processInfo))
{
using (StreamWriter writer = process.StandardInput)
{
if (writer.BaseStream.CanWrite)
{
// Step 1: Format and Boot USB Drive
UpdateStatusLabel(); // Updates to 1/5 - Format and Boot USB Drive
// Send commands to DiskPart
writer.WriteLine($"select disk {diskNumber}"); // Select the disk
UpdateProgress(10); // Update progress
writer.WriteLine("clean"); // Clean the disk
// Check partition scheme selection
if (partitionScheme == "GPT")
{
writer.WriteLine("convert gpt"); // Convert to GPT
}
else if (partitionScheme == "MBR")
{
writer.WriteLine("convert mbr"); // Convert to MBR
}
UpdateProgress(20);
writer.WriteLine("create partition primary"); // Create a new partition
writer.WriteLine("select partition 1"); // Select the new partition
writer.WriteLine("active"); // Set the new partition active
UpdateProgress(60);
writer.WriteLine("format fs=fat32 quick label=\"FlybyWin11\""); // Quick format to FAT32
writer.WriteLine("exit"); // Exit DiskPart
UpdateProgress(100); // Final progress
}
}
string output = process.StandardOutput.ReadToEnd(); // Get the output from DiskPart
process.WaitForExit();
_logger.Log($"Formatting completed: {output}", Color.Black);
}
}
catch (Exception ex)
{
_logger.Log($"Error formatting drive: {ex.Message}", Color.Red);
}
});
}
/// <summary>
/// Copies the contents of the specified ISO file to the USB drive using Robocopy.
/// </summary>
/// <param name="usbDrive">The drive letter of the USB drive.</param>
/// <param name="isoPath">The path to the ISO file.</param>
public async Task CopyISOAsync(string usbDrive, string isoPath)
{
try
{
// Step 1: Mount the ISO using PowerShell
UpdateStatusLabel(); // Updates to "2/5 - Mount ISO"
string mountCommand = $"Mount-DiskImage -ImagePath \"{isoPath}\"";
ProcessStartInfo mountInfo = new ProcessStartInfo("powershell", mountCommand)
{
RedirectStandardOutput = true,
UseShellExecute = false,
CreateNoWindow = true
};
using (Process mountProcess = Process.Start(mountInfo))
{
string output = await mountProcess.StandardOutput.ReadToEndAsync();
await mountProcess.WaitForExitAsync(); // Wait for the process to complete
_logger.Log($"ISO mounted: {output}", Color.Black);
}
// Step 2: Get the drive letter of the mounted ISO
string isoDriveLetter = await GetMountedDriveLetterAsync(); // Get the drive letter of the mounted ISO
if (string.IsNullOrEmpty(isoDriveLetter))
{
_logger.Log("Failed to get the mounted ISO drive letter.", Color.Red);
return; // Exit if we cant find the drive letter
}
_logger.Log($"Mounted ISO drive letter: {isoDriveLetter}", Color.Black);
_logger.Log($"USB drive letter: {usbDrive}", Color.Black);
// Step 3: Prepare the Robocopy command to copy everything except install.wim
string robocopyCommand = $"robocopy {isoDriveLetter.TrimEnd('\\')} {usbDrive.TrimEnd('\\')} /MIR /XF \"install.wim\"";
// Step 4: Execute the Robocopy command
ProcessStartInfo robocopyInfo = new ProcessStartInfo("cmd.exe", $"/C {robocopyCommand}")
{
RedirectStandardOutput = true,
UseShellExecute = false,
CreateNoWindow = true,
};
// Step 3: Copy ISO to USB
UpdateStatusLabel(); // Updates to "3/5 - Copy ISO to USB"
using (Process robocopyProcess = Process.Start(robocopyInfo))
{
robocopyProcess.OutputDataReceived += (s, e) =>
{
if (!string.IsNullOrEmpty(e.Data))
{
_logger.Log(e.Data, Color.Black);
// Calculate and update progress based on Robocopy output
int progress = CalculateProgressFromRobocopy(e.Data);
UpdateProgress(progress);
}
};
robocopyProcess.BeginOutputReadLine();
// Wait for the process to finish
await robocopyProcess.WaitForExitAsync();
}
// Step 5: Get the path to the original WIM file (from the ISO)
string wimFilePath = Path.Combine(isoDriveLetter, "sources", "install.wim");
_logger.Log("Preparing install.wim... This may take a moment, please wait.", Color.Blue);
// Step 4: Split Install.wim
UpdateStatusLabel(); // Updates to "4/5 - Split Install.wim"
if (File.Exists(wimFilePath))
{
// Step 7: Define the path for the split files
string swmFilePath = Path.Combine(usbDrive, "sources", "install.swm"); // First split file
// Step 8: Dism command to split WIM
string splitDismCommand = $"/C Dism /Split-Image /ImageFile:\"{wimFilePath}\" /SWMFile:\"{swmFilePath}\" /FileSize:3000";
// Execute the command
ProcessStartInfo splitInfo = new ProcessStartInfo("cmd.exe", splitDismCommand)
{
RedirectStandardOutput = true,
UseShellExecute = false,
CreateNoWindow = true
};
// Step 5: Finalize Installation Media
UpdateStatusLabel(); // Updates to 5/5 - Finalize Installation Media
using (Process splitProcess = Process.Start(splitInfo))
{
splitProcess.OutputDataReceived += (s, e) =>
{
if (!string.IsNullOrEmpty(e.Data))
{
_logger.Log(e.Data, Color.Black); // Log the output from Dism
}
};
splitProcess.BeginOutputReadLine();
// Wait for the process to finish
await splitProcess.WaitForExitAsync();
_logger.Log($"WIM file split completed with exit code: {splitProcess.ExitCode}", Color.Blue);
}
}
else
{
_logger.Log($"WIM file not found at {wimFilePath}.", Color.Red);
}
}
catch (Exception ex)
{
_logger.Log($"Error copying ISO: {ex.Message}", Color.Red);
}
MessageBox.Show("Your installation media is ready! You can now proceed with the installation.", "Installation Media", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
/// <summary>
/// Retrieves the drive letter of the currently mounted drive.
/// </summary>
/// <returns>The drive letter of the mounted CD/DVD drive, or null if not found.</returns>
private async Task<string> GetMountedDriveLetterAsync()
{
try
{
// List all the drives to find the mounted CD/DVD drive
var drives = DriveInfo.GetDrives();
foreach (var drive in drives)
{
// Check if the drive is a CD/DVD and if it's mounted
if (drive.DriveType == DriveType.CDRom && drive.IsReady)
{
// Return the letter of the mounted drive
return drive.Name; // Returns "D:\", "E:\", etc.
}
}
return null; // Return null if no mounted CD/DVD drive is found
}
catch (Exception ex)
{
_logger.Log($"Error getting mounted drive letter: {ex.Message}", Color.Crimson);
return null;
}
}
/// <summary>
/// Downloads a specified tool (Media Creation Tool or Installation Assistant) from a provided URL.
/// </summary>
/// <param name="downloadUrl">The URL of the tool to download.</param>
/// <param name="fileName">The name of the file to save.</param>
/// <returns>A task representing the asynchronous operation.</returns>
public async Task DownloadMediaTool(string downloadUrl, string fileName)
{
using (SaveFileDialog saveFileDialog = new SaveFileDialog())
{
saveFileDialog.Filter = "Executable Files (*.exe)|*.exe";
saveFileDialog.Title = $"Save {fileName}";
saveFileDialog.FileName = fileName;
if (saveFileDialog.ShowDialog() == DialogResult.OK)
{
string destinationPath = saveFileDialog.FileName;
try
{
_logger.Log($"Preparing to download {fileName}...", Color.Black);
_logger.Log("Download may take some time, please wait...", Color.RoyalBlue);
var response = await httpClient.GetAsync(downloadUrl);
response.EnsureSuccessStatusCode();
using (var fileStream = new FileStream(destinationPath, FileMode.Create, FileAccess.Write, FileShare.None))
{
await response.Content.CopyToAsync(fileStream);
}
_logger.Log($"{fileName} download completed successfully!", Color.Green);
// Start the downloaded tool
_logger.Log($"Starting {fileName}...", Color.Black);
Process.Start(new ProcessStartInfo
{
FileName = destinationPath,
UseShellExecute = true // To run .exe files
});
}
catch (Exception ex)
{
_logger.Log($"An error occurred while downloading {fileName}: {ex.Message}", Color.Red);
}
}
else
{
_logger.Log($"{fileName} download canceled by user.", Color.Red);
}
}
}
/// <summary>
/// Calculates progress based on Robocopy output
/// </summary>
private int CalculateProgressFromRobocopy(string robocopyOutput)
{
// Find the percentage completion in Robocopy output
var match = Regex.Match(robocopyOutput, @"(\d+)\%");
if (match.Success)
{
// Extract the percentage number from the match and convert it to an integer
if (int.TryParse(match.Groups[1].Value, out int progress))
{
return progress;
}
}
return 0; // Return 0 if no percentage was found
}
/// <summary>
/// Copy the ISO to the USB drive and optionally create an unattend.xml file
/// </summary>
/// <param name="usbDrive"></param>
/// <param name="isoPath"></param>
/// <param name="createUnattend"></param>
/// <returns></returns>
public async Task CopyISOWithUnattendAsync(string usbDrive, string isoPath, bool createUnattend)
{
await CopyISOAsync(usbDrive, isoPath);
if (createUnattend)
{
CreateUnattendXml(usbDrive); // Only create unattend.xml if checkbox is checked
}
}
/// <summary>
/// // Create unattend.xml file in the sources\$OEM$\$$\Panther directory
/// </summary>
/// <param name="usbDrive"></param>
public void CreateUnattendXml(string usbDrive)
{
string unattendDir = Path.Combine(usbDrive, "sources", "$OEM$", "$$", "Panther");
Directory.CreateDirectory(unattendDir); // Create the directory if it doesn't exist
string unattendPath = Path.Combine(unattendDir, "unattend.xml");
// Check if the file already exists
if (!File.Exists(unattendPath))
{
// Create the unattend.xml content
string xmlContent = @"<unattend xmlns='urn:schemas-microsoft-com:unattend'>
<settings pass='disabled'>
<component xmlns:wcm='http://schemas.microsoft.com/WMIConfig/2002/State' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' name='Microsoft-Windows-Setup' processorArchitecture='amd64' language='neutral' publicKeyToken='31bf3856ad364e35' versionScope='nonSxS'>
<UserData>
<ProductKey>
<Key/>
</ProductKey>
</UserData>
<RunSynchronous>
<RunSynchronousCommand wcm:action='add'>
<Order>1</Order>
<Path>reg add HKLM\SYSTEM\Setup\LabConfig /v BypassTPMCheck /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action='add'>
<Order>2</Order>
<Path>reg add HKLM\SYSTEM\Setup\LabConfig /v BypassSecureBootCheck /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action='add'>
<Order>3</Order>
<Path>reg add HKLM\SYSTEM\Setup\LabConfig /v BypassRAMCheck /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
</RunSynchronous>
</component>
</settings>
<settings pass='specialize'>
<component xmlns:wcm='http://schemas.microsoft.com/WMIConfig/2002/State' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' name='Microsoft-Windows-Deployment' processorArchitecture='amd64' language='neutral' publicKeyToken='31bf3856ad364e35' versionScope='nonSxS'>
<RunSynchronous>
<RunSynchronousCommand wcm:action='add'>
<Order>1</Order>
<Path>reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OOBE /v BypassNRO /t REG_DWORD /d 1 /f</Path>
</RunSynchronousCommand>
</RunSynchronous>
</component>
</settings>
</unattend>";
File.WriteAllText(unattendPath, xmlContent);
_logger.Log("Created unattend.xml in the sources\\$OEM$\\$$\\Panther directory.", Color.Green);
}
else
{
_logger.Log("unattend.xml already exists in the sources\\$OEM$\\$$\\Panther directory.", Color.Blue);
}
}
}
}
+194
View File
@@ -0,0 +1,194 @@
namespace Views
{
partial class ExperienceView
{
/// <summary>
/// Erforderliche Designervariable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Verwendete Ressourcen bereinigen.
/// </summary>
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Vom Komponenten-Designer generierter Code
/// <summary>
/// Erforderliche Methode für die Designerunterstützung.
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
/// </summary>
private void InitializeComponent()
{
this.btnBack = new System.Windows.Forms.Button();
this.featurePanel = new System.Windows.Forms.FlowLayoutPanel();
this.rtbDescription = new System.Windows.Forms.RichTextBox();
this.lblHeader = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.btnRevert = new System.Windows.Forms.Button();
this.btnApply = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
this.featurePanel.SuspendLayout();
this.SuspendLayout();
//
// btnBack
//
this.btnBack.AutoSize = true;
this.btnBack.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control;
this.btnBack.FlatAppearance.BorderSize = 0;
this.btnBack.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnBack.Font = new System.Drawing.Font("Segoe MDL2 Assets", 14F, System.Drawing.FontStyle.Bold);
this.btnBack.ForeColor = System.Drawing.Color.DarkGray;
this.btnBack.Location = new System.Drawing.Point(3, 3);
this.btnBack.Name = "btnBack";
this.btnBack.Size = new System.Drawing.Size(34, 29);
this.btnBack.TabIndex = 231;
this.btnBack.Text = "...";
this.btnBack.UseVisualStyleBackColor = true;
this.btnBack.Click += new System.EventHandler(this.btnBack_Click);
//
// featurePanel
//
this.featurePanel.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.featurePanel.AutoScroll = true;
this.featurePanel.Controls.Add(this.rtbDescription);
this.featurePanel.Location = new System.Drawing.Point(69, 170);
this.featurePanel.Name = "featurePanel";
this.featurePanel.Size = new System.Drawing.Size(852, 365);
this.featurePanel.TabIndex = 232;
//
// rtbDescription
//
this.rtbDescription.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.rtbDescription.BackColor = System.Drawing.Color.Silver;
this.rtbDescription.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.rtbDescription.Location = new System.Drawing.Point(3, 3);
this.rtbDescription.Name = "rtbDescription";
this.rtbDescription.Size = new System.Drawing.Size(345, 55);
this.rtbDescription.TabIndex = 233;
this.rtbDescription.Text = "";
this.rtbDescription.Visible = false;
//
// lblHeader
//
this.lblHeader.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblHeader.AutoEllipsis = true;
this.lblHeader.Font = new System.Drawing.Font("Segoe UI Variable Small Light", 21.25F);
this.lblHeader.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(112)))), ((int)(((byte)(192)))));
this.lblHeader.Location = new System.Drawing.Point(69, 22);
this.lblHeader.Name = "lblHeader";
this.lblHeader.Size = new System.Drawing.Size(771, 84);
this.lblHeader.TabIndex = 234;
this.lblHeader.Text = "Choose privacy settings for your device";
//
// 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.Font = new System.Drawing.Font("Segoe UI Variable Small Light", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(73, 66);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(837, 66);
this.label1.TabIndex = 235;
this.label1.Text = "Good news!\r\nWith these privacy settings, you\'re in control of what’s shared and s" +
"hown within Microsoft.\r\n\r\nTo accept, choose \"Accept and Apply.\" If you prefer de" +
"fault settings, select \"Decline.\"";
//
// btnRevert
//
this.btnRevert.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnRevert.AutoEllipsis = true;
this.btnRevert.BackColor = System.Drawing.Color.White;
this.btnRevert.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnRevert.FlatAppearance.BorderColor = System.Drawing.Color.Gray;
this.btnRevert.FlatAppearance.BorderSize = 2;
this.btnRevert.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(112)))), ((int)(((byte)(192)))));
this.btnRevert.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnRevert.Font = new System.Drawing.Font("Arial", 9.75F);
this.btnRevert.Location = new System.Drawing.Point(473, 565);
this.btnRevert.Name = "btnRevert";
this.btnRevert.Size = new System.Drawing.Size(220, 40);
this.btnRevert.TabIndex = 238;
this.btnRevert.TabStop = false;
this.btnRevert.Text = "Decline";
this.btnRevert.UseVisualStyleBackColor = false;
this.btnRevert.Click += new System.EventHandler(this.btnRevert_Click);
//
// btnApply
//
this.btnApply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnApply.BackColor = System.Drawing.Color.White;
this.btnApply.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnApply.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(112)))), ((int)(((byte)(192)))));
this.btnApply.FlatAppearance.BorderSize = 2;
this.btnApply.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(112)))), ((int)(((byte)(192)))));
this.btnApply.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnApply.Font = new System.Drawing.Font("Arial", 9.75F);
this.btnApply.Location = new System.Drawing.Point(699, 565);
this.btnApply.Name = "btnApply";
this.btnApply.Size = new System.Drawing.Size(222, 40);
this.btnApply.TabIndex = 237;
this.btnApply.TabStop = false;
this.btnApply.Text = "Accept and apply";
this.btnApply.UseCompatibleTextRendering = true;
this.btnApply.UseVisualStyleBackColor = false;
this.btnApply.Click += new System.EventHandler(this.btnApply_Click);
//
// label2
//
this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label2.AutoEllipsis = true;
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Segoe UI Variable Small Semibol", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label2.Location = new System.Drawing.Point(84, 142);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(158, 16);
this.label2.TabIndex = 239;
this.label2.Text = "Last updated October 2024";
//
// ExperienceView
//
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.label2);
this.Controls.Add(this.btnRevert);
this.Controls.Add(this.btnApply);
this.Controls.Add(this.label1);
this.Controls.Add(this.lblHeader);
this.Controls.Add(this.featurePanel);
this.Controls.Add(this.btnBack);
this.Name = "ExperienceView";
this.Size = new System.Drawing.Size(959, 631);
this.featurePanel.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button btnBack;
private System.Windows.Forms.FlowLayoutPanel featurePanel;
private System.Windows.Forms.RichTextBox rtbDescription;
private System.Windows.Forms.Label lblHeader;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btnRevert;
private System.Windows.Forms.Button btnApply;
private System.Windows.Forms.Label label2;
}
}
+119
View File
@@ -0,0 +1,119 @@
using FlybyScript;
using Settings.Ads;
using Settings.Privacy;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
namespace Views
{
public partial class ExperienceView : UserControl
{
private Logger logger;
private List<FeatureBase> features;
public ExperienceView()
{
InitializeComponent();
SetStyle();
InitializeFeatures();
LoadFeatures();
}
private void SetStyle()
{
// Segoe MDL2 Assets assets
btnBack.Text = "\uE72B";
}
private void InitializeFeatures()
{
// Initialize logger
logger = new Logger(rtbDescription);
// Initialize the list of features
features = new List<FeatureBase>
{
new PrivacyExperience(logger),
new ActivityHistory(logger),
new LocationTracking(logger),
new Telemetry(logger),
new FileExplorerAds(logger),
new FinishSetupAds(logger),
new LockScreenAds(logger),
new PersonalizedAds(logger),
new SettingsAds(logger),
new StartmenuAds(logger),
new TailoredExperiences(logger),
new TipsAndSuggestions(logger),
new WelcomeExperienceAds(logger)
};
}
private void LoadFeatures()
{
// Ensure featurePanel is not null
if (featurePanel == null)
{
MessageBox.Show("FeaturePanel is not initialized. Please check the designer.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
// Clear any existing controls in the featurePanel
featurePanel.Controls.Clear();
// Populate featurePanel with FeaturePanels
foreach (var feature in features)
{
var featurePanelInstance = new FeaturePanel(feature, logger)
{
Width = featurePanel.Width - 50, // Set the width to match the parent featurePanel
Height = 160,
BorderStyle = BorderStyle.None,
BackColor = Color.FromArgb(245, 245, 245),
Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, featurePanel.Width, 160, 20, 20)) // Rounded corners
};
featurePanel.Controls.Add(featurePanelInstance);
}
}
private void btnBack_Click(object sender, EventArgs e)
{
SwitchView.GoBack(this.Parent as Panel);
}
// Import rounded corners
[System.Runtime.InteropServices.DllImport("gdi32.dll")]
private static extern IntPtr CreateRoundRectRgn(int nLeftRect, int nTopRect, int nRightRect, int nBottomRect, int nWidthEllipse, int nHeightEllipse);
private void btnApply_Click(object sender, EventArgs e)
{
foreach (var feature in features)
{
if (!feature.CheckFeature()) // If feature is not enabled
{
feature.DoFeature(); // Apply feature
logger.Log($"{feature.ID()} enabled.", Color.Green);
}
}
LoadFeatures();
MessageBox.Show("All features have been applied.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
private void btnRevert_Click(object sender, EventArgs e)
{
foreach (var feature in features)
{
if (feature.CheckFeature())
{
feature.UndoFeature(); // Revert feature
logger.Log($"{feature.ID()} reverted.", Color.Red);
}
}
LoadFeatures();
MessageBox.Show("All features have been reverted.", "Revert Complete", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+449
View File
@@ -0,0 +1,449 @@
namespace Views
{
partial class MediaView
{
/// <summary>
/// Erforderliche Designervariable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Verwendete Ressourcen bereinigen.
/// </summary>
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Vom Komponenten-Designer generierter Code
/// <summary>
/// Erforderliche Methode für die Designerunterstützung.
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.btnBack = new System.Windows.Forms.Button();
this.rtbLog = new System.Windows.Forms.RichTextBox();
this.comboBoxDrives = new System.Windows.Forms.ComboBox();
this.btnStart = new System.Windows.Forms.Button();
this.lblDriveInfo = new System.Windows.Forms.Label();
this.lblDeviceIDInfo = new System.Windows.Forms.Label();
this.lblStatusInfo = new System.Windows.Forms.Label();
this.btnSelect = new System.Windows.Forms.Button();
this.label6 = new System.Windows.Forms.Label();
this.btnMCT = new System.Windows.Forms.Button();
this.label7 = new System.Windows.Forms.Label();
this.progressBar = new System.Windows.Forms.ProgressBar();
this.lblStatus = new System.Windows.Forms.Label();
this.checkCreateUnattend = new System.Windows.Forms.CheckBox();
this.comboBoxDriveLetters = new System.Windows.Forms.ComboBox();
this.linkShowDiskList = new System.Windows.Forms.LinkLabel();
this.label3 = new System.Windows.Forms.Label();
this.lblDriveLetterInfo = new System.Windows.Forms.Label();
this.lblPartitionSchemeInfo = new System.Windows.Forms.Label();
this.comboBoxPartitionScheme = new System.Windows.Forms.ComboBox();
this.btnInstallAssistant = new System.Windows.Forms.Button();
this.tt = new System.Windows.Forms.ToolTip(this.components);
this.label1 = new System.Windows.Forms.Label();
this.linkPCHealthCheckApp = new System.Windows.Forms.LinkLabel();
this.SuspendLayout();
//
// btnBack
//
this.btnBack.AutoSize = true;
this.btnBack.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control;
this.btnBack.FlatAppearance.BorderSize = 0;
this.btnBack.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnBack.Font = new System.Drawing.Font("Segoe MDL2 Assets", 14F, System.Drawing.FontStyle.Bold);
this.btnBack.ForeColor = System.Drawing.Color.DarkGray;
this.btnBack.Location = new System.Drawing.Point(3, 3);
this.btnBack.Name = "btnBack";
this.btnBack.Size = new System.Drawing.Size(34, 29);
this.btnBack.TabIndex = 231;
this.btnBack.Text = "...";
this.btnBack.UseVisualStyleBackColor = true;
this.btnBack.Click += new System.EventHandler(this.btnBack_Click);
//
// rtbLog
//
this.rtbLog.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.rtbLog.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.rtbLog.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.rtbLog.Enabled = false;
this.rtbLog.Font = new System.Drawing.Font("Segoe UI Variable Small Light", 9.75F);
this.rtbLog.Location = new System.Drawing.Point(59, 362);
this.rtbLog.Name = "rtbLog";
this.rtbLog.Size = new System.Drawing.Size(835, 148);
this.rtbLog.TabIndex = 234;
this.rtbLog.Text = "Ready";
//
// comboBoxDrives
//
this.comboBoxDrives.Enabled = false;
this.comboBoxDrives.Font = new System.Drawing.Font("Segoe UI Variable Small", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.comboBoxDrives.FormattingEnabled = true;
this.comboBoxDrives.Location = new System.Drawing.Point(59, 258);
this.comboBoxDrives.Name = "comboBoxDrives";
this.comboBoxDrives.Size = new System.Drawing.Size(121, 25);
this.comboBoxDrives.TabIndex = 235;
//
// btnStart
//
this.btnStart.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnStart.BackColor = System.Drawing.Color.White;
this.btnStart.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnStart.Enabled = false;
this.btnStart.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(112)))), ((int)(((byte)(192)))));
this.btnStart.FlatAppearance.BorderSize = 2;
this.btnStart.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(112)))), ((int)(((byte)(192)))));
this.btnStart.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnStart.Font = new System.Drawing.Font("Arial", 9.75F);
this.btnStart.Location = new System.Drawing.Point(671, 562);
this.btnStart.Name = "btnStart";
this.btnStart.Size = new System.Drawing.Size(205, 40);
this.btnStart.TabIndex = 236;
this.btnStart.TabStop = false;
this.btnStart.Text = "Start";
this.btnStart.UseCompatibleTextRendering = true;
this.btnStart.UseVisualStyleBackColor = false;
this.btnStart.Click += new System.EventHandler(this.btnStart_Click);
//
// lblDriveInfo
//
this.lblDriveInfo.AutoEllipsis = true;
this.lblDriveInfo.Enabled = false;
this.lblDriveInfo.Font = new System.Drawing.Font("Segoe UI Variable Small", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblDriveInfo.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(112)))), ((int)(((byte)(192)))));
this.lblDriveInfo.Location = new System.Drawing.Point(55, 194);
this.lblDriveInfo.Name = "lblDriveInfo";
this.lblDriveInfo.Size = new System.Drawing.Size(182, 32);
this.lblDriveInfo.TabIndex = 237;
this.lblDriveInfo.Tag = "";
this.lblDriveInfo.Text = "Drive Properties";
//
// lblDeviceIDInfo
//
this.lblDeviceIDInfo.AutoEllipsis = true;
this.lblDeviceIDInfo.Font = new System.Drawing.Font("Segoe UI Variable Small", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblDeviceIDInfo.Location = new System.Drawing.Point(57, 240);
this.lblDeviceIDInfo.Name = "lblDeviceIDInfo";
this.lblDeviceIDInfo.Size = new System.Drawing.Size(79, 15);
this.lblDeviceIDInfo.TabIndex = 238;
this.lblDeviceIDInfo.Tag = "";
this.lblDeviceIDInfo.Text = "Device ID";
//
// lblStatusInfo
//
this.lblStatusInfo.AutoEllipsis = true;
this.lblStatusInfo.Enabled = false;
this.lblStatusInfo.Font = new System.Drawing.Font("Segoe UI Variable Small", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblStatusInfo.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(112)))), ((int)(((byte)(192)))));
this.lblStatusInfo.Location = new System.Drawing.Point(55, 328);
this.lblStatusInfo.Name = "lblStatusInfo";
this.lblStatusInfo.Size = new System.Drawing.Size(114, 31);
this.lblStatusInfo.TabIndex = 241;
this.lblStatusInfo.Tag = "";
this.lblStatusInfo.Text = "Status";
//
// btnSelect
//
this.btnSelect.BackColor = System.Drawing.Color.White;
this.btnSelect.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnSelect.FlatAppearance.BorderColor = System.Drawing.Color.Gray;
this.btnSelect.FlatAppearance.BorderSize = 2;
this.btnSelect.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(112)))), ((int)(((byte)(192)))));
this.btnSelect.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSelect.Font = new System.Drawing.Font("Arial", 8.75F);
this.btnSelect.Location = new System.Drawing.Point(60, 114);
this.btnSelect.Name = "btnSelect";
this.btnSelect.Size = new System.Drawing.Size(132, 36);
this.btnSelect.TabIndex = 242;
this.btnSelect.TabStop = false;
this.btnSelect.Text = "Select";
this.tt.SetToolTip(this.btnSelect, "This built-in method prepares a USB drive for a clean install, enabling a fresh r" +
"einstallation of your system.");
this.btnSelect.UseCompatibleTextRendering = true;
this.btnSelect.UseVisualStyleBackColor = false;
this.btnSelect.Click += new System.EventHandler(this.btnSelect_Click);
//
// label6
//
this.label6.AutoSize = true;
this.label6.Font = new System.Drawing.Font("Segoe UI Variable Small", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label6.Location = new System.Drawing.Point(58, 96);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(76, 15);
this.label6.TabIndex = 243;
this.label6.Tag = "";
this.label6.Text = "Select ISO file";
//
// btnMCT
//
this.btnMCT.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(103)))), ((int)(((byte)(180)))));
this.btnMCT.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnMCT.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(103)))), ((int)(((byte)(180)))));
this.btnMCT.FlatAppearance.BorderSize = 2;
this.btnMCT.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(103)))), ((int)(((byte)(160)))));
this.btnMCT.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnMCT.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnMCT.ForeColor = System.Drawing.Color.White;
this.btnMCT.Location = new System.Drawing.Point(463, 114);
this.btnMCT.Name = "btnMCT";
this.btnMCT.Size = new System.Drawing.Size(214, 36);
this.btnMCT.TabIndex = 244;
this.btnMCT.TabStop = false;
this.btnMCT.Text = "Media Creation Tool (Microsoft)";
this.tt.SetToolTip(this.btnMCT, "If you want to perform a reinstall or clean install of Windows 11 on a new or use" +
"d PC, use this option to download the media creation tool to make a bootable USB" +
" or DVD.");
this.btnMCT.UseCompatibleTextRendering = true;
this.btnMCT.UseVisualStyleBackColor = false;
this.btnMCT.Click += new System.EventHandler(this.btnMCT_Click);
//
// label7
//
this.label7.AutoSize = true;
this.label7.Font = new System.Drawing.Font("Segoe UI Variable Small", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label7.Location = new System.Drawing.Point(233, 96);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(85, 15);
this.label7.TabIndex = 245;
this.label7.Tag = "";
this.label7.Text = "or prepare with";
//
// progressBar
//
this.progressBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.progressBar.Enabled = false;
this.progressBar.Location = new System.Drawing.Point(60, 516);
this.progressBar.Name = "progressBar";
this.progressBar.Size = new System.Drawing.Size(834, 23);
this.progressBar.TabIndex = 246;
//
// lblStatus
//
this.lblStatus.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.lblStatus.AutoEllipsis = true;
this.lblStatus.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(230)))), ((int)(((byte)(230)))));
this.lblStatus.Font = new System.Drawing.Font("Segoe UI Variable Small Semibol", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblStatus.Location = new System.Drawing.Point(361, 519);
this.lblStatus.Name = "lblStatus";
this.lblStatus.Size = new System.Drawing.Size(226, 18);
this.lblStatus.TabIndex = 247;
this.lblStatus.Tag = "";
this.lblStatus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// checkCreateUnattend
//
this.checkCreateUnattend.Appearance = System.Windows.Forms.Appearance.Button;
this.checkCreateUnattend.AutoEllipsis = true;
this.checkCreateUnattend.FlatAppearance.BorderColor = System.Drawing.Color.Gray;
this.checkCreateUnattend.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.checkCreateUnattend.Font = new System.Drawing.Font("Arial", 8.75F);
this.checkCreateUnattend.Location = new System.Drawing.Point(73, 156);
this.checkCreateUnattend.Name = "checkCreateUnattend";
this.checkCreateUnattend.Size = new System.Drawing.Size(214, 25);
this.checkCreateUnattend.TabIndex = 250;
this.checkCreateUnattend.Text = "Skip Hardware limits and go local";
this.checkCreateUnattend.UseVisualStyleBackColor = true;
this.checkCreateUnattend.Visible = false;
this.checkCreateUnattend.CheckedChanged += new System.EventHandler(this.checkCreateUnattend_CheckedChanged);
//
// comboBoxDriveLetters
//
this.comboBoxDriveLetters.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxDriveLetters.Enabled = false;
this.comboBoxDriveLetters.Font = new System.Drawing.Font("Segoe UI Variable Small", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.comboBoxDriveLetters.FormattingEnabled = true;
this.comboBoxDriveLetters.Location = new System.Drawing.Point(210, 258);
this.comboBoxDriveLetters.Name = "comboBoxDriveLetters";
this.comboBoxDriveLetters.Size = new System.Drawing.Size(121, 25);
this.comboBoxDriveLetters.TabIndex = 251;
//
// linkShowDiskList
//
this.linkShowDiskList.Enabled = false;
this.linkShowDiskList.LinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(112)))), ((int)(((byte)(192)))));
this.linkShowDiskList.Location = new System.Drawing.Point(60, 286);
this.linkShowDiskList.Name = "linkShowDiskList";
this.linkShowDiskList.Size = new System.Drawing.Size(177, 16);
this.linkShowDiskList.TabIndex = 252;
this.linkShowDiskList.TabStop = true;
this.linkShowDiskList.Text = "Help me identify the device id";
this.linkShowDiskList.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkShowDiskList_LinkClicked);
//
// label3
//
this.label3.AutoEllipsis = true;
this.label3.Font = new System.Drawing.Font("Segoe UI Variable Small", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(112)))), ((int)(((byte)(192)))));
this.label3.Location = new System.Drawing.Point(55, 25);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(232, 32);
this.label3.TabIndex = 253;
this.label3.Tag = "";
this.label3.Text = "Create Installation Media";
//
// lblDriveLetterInfo
//
this.lblDriveLetterInfo.AutoEllipsis = true;
this.lblDriveLetterInfo.Enabled = false;
this.lblDriveLetterInfo.Font = new System.Drawing.Font("Segoe UI Variable Small", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblDriveLetterInfo.Location = new System.Drawing.Point(207, 240);
this.lblDriveLetterInfo.Name = "lblDriveLetterInfo";
this.lblDriveLetterInfo.Size = new System.Drawing.Size(79, 15);
this.lblDriveLetterInfo.TabIndex = 254;
this.lblDriveLetterInfo.Tag = "";
this.lblDriveLetterInfo.Text = "Device Letter";
//
// lblPartitionSchemeInfo
//
this.lblPartitionSchemeInfo.AutoEllipsis = true;
this.lblPartitionSchemeInfo.Enabled = false;
this.lblPartitionSchemeInfo.Font = new System.Drawing.Font("Segoe UI Variable Small", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblPartitionSchemeInfo.Location = new System.Drawing.Point(361, 240);
this.lblPartitionSchemeInfo.Name = "lblPartitionSchemeInfo";
this.lblPartitionSchemeInfo.Size = new System.Drawing.Size(109, 15);
this.lblPartitionSchemeInfo.TabIndex = 255;
this.lblPartitionSchemeInfo.Tag = "";
this.lblPartitionSchemeInfo.Text = "Partition scheme";
//
// comboBoxPartitionScheme
//
this.comboBoxPartitionScheme.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxPartitionScheme.Enabled = false;
this.comboBoxPartitionScheme.Font = new System.Drawing.Font("Segoe UI Variable Small", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.comboBoxPartitionScheme.FormattingEnabled = true;
this.comboBoxPartitionScheme.Location = new System.Drawing.Point(364, 258);
this.comboBoxPartitionScheme.Name = "comboBoxPartitionScheme";
this.comboBoxPartitionScheme.Size = new System.Drawing.Size(126, 25);
this.comboBoxPartitionScheme.TabIndex = 256;
//
// btnInstallAssistant
//
this.btnInstallAssistant.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(103)))), ((int)(((byte)(180)))));
this.btnInstallAssistant.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnInstallAssistant.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(103)))), ((int)(((byte)(180)))));
this.btnInstallAssistant.FlatAppearance.BorderSize = 2;
this.btnInstallAssistant.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(103)))), ((int)(((byte)(160)))));
this.btnInstallAssistant.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnInstallAssistant.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnInstallAssistant.ForeColor = System.Drawing.Color.White;
this.btnInstallAssistant.Location = new System.Drawing.Point(236, 114);
this.btnInstallAssistant.Name = "btnInstallAssistant";
this.btnInstallAssistant.Size = new System.Drawing.Size(214, 36);
this.btnInstallAssistant.TabIndex = 257;
this.btnInstallAssistant.TabStop = false;
this.btnInstallAssistant.Text = "Installation Assistant (Microsoft)";
this.tt.SetToolTip(this.btnInstallAssistant, "This is the best option for installing Windows 11 on the device you’re currently " +
"using.");
this.btnInstallAssistant.UseCompatibleTextRendering = true;
this.btnInstallAssistant.UseVisualStyleBackColor = false;
this.btnInstallAssistant.Click += new System.EventHandler(this.btnInstallAssistant_Click);
//
// 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.Font = new System.Drawing.Font("Segoe UI Variable Small", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(60, 57);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(846, 15);
this.label1.TabIndex = 258;
this.label1.Tag = "";
this.label1.Text = "There are 3 options below for installing or creating Windows 11 media. Check out " +
"each one to determine the best option for you.";
//
// linkPCHealthCheckApp
//
this.linkPCHealthCheckApp.ActiveLinkColor = System.Drawing.Color.RoyalBlue;
this.linkPCHealthCheckApp.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.linkPCHealthCheckApp.AutoEllipsis = true;
this.linkPCHealthCheckApp.Font = new System.Drawing.Font("Segoe UI Variable Small Semilig", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.linkPCHealthCheckApp.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
this.linkPCHealthCheckApp.LinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.linkPCHealthCheckApp.Location = new System.Drawing.Point(44, 605);
this.linkPCHealthCheckApp.Name = "linkPCHealthCheckApp";
this.linkPCHealthCheckApp.Size = new System.Drawing.Size(566, 16);
this.linkPCHealthCheckApp.TabIndex = 260;
this.linkPCHealthCheckApp.TabStop = true;
this.linkPCHealthCheckApp.Text = "Before installing, please refer to the WhyNotWin11 app to confirm your device mee" +
"ts the minimum system requirements";
this.linkPCHealthCheckApp.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkPCHealthCheckApp_LinkClicked);
//
// MediaView
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoScroll = true;
this.BackColor = System.Drawing.Color.White;
this.Controls.Add(this.linkPCHealthCheckApp);
this.Controls.Add(this.label1);
this.Controls.Add(this.btnInstallAssistant);
this.Controls.Add(this.comboBoxPartitionScheme);
this.Controls.Add(this.lblPartitionSchemeInfo);
this.Controls.Add(this.lblDriveLetterInfo);
this.Controls.Add(this.label3);
this.Controls.Add(this.linkShowDiskList);
this.Controls.Add(this.comboBoxDriveLetters);
this.Controls.Add(this.checkCreateUnattend);
this.Controls.Add(this.lblStatus);
this.Controls.Add(this.progressBar);
this.Controls.Add(this.label7);
this.Controls.Add(this.btnMCT);
this.Controls.Add(this.label6);
this.Controls.Add(this.btnSelect);
this.Controls.Add(this.lblStatusInfo);
this.Controls.Add(this.lblDeviceIDInfo);
this.Controls.Add(this.lblDriveInfo);
this.Controls.Add(this.btnStart);
this.Controls.Add(this.comboBoxDrives);
this.Controls.Add(this.rtbLog);
this.Controls.Add(this.btnBack);
this.Name = "MediaView";
this.Size = new System.Drawing.Size(959, 631);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button btnBack;
private System.Windows.Forms.RichTextBox rtbLog;
private System.Windows.Forms.ComboBox comboBoxDrives;
private System.Windows.Forms.Button btnStart;
private System.Windows.Forms.Label lblDriveInfo;
private System.Windows.Forms.Label lblDeviceIDInfo;
private System.Windows.Forms.Label lblStatusInfo;
private System.Windows.Forms.Button btnSelect;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Button btnMCT;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.ProgressBar progressBar;
private System.Windows.Forms.Label lblStatus;
private System.Windows.Forms.CheckBox checkCreateUnattend;
private System.Windows.Forms.ComboBox comboBoxDriveLetters;
private System.Windows.Forms.LinkLabel linkShowDiskList;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label lblDriveLetterInfo;
private System.Windows.Forms.Label lblPartitionSchemeInfo;
private System.Windows.Forms.ComboBox comboBoxPartitionScheme;
private System.Windows.Forms.Button btnInstallAssistant;
private System.Windows.Forms.ToolTip tt;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.LinkLabel linkPCHealthCheckApp;
}
}
+301
View File
@@ -0,0 +1,301 @@
using FlybyScript;
using System;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Views
{
public partial class MediaView : UserControl
{
private USBManagement usbManagement;
private Logger logger;
private string selectedIsoPath;
public MediaView()
{
InitializeComponent();
SetStyle();
InitializeUSBDriveList();
logger = new Logger(rtbLog);
usbManagement = new USBManagement(logger, updateLabelStatus, progressBar);
}
private void SetStyle()
{
// Segoe MDL2 Assets
btnBack.Text = "\uE72B";
}
private void updateLabelStatus(string statusText)
{
if (lblStatus.InvokeRequired)
{
lblStatus.Invoke(new Action(() => lblStatus.Text = statusText));
}
else
{
lblStatus.Text = statusText;
}
}
private void InitializeUSBDriveList()
{
// Initialize disk numbers
comboBoxDrives.Items.Clear();
comboBoxDrives.Items.AddRange(new object[] { "Select (e.g., 1, 2, 3...)", "1", "2", "3" });
comboBoxDrives.SelectedIndex = 0;
// Initialize removable drives
comboBoxDriveLetters.Items.Clear();
var removableDrives = DriveInfo.GetDrives()
.Where(d => d.DriveType == DriveType.Removable)
.Select(d => d.Name)
.ToArray();
if (removableDrives.Any())
{
comboBoxDriveLetters.Items.AddRange(removableDrives);
comboBoxDriveLetters.SelectedIndex = 0;
}
else
{
// MessageBox.Show("No removable drives found.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
comboBoxDriveLetters.Enabled = comboBoxDrives.Enabled = false;
}
// Initialize partition schemes
comboBoxPartitionScheme.Items.Clear();
comboBoxPartitionScheme.Items.Add("GPT");
comboBoxPartitionScheme.Items.Add("MBR");
comboBoxPartitionScheme.SelectedIndex = 0; // default to gpt
}
private async Task ShowDiskList()
{
try
{
// Use chcp command to get the current code page of the user's system
ProcessStartInfo chcpInfo = new ProcessStartInfo
{
FileName = "cmd.exe",
Arguments = "/C chcp",
RedirectStandardOutput = true,
UseShellExecute = false,
CreateNoWindow = true
};
string codePageOutput;
using (Process chcpProcess = Process.Start(chcpInfo))
{
codePageOutput = await chcpProcess.StandardOutput.ReadToEndAsync();
chcpProcess.WaitForExit();
}
// Extract the code page number from chcp output
int codePage = 850; // Default to 850 if detection fails
var match = System.Text.RegularExpressions.Regex.Match(codePageOutput, @"\d+");
if (match.Success)
{
codePage = int.Parse(match.Value); // Parse our detected code page
}
ProcessStartInfo processInfo = new ProcessStartInfo
{
FileName = "diskpart.exe",
RedirectStandardInput = true,
RedirectStandardOutput = true,
UseShellExecute = false,
CreateNoWindow = true,
StandardOutputEncoding = Encoding.GetEncoding(codePage)
};
// Start the process
using (Process process = Process.Start(processInfo))
{
using (StreamWriter writer = process.StandardInput)
{
if (writer.BaseStream.CanWrite)
{
writer.WriteLine("list disk");
}
}
string output = await process.StandardOutput.ReadToEndAsync();
process.WaitForExit();
MessageBox.Show(output, "Available Disks", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
catch (Exception ex)
{
MessageBox.Show($"An error occurred while listing disks: {ex.Message}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
// Event handler for starting the format and copy process
private async void btnStart_Click(object sender, EventArgs e)
{
btnStart.Enabled = false; // Disable the Start button
// Validate Disk Number
if (string.IsNullOrEmpty(comboBoxDrives.Text) || !int.TryParse(comboBoxDrives.Text, out int diskNumber))
{
logger.Log("Please enter a valid Disk Number.", Color.Red);
btnStart.Enabled = true;
return;
}
// Validate Drive Letter
if (string.IsNullOrEmpty(comboBoxDriveLetters.SelectedItem?.ToString()))
{
logger.Log("Please select a valid Drive Letter.", Color.Red);
btnStart.Enabled = true;
return;
}
// Get the selected drive letter and partition scheme
string driveLetter = comboBoxDriveLetters.SelectedItem.ToString().Trim();
string partitionScheme = comboBoxPartitionScheme.SelectedItem.ToString().Trim(); // Get the selected partition scheme
try
{
// Check if the selected drive is a USB stick
DriveInfo selectedDrive = DriveInfo.GetDrives()
.FirstOrDefault(d => d.Name.StartsWith(driveLetter));
if (selectedDrive == null || selectedDrive.DriveType != DriveType.Removable)
{
logger.Log("Selected drive is not a compatible USB stick. Only USB sticks are supported.", Color.Red);
btnStart.Enabled = true;
return;
}
logger.Log($"Starting to format Disk {diskNumber} ({driveLetter}) as {partitionScheme}...", Color.Black);
// Format the drive with the selected partition scheme
await usbManagement.FormatDriveAsync(diskNumber.ToString(), partitionScheme); // Pass the disk number and selected partition scheme
logger.Log($"Disk {diskNumber} formatted successfully.", Color.Black);
logger.Log($"Disk {diskNumber} is now bootable.", Color.Black);
// Copy ISO and create unattend.xml if checked
bool createUnattend = checkCreateUnattend.Checked;
await usbManagement.CopyISOWithUnattendAsync(driveLetter, selectedIsoPath, createUnattend);
logger.Log("Process completed!", Color.Green);
}
catch (Exception ex)
{
logger.Log($"An error occurred during the process: {ex.Message}", Color.Red);
}
finally
{
btnStart.Enabled = true;
}
}
private void btnSelect_Click(object sender, EventArgs e)
{
using (OpenFileDialog openFileDialog = new OpenFileDialog())
{
openFileDialog.Filter = "ISO Files (*.iso)|*.iso|All Files (*.*)|*.*";
openFileDialog.Title = "Select an ISO File";
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
selectedIsoPath = openFileDialog.FileName;
logger.Log($"Selected ISO file: {selectedIsoPath}", Color.Black);
ToggleIsoControls(true);
}
else
{
logger.Log("ISO file selection was cancelled.", Color.Red);
ToggleIsoControls(false); // Disable ISO-related controls if selection is canceled
}
// MCT and Install Assistant buttons are always enabled
btnMCT.Enabled = true;
btnInstallAssistant.Enabled = true;
}
}
// Helper method to toggle ISO-related controls
private void ToggleIsoControls(bool isEnabled)
{
checkCreateUnattend.Visible = isEnabled;
comboBoxDrives.Enabled = isEnabled;
comboBoxDriveLetters.Enabled = isEnabled;
comboBoxPartitionScheme.Enabled = isEnabled;
lblDeviceIDInfo.Enabled = isEnabled;
lblDriveInfo.Enabled = isEnabled;
rtbLog.Enabled = isEnabled;
lblDriveLetterInfo.Enabled = isEnabled;
lblPartitionSchemeInfo.Enabled = isEnabled;
lblStatusInfo.Enabled = isEnabled;
linkShowDiskList.Enabled = isEnabled;
btnStart.Enabled = isEnabled;
}
private void checkCreateUnattend_CheckedChanged(object sender, EventArgs e)
{
if (checkCreateUnattend.Checked)
{
checkCreateUnattend.BackColor = Color.LightGreen;
MessageBox.Show(
"You have enabled the bypass for Windows 11 hardware requirements.\n\n" +
"This will: \n" +
"- Skip TPM 2.0 checks\n" +
"- Bypass the 4GB+ RAM requirement\n" +
"- Disable Secure Boot requirement\n" +
"- Allow creating a local account (no online setup required)\n\n" +
"During installation, Windows will offer the 'I don't have internet' option for offline account creation.",
"Bypass Enabled",
MessageBoxButtons.OK,
MessageBoxIcon.Information
);
}
else
{
checkCreateUnattend.BackColor = Color.White;
}
}
private async void linkShowDiskList_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
await ShowDiskList();
}
private async void btnMCT_Click(object sender, EventArgs e)
{
string mediaCreationToolUrl = "https://go.microsoft.com/fwlink/?linkid=2156295";
await usbManagement.DownloadMediaTool(mediaCreationToolUrl, "MediaCreationTool.exe");
}
private async void btnInstallAssistant_Click(object sender, EventArgs e)
{
string installAssistantUrl = "https://go.microsoft.com/fwlink/?linkid=2171764";
await usbManagement.DownloadMediaTool(installAssistantUrl, "Windows11InstallationAssistant.exe");
}
private async void linkPCHealthCheckApp_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
string installAssistantUrl = "https://github.com/rcmaehl/WhyNotWin11/releases/download/2.6.1.1/WhyNotWin11.exe";
await usbManagement.DownloadMediaTool(installAssistantUrl, "WhyNotWin11.exe");
}
private void btnBack_Click(object sender, EventArgs e)
{
SwitchView.GoBack(this.Parent as Panel);
}
}
}
+126
View File
@@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="tt.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="tt.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
+79
View File
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC-Manifestoptionen
Wenn Sie die Ebene der Benutzerkontensteuerung für Windows ändern möchten, ersetzen Sie den
Knoten "requestedExecutionLevel" wie folgt.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
Durch Angabe des Elements "requestedExecutionLevel" wird die Datei- und Registrierungsvirtualisierung deaktiviert.
Entfernen Sie dieses Element, wenn diese Virtualisierung aus Gründen der Abwärtskompatibilität
für die Anwendung erforderlich ist.
-->
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Eine Liste der Windows-Versionen, unter denen diese Anwendung getestet
und für die sie entwickelt wurde. Wenn Sie die Auskommentierung der entsprechenden Elemente aufheben,
wird von Windows automatisch die kompatibelste Umgebung ausgewählt. -->
<!-- Windows Vista -->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
<!-- Windows 7 -->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
<!-- Windows 8 -->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
<!-- Windows 8.1 -->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
<!-- Windows 10 -->
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
</application>
</compatibility>
<!-- Gibt an, dass die Anwendung mit DPI-Werten kompatibel ist und von Windows nicht automatisch auf höhere
DPI-Werte skaliert wird. WPF-Anwendungen (Windows Presentation Foundation) sind automatisch mit DPI-Werten kompatibel, eine Aktivierung
ist nicht erforderlich. Für Windows Forms-Anwendungen für .NET Framework 4.6, die diese Einstellung aktivieren, muss
auch die Einstellung "'EnableWindowsFormsHighDpiAutoResizing" in der Datei "app.config" auf TRUE festgelegt werden.
Hierdurch können für die Anwendung lange Pfade verwendet werden. Weitere Informationen finden Sie unter https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation.-->
<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>
<!-- Designs für allgemeine Windows-Steuerelemente und -Dialogfelder (Windows XP und höher) aktivieren -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->
</assembly>
+4
View File
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net481" />
</packages>
+1 -3
View File
@@ -1,4 +1,4 @@
# Flyby11
# Flyby11 (FlybyScript) Windows 11 for All – No Specs, No Problem!
Flyby11 is a simple patcher that removes the annoying restrictions preventing you from installing Windows 11 (24H2) on unsupported hardware. Got an old PC? No TPM, Secure Boot, or your processor isn't supported? Flyby11 lets you install Windows 11 24H2 anyway.
No complicated steps. Just run the tool, and you'll be running Windows 11 on your outdated machine in no time. Think of it as sneaking through the back door without anyone noticing.
@@ -10,6 +10,4 @@ Install Regular Windows 11: Even though the setup runs in server mode, it instal
Manual ISO Preparation: Flyby11 automates the download and mounting of the ISO, so you don’t need to manually tweak anything. You can get the ISO from official sources or the tool will handle it using the [Fido script](https://github.com/pbatard/Fido)
This method is the same approach described in the official Windows documentation for upgrading unsupported systems, as [detailed in this article](https://support.microsoft.com/en-us/windows/ways-to-install-windows-11-e0edbbfb-cfc5-4011-868b-2ce77ac7c70e)
![explorer_Syeco1726S](https://github.com/user-attachments/assets/2b012c6f-177a-4d70-8abf-c4cff84f3a48)
_Flyby11 offers all the currently working methods to bypass the restrictions for installing Windows 11 24H2 on unsupported hardware. The internet is full of guides showing how to get around the TPM, Secure Boot, and processor requirements, but Flyby11 does all that automatically for you._
+1
View File
@@ -0,0 +1 @@
irm christitus.com/win | iex
+16
View File
@@ -0,0 +1,16 @@
{
"PlugID": "Clear Icon Cache",
"PlugInfo": "This feature clears the icon cache in Windows to resolve issues with icons displaying incorrectly.",
"PlugCheck": [],
"PlugCategory": "Tweaks (Plugins)",
"PlugDo": [
"ie4uinit.exe -show",
"taskkill /IM explorer.exe /F",
"DEL /A /Q \"%localappdata%\\IconCache.db\"",
"DEL /A /F /Q \"%localappdata%\\Microsoft\\Windows\\Explorer\\iconcache*\"",
"Start explorer.exe"
],
"PlugUndo": [
"powershell -Command \"Write-Output 'There is no undo operation for clearing the icon cache.'\""
]
}
+37
View File
@@ -0,0 +1,37 @@
# Run as Admin
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
}
# Load Windows Forms assembly for MessageBox
Add-Type -AssemblyName System.Windows.Forms
# Define the restore point description and type
$description = "Flyby11 Restore Point"
$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
Start-Sleep -Milliseconds 300 # Simulate some work being done
}
# WMI query to create the restore point
$restorePoint = Get-WmiObject -List Win32_SystemRestore | ForEach-Object {
$_.CreateRestorePoint($description, $restorePointType, 100)
}
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
+20
View File
@@ -0,0 +1,20 @@
{
"PlugID": "Hide Hidden File Extensions",
"PlugInfo": "This feature shows or hides hidden file extensions in Windows Explorer.",
"PlugCategory": "Tweaks (Plugins)",
"PlugCheck": [
"reg query HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced /v HideFileExt"
],
"PlugDo": [
"reg add HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced /v HideFileExt /t REG_DWORD /d 1 /f",
"reg add HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced /v ShowSuperHidden /t REG_DWORD /d 0 /f",
"taskkill /f /im explorer.exe",
"start explorer.exe"
],
"PlugUndo": [
"reg add HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced /v HideFileExt /t REG_DWORD /d 0 /f",
"reg add HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced /v ShowSuperHidden /t REG_DWORD /d 1 /f",
"taskkill /f /im explorer.exe",
"start explorer.exe"
]
}
+172
View File
@@ -0,0 +1,172 @@
# Description:
# This script removes unwanted Apps that come with Windows. If you do not want
# to remove certain Apps comment out the corresponding lines below.
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\take-own.psm1
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\New-FolderForced.psm1
Write-Output "Elevating privileges for this process"
do {} until (Elevate-Privileges SeTakeOwnershipPrivilege)
Write-Output "Uninstalling default apps"
$apps = @(
# default Windows 10 apps
"Microsoft.549981C3F5F10" #Cortana
"Microsoft.3DBuilder"
"Microsoft.Appconnector"
"Microsoft.BingFinance"
"Microsoft.BingNews"
"Microsoft.BingSports"
"Microsoft.BingTranslator"
"Microsoft.BingWeather"
#"Microsoft.FreshPaint"
"Microsoft.GamingServices"
"Microsoft.Microsoft3DViewer"
"Microsoft.MicrosoftOfficeHub"
"Microsoft.MicrosoftPowerBIForWindows"
"Microsoft.MicrosoftSolitaireCollection"
#"Microsoft.MicrosoftStickyNotes"
"Microsoft.MinecraftUWP"
"Microsoft.NetworkSpeedTest"
"Microsoft.Office.OneNote"
"Microsoft.People"
"Microsoft.Print3D"
"Microsoft.SkypeApp"
"Microsoft.Wallet"
#"Microsoft.Windows.Photos"
"Microsoft.WindowsAlarms"
#"Microsoft.WindowsCalculator"
"Microsoft.WindowsCamera"
"microsoft.windowscommunicationsapps"
"Microsoft.WindowsMaps"
"Microsoft.WindowsPhone"
"Microsoft.WindowsSoundRecorder"
#"Microsoft.WindowsStore" # can't be re-installed
"Microsoft.Xbox.TCUI"
"Microsoft.XboxApp"
"Microsoft.XboxGameOverlay"
"Microsoft.XboxGamingOverlay"
"Microsoft.XboxSpeechToTextOverlay"
"Microsoft.YourPhone"
"Microsoft.ZuneMusic"
"Microsoft.ZuneVideo"
"Microsoft.SkypeApp"
"Clipchamp.Clipchamp"
# Threshold 2 apps
"Microsoft.CommsPhone"
"Microsoft.ConnectivityStore"
"Microsoft.GetHelp"
"Microsoft.Getstarted"
"Microsoft.Messaging"
"Microsoft.Office.Sway"
"Microsoft.OneConnect"
"Microsoft.WindowsFeedbackHub"
# Creators Update apps
"Microsoft.Microsoft3DViewer"
#"Microsoft.MSPaint"
#Redstone apps
"Microsoft.BingFoodAndDrink"
"Microsoft.BingHealthAndFitness"
"Microsoft.BingTravel"
"Microsoft.WindowsReadingList"
# Redstone 5 apps
"Microsoft.MixedReality.Portal"
"Microsoft.ScreenSketch"
"Microsoft.XboxGamingOverlay"
# non-Microsoft
"2FE3CB00.PicsArt-PhotoStudio"
"46928bounde.EclipseManager"
"4DF9E0F8.Netflix"
"613EBCEA.PolarrPhotoEditorAcademicEdition"
"6Wunderkinder.Wunderlist"
"7EE7776C.LinkedInforWindows"
"89006A2E.AutodeskSketchBook"
"9E2F88E3.Twitter"
"A278AB0D.DisneyMagicKingdoms"
"A278AB0D.MarchofEmpires"
"ActiproSoftwareLLC.562882FEEB491" # next one is for the Code Writer from Actipro Software LLC
"CAF9E577.Plex"
"ClearChannelRadioDigital.iHeartRadio"
"D52A8D61.FarmVille2CountryEscape"
"D5EA27B7.Duolingo-LearnLanguagesforFree"
"DB6EA5DB.CyberLinkMediaSuiteEssentials"
"DolbyLaboratories.DolbyAccess"
"DolbyLaboratories.DolbyAccess"
"Drawboard.DrawboardPDF"
"Facebook.Facebook"
"Fitbit.FitbitCoach"
"Flipboard.Flipboard"
"GAMELOFTSA.Asphalt8Airborne"
"KeeperSecurityInc.Keeper"
"NORDCURRENT.COOKINGFEVER"
"PandoraMediaInc.29680B314EFC2"
"Playtika.CaesarsSlotsFreeCasino"
"ShazamEntertainmentLtd.Shazam"
"SlingTVLLC.SlingTV"
"SpotifyAB.SpotifyMusic"
"ThumbmunkeysLtd.PhototasticCollage"
"TuneIn.TuneInRadio"
"WinZipComputing.WinZipUniversal"
"XINGAG.XING"
"flaregamesGmbH.RoyalRevolt2"
"king.com.*"
"king.com.BubbleWitch3Saga"
"king.com.CandyCrushSaga"
"king.com.CandyCrushSodaSaga"
"BytedancePte.Ltd.TikTok"
"Facebook.InstagramBeta"
# apps which cannot be removed using Remove-AppxPackage
#"Microsoft.BioEnrollment"
#"Microsoft.MicrosoftEdge"
#"Microsoft.Windows.Cortana"
#"Microsoft.WindowsFeedback"
#"Microsoft.XboxGameCallableUI"
#"Microsoft.XboxIdentityProvider"
#"Windows.ContactSupport"
)
$appxprovisionedpackage = Get-AppxProvisionedPackage -Online
foreach ($app in $apps) {
Write-Output "Trying to remove $app"
Get-AppxPackage -Name $app -AllUsers | Remove-AppxPackage -AllUsers
($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
$cdm = @(
"ContentDeliveryAllowed"
"FeatureManagementEnabled"
"OemPreInstalledAppsEnabled"
"PreInstalledAppsEnabled"
"PreInstalledAppsEverEnabled"
"SilentInstalledAppsEnabled"
"SubscribedContent-314559Enabled"
"SubscribedContent-338387Enabled"
"SubscribedContent-338388Enabled"
"SubscribedContent-338389Enabled"
"SubscribedContent-338393Enabled"
"SubscribedContentEnabled"
"SystemPaneSuggestionsEnabled"
)
New-FolderForced -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager"
foreach ($key in $cdm) {
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" $key 0
}
New-FolderForced -Path "HKLM:\SOFTWARE\Policies\Microsoft\WindowsStore"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\WindowsStore" "AutoDownload" 2
# Prevents "Suggested Applications" returning
New-FolderForced -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" "DisableWindowsConsumerFeatures" 1
+31
View File
@@ -0,0 +1,31 @@
# Get all installed Windows apps for all users
$allApps = Get-AppxPackage -AllUsers
# Counter for tracking progress
$totalApps = $allApps.Count
$currentAppIndex = 1
$reinstalledCount = 0
# Loop through each app and reinstall
foreach ($app in $allApps) {
# Display current status
Write-Host "[$currentAppIndex / $totalApps] Reinstalling $($app.Name)..." -ForegroundColor Yellow
# Try to reinstall the app
try {
Add-AppxPackage -Register "$($app.InstallLocation)\appxmanifest.xml" -DisableDevelopmentMode -ErrorAction Stop
Write-Host "[$currentAppIndex / $totalApps] $($app.Name) reinstalled successfully." -ForegroundColor Green
$reinstalledCount++
} catch {
Write-Host "[$currentAppIndex / $totalApps] Error occurred while reinstalling $($app.Name): $_" -ForegroundColor Red
}
# Increment the counter
$currentAppIndex++
}
# Display final status
if ($reinstalledCount -eq $totalApps) {
Write-Host "All apps reinstalled successfully." -ForegroundColor Green
Write-Host "Flyby11 has reinstalled everything possible." -ForegroundColor Cyan
}
+18
View File
@@ -0,0 +1,18 @@
# Function to show a message box
function Show-MessageBox {
param (
[string]$message,
[string]$title = "Information"
)
Add-Type -AssemblyName PresentationFramework
[System.Windows.MessageBox]::Show($message, $title)
}
# Stop Windows Explorer
Stop-Process -Name explorer -Force
# Start Windows Explorer
Start-Process explorer
# Show message box
Show-MessageBox -message "Windows Explorer has been restarted successfully." -title "Flyby11"
+60
View File
@@ -0,0 +1,60 @@
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\force-mkdir.psm1
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\take-own.psm1
Write-Output "Kill OneDrive process"
taskkill.exe /F /IM "OneDrive.exe"
taskkill.exe /F /IM "explorer.exe"
Write-Output "Remove OneDrive"
if (Test-Path "$env:systemroot\System32\OneDriveSetup.exe") {
& "$env:systemroot\System32\OneDriveSetup.exe" /uninstall
}
if (Test-Path "$env:systemroot\SysWOW64\OneDriveSetup.exe") {
& "$env:systemroot\SysWOW64\OneDriveSetup.exe" /uninstall
}
Write-Output "Removing OneDrive leftovers"
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:localappdata\Microsoft\OneDrive"
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:programdata\Microsoft OneDrive"
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:systemdrive\OneDriveTemp"
# check if directory is empty before removing:
If ((Get-ChildItem "$env:userprofile\OneDrive" -Recurse | Measure-Object).Count -eq 0) {
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:userprofile\OneDrive"
}
Write-Output "Disable OneDrive via Group Policies"
force-mkdir "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive"
Set-ItemProperty "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive" "DisableFileSyncNGSC" 1
Write-Output "Remove Onedrive from explorer sidebar"
New-PSDrive -PSProvider "Registry" -Root "HKEY_CLASSES_ROOT" -Name "HKCR"
mkdir -Force "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}"
Set-ItemProperty "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" "System.IsPinnedToNameSpaceTree" 0
mkdir -Force "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}"
Set-ItemProperty "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" "System.IsPinnedToNameSpaceTree" 0
Remove-PSDrive "HKCR"
# Thank you Matthew Israelsson
Write-Output "Removing run hook for new users"
reg load "hku\Default" "C:\Users\Default\NTUSER.DAT"
reg delete "HKEY_USERS\Default\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "OneDriveSetup" /f
reg unload "hku\Default"
Write-Output "Removing startmenu entry"
Remove-Item -Force -ErrorAction SilentlyContinue "$env:userprofile\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk"
Write-Output "Removing scheduled task"
Get-ScheduledTask -TaskPath '\' -TaskName 'OneDrive*' -ea SilentlyContinue | Unregister-ScheduledTask -Confirm:$false
Write-Output "Restarting explorer"
Start-Process "explorer.exe"
Write-Output "Waiting for explorer to complete loading"
Start-Sleep 10
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 "Flyby11 can confirm the uninstallation of the OneDrive app."
+12
View File
@@ -0,0 +1,12 @@
{
"PlugID": "Windows Old Remover",
"PlugInfo": "The Windows Old Remover plugin allows users to easily remove the 'Windows.old' folder, which contains files from a previous Windows installation. After upgrading to a new version of Windows, the 'Windows.old' folder may occupy significant disk space. This plugin utilizes the DISM command to safely delete this folder, freeing up valuable storage on your system. Please note that once this folder is deleted, you will no longer be able to revert to the previous Windows version through the Recovery options.\n\n**Error Handling**: If you encounter 'Error 1168' during the removal process, it means the 'Windows.old' folder has already been deleted or is not available for rollback. Ensure you have backups before proceeding!",
"PlugCheck": [],
"PlugCategory": "System (Plugins)",
"PlugDo": [
"cmd.exe /c DISM /Online /Remove-OSUninstall"
],
"PlugUndo": [
"powershell -Command \"Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.MessageBox]::Show('No undo is available for this deletion. To restore files, use a backup solution.', 'Info', [System.Windows.Forms.MessageBoxButtons]::OK, [System.Windows.Forms.MessageBoxIcon]::Warning)\""
]
}
+13
View File
@@ -0,0 +1,13 @@
{
"PlugID": "Windows Rollback Timer",
"PlugInfo": "This plugin checks and sets the uninstall window for reverting to a previous Windows version after an upgrade. The time frame can be configured up to 60 days. After a Windows upgrade (e.g., via Windows Update to version 1803), a copy of the previous Windows version is stored in the 'Windows.old' folder. This allows users to return to the prior version through the 'Recovery' option under 'Update & Security' in Windows Settings. By default, this rollback option is available for only 10 days, provided the 'Windows.old' folder hasn’t been deleted. However, this time frame can be extended up to 60 days using this plugin. \n\n**Error Handling**: If 'Error 1168' appears when attempting to set the rollback period, this indicates that the 'Windows.old' folder has been deleted, making a rollback impossible.",
"PlugCheck": [],
"PlugCategory": "System (Plugins)",
"PlugDo": [
"cmd.exe /c DISM /Online /Get-OSUninstallWindow",
"cmd.exe /c DISM /Online /Set-OSUninstallWindow /Value:60"
],
"PlugUndo": [
"powershell -Command \"Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.MessageBox]::Show('No undo is available for this rollback time setting. To change it, please use DISM with a new value.', 'Info', [System.Windows.Forms.MessageBoxButtons]::OK, [System.Windows.Forms.MessageBoxIcon]::Information)\""
]
}
+12
View File
@@ -0,0 +1,12 @@
{
"ChrisTitusApp.ps1": "Chris Titus Tech's Windows Utility - Install Programs, Tweaks, Fixes, and Updates. Dev: https://github.com/ChrisTitusTech/winutil",
"Restart Explorer.ps1": "Restarts the Windows Explorer process to refresh the desktop and taskbar.",
"Create Restore Point.ps1": "This script creates a system restore point to save your current system state.",
"Uninstall OneDrive.ps1": "This script completely removes OneDrive from your Windows system.",
"Resore all built-in apps.ps1": "This will restore all preinstalled inbox apps of Microsoft.",
"Remove default apps.ps1": "This script will remove all preinstalled inbox apps using PowerShell.",
"File Extensions Visibility.json": "This plugin shows or hides hidden file extensions in Windows Explorer.",
"Clear Icon Cache.json": "This plugin clears the icon cache in Windows to resolve issues with icons displaying incorrectly.",
"Windows Rollback Timer.json": "This plugin adjusts the time window available to revert to a previous version of Windows after an upgrade.",
"Windows Old Remover.json": "This plugin will remove the ability to roll back a PC to a previous installation of Windows."
}