now its open.....

This commit is contained in:
Belim 2023-02-22 14:30:10 +01:00
parent b910a2bad9
commit 95c4537280
15 changed files with 484 additions and 11 deletions

View File

@ -0,0 +1,41 @@
using System;
using System.Windows.Forms;
namespace BloatyNosy
{
internal class ErrorHelper
{
private static RichTextBox target = null;
// Errorlogger to target richLog
public void SetTarget(RichTextBox richText)
{
target = richText;
}
public void Log(string format, params object[] args)
{
format += "\r\n";
try
{
if (target.InvokeRequired)
{
target.Invoke(new Action(() =>
target.AppendText(string.Format(format, args))
));
}
else
{
target.AppendText(string.Format(format, args));
}
}
catch { }
}
public static ErrorHelper Instance
{
get => new ErrorHelper();
}
}
}

View File

@ -0,0 +1,99 @@
using BloatyNosy;
using System;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Windows.Forms;
namespace HelperTool
{
internal class Utils
{
private static readonly ErrorHelper logger = ErrorHelper.Instance;
public static readonly string TweetIntent = "https://twitter.com/intent/tweet?text=Try%20the%20new%20next%20Gen-Debloat%20App%20%23BloatyNosy%20for%20Windows%2011%0a%0ahttps://www.builtbybel.com/blog/about-debloos";
public static class Uri
{
public const string URL_ASSEMBLY = "https://raw.githubusercontent.com/builtbybel/BloatyNosy/main/src/BloatyNosy/Properties/AssemblyInfo.cs";
public const string URL_TWITTER = "https://twitter.com/builtbybel";
public const string URL_DONATE = "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=donate@builtbybel.com&lc=US&item_name=%20Builtbybel&no_note=0&cn=&currency_code=USD&bn=PP-DonationsBF:btn_donateCC_LG.gif:NonHosted";
public const string URL_GITREPO = "https://github.com/builtbybel/BloatyNosy";
public const string URL_GITLATEST = URL_GITREPO + "/releases/latest";
public const string URL_HELP = "https://www.builtbybel.com/blog/about-debloos";
}
public static class Paths
{
public static string SysDir = Path.GetPathRoot(Environment.SystemDirectory);
public static string LocalAppDataDir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
public static string ShellWT = LocalAppDataDir +
@"\Microsoft\WindowsApps\wt.exe";
public static string ShellCommandPrompt = SysDir +
@"Windows\System32\cmd.exe";
public static string ShellPS = SysDir +
@"Windows\System32\WindowsPowerShell\v1.0\powershell.exe";
}
public static class Data
{
public static string DataRootDir = Application.StartupPath +
@"\app\";
public static string ModsRootDir = Application.StartupPath +
@"\mods\";
}
// Create data directory if non present
public static void CreateDataDir()
{
bool dirExists = Directory.Exists(@"app");
if (!dirExists)
Directory.CreateDirectory(@"app");
}
// Create mods directory if non present
public static void CreateModsDir()
{
bool dirExists = Directory.Exists(@"mods");
if (!dirExists)
Directory.CreateDirectory(@"mods");
}
// 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")));
}
// Check Inet
public static bool IsInet()
{
try
{
using (var CheckInternet = new WebClient())
using (CheckInternet.OpenRead("http://clients3.google.com/generate_204"))
{
return true;
}
}
catch
{
return false;
}
}
}
}

View File

@ -0,0 +1,37 @@
using Microsoft.Win32;
using System;
namespace HelperTool
{
public static class OsHelper
{
public static readonly string thisOS = GetSupportedOS() + "\x20" + GetVersion();
public static string GetSupportedOS()
{
try
{
RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion");
int osbuild = Convert.ToInt32(key.GetValue("CurrentBuildNumber"));
if (osbuild >= 21996)
{
return "Windows 11";
}
}
catch { }
return "Windows 10";
}
public static string GetVersion()
{
RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion");
var UBR = key.GetValue("UBR").ToString();
var CurrentBuild = key.GetValue("CurrentBuild").ToString();
string version = CurrentBuild + "." + UBR;
return "Build " + version;
}
}
}

View File

@ -0,0 +1,40 @@
using Microsoft.Win32;
using System;
using System.Windows.Forms;
namespace BloatyNosy
{
// Check whether registry values equal
internal class RegistryHelper
{
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 whether 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;
}
}
}
}

View File

@ -0,0 +1,75 @@
using System;
using System.Diagnostics;
using System.Globalization;
using System.Text;
namespace BloatyNosy
{
public static class WindowsHelper
{
private static readonly ErrorHelper logger = ErrorHelper.Instance;
// Command Prompt (to be replaced with wt.exe)
public static void RunCmd(string args)
{
ProcStart(HelperTool.Utils.Paths.ShellCommandPrompt, args);
}
// Windows Terminal will be the default command line experience in TIW11 in 2022
public static void RunWT(string args)
{
ProcStart(HelperTool.Utils.Paths.ShellWT, args);
}
public static void ProcStart(string name, string args)
{
try
{
var proc = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = name,
Arguments = args,
UseShellExecute = false,
RedirectStandardOutput = true,
StandardOutputEncoding = Encoding.GetEncoding(CultureInfo.CurrentCulture.TextInfo.OEMCodePage),
CreateNoWindow = true
}
};
proc.Start();
string line = null;
while (!proc.StandardOutput.EndOfStream)
{
line += Environment.NewLine + proc.StandardOutput.ReadLine();
}
proc.WaitForExit();
logger.Log($"{name} {args} {line}");
}
catch
{
logger.Log($"Could not start {name} {args}.");
}
}
public static void IsServiceRunning(string service)
{
logger.Log($"\tCheck if {service} service is running");
RunCmd($"/c sc query {service} | find \"RUNNING\"");
}
public static void DisableService(string service)
{
RunCmd($"/c net stop {service}");
ProcStart(HelperTool.Utils.Paths.ShellPS, $"-command \"Set-Service -Name {service} -StartupType disabled\"");
logger.Log($"Disable {service} service");
}
public static void EnableService(string service)
{
RunCmd($"/c net start {service}");
ProcStart(HelperTool.Utils.Paths.ShellPS, $"-command \"Set-Service -Name {service} -StartupType auto\"");
logger.Log($"Enable {service} service");
}
}
}

View File

@ -0,0 +1,26 @@
namespace BloatyNosy.Setup
{
public enum PageTitle
{
Setup = 0,
NewLook,
StartMenu,
Apps,
Privacy,
MicrosoftStore,
ActionCenter,
FileExplorer,
SettingsApp,
WindowsUpdates,
SnapLayouts,
Widgets,
GestureControls,
WallpapersNSounds,
LockScreen,
TouchKeyboard,
AndroidApps,
Gaming,
Finish,
Custom
}
}

View File

@ -0,0 +1,53 @@
namespace BloatyNosy
{
internal class ModsManifest
{
public ModsParser ini;
public string Name { get; set; }
public override string ToString()
{
return Name;
}
public string DisplayName
{
get
{
return ini.ReadString("Info", "DisplayName");
}
}
public string AboutScript
{
get
{
return ini.ReadString("Info", "AboutScript");
}
}
public string Publisher
{
get
{
return ini.ReadString("Info", "Publisher");
}
}
public string ConditionScript
{
get
{
return ini.ReadString("Info", "ConditionScript");
}
}
public string ScriptLanguage
{
get
{
return ini.ReadString("Info", "ScriptLanguage");
}
}
}
}

View File

@ -0,0 +1,60 @@
using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
namespace BloatyNosy
{
internal class ModsParser
{
private static FileInfo fi;
[DllImport("kernel32")]
private static extern long WritePrivateProfileString(string Section, string Key, string Value, string FilePath);
[DllImport("kernel32")]
private static extern int GetPrivateProfileString(string Section, string Key, string Default, StringBuilder RetVal, int Size, string FilePath);
public string ReadString(string selection, string Key, string vDefault = "")
{
StringBuilder sb = new StringBuilder(1024);
// Get ini file
GetPrivateProfileString(selection, Key, vDefault, sb, 1024, fi.FullName);
return sb.ToString();
}
public List<string> ReadSelections()
{
List<string> temp = new List<string>();
string sLine = string.Empty;
if (!fi.Exists)
{
return temp;
}
using (StreamReader sr = new StreamReader(fi.FullName))
{
while (!sr.EndOfStream)
{
// Get and trim line
sLine = sr.ReadLine().Trim();
// Check for opening and closeing tags
if (sLine.StartsWith("[") && (sLine.EndsWith("]")))
{
// Add to collection
temp.Add(sLine.Substring(1, sLine.Length - 2));
}
}
sr.Close();
}
return temp;
}
public ModsParser(string Filename)
{
fi = new FileInfo(Filename);
}
}
}

View File

@ -0,0 +1,42 @@
1527c705-839a-4832-9118-54d4Bd6a0c89
c5e2524a-ea46-4f67-841f-6a9465d9d515
E2A4F912-2574-4A75-9BB0-0D023378592B
F46D4000-FD22-4DB4-AC8E-4E1DDDE828FE
InputApp
Microsoft.AAD.BrokerPlugin
Microsoft.AccountsControl
Microsoft.Advertising.Xaml
Microsoft.AsyncTextService
Microsoft.BioEnrollment
Microsoft.CredDialogHost
Microsoft.ECApp
Microsoft.LockApp
Microsoft.MicrosoftEdge
Microsoft.MicrosoftEdgeDevToolsClient
Microsoft.NET
Microsoft.PPIProjection
Microsoft.Services.Store.Engagement
Microsoft.VCLibs
Microsoft.Win32WebViewHost
Microsoft.WindowsStore
Microsoft.WindowsCalculator
Microsoft.XboxGameCallableUI
Microsoft.Windows.Apprep.ChxApp
Microsoft.Windows.AssignedAccessLockApp
Microsoft.Windows.CapturePicker
Microsoft.Windows.CloudExperienceHost
Microsoft.Windows.ContentDeliveryManager
Microsoft.Windows.Cortana
Microsoft.Windows.NarratorQuickStart
Microsoft.Windows.OOBENetworkCaptivePortal
Microsoft.Windows.OOBENetworkConnectionFlow
Microsoft.Windows.ParentalControls
Microsoft.Windows.PeopleExperienceHost
Microsoft.Windows.PinningConfirmationDialog
Microsoft.Windows.SecHealthUI
Microsoft.Windows.SecureAssessmentBrowser
Microsoft.Windows.ShellExperienceHost
Microsoft.Windows.XGpuEjectDialog
Windows.CBSPreview
windows.immersivecontrolpanel
Windows.PrintDialog

View File

@ -172,7 +172,7 @@
this.btnBack.FlatAppearance.BorderSize = 0;
this.btnBack.FlatAppearance.MouseOverBackColor = System.Drawing.Color.WhiteSmoke;
this.btnBack.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnBack.Font = new System.Drawing.Font("Segoe Fluent Icons", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnBack.Font = new System.Drawing.Font("Segoe Fluent Icons", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnBack.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.btnBack.Location = new System.Drawing.Point(0, 0);
this.btnBack.Name = "btnBack";

View File

@ -186,7 +186,7 @@
this.btnBack.FlatAppearance.BorderSize = 0;
this.btnBack.FlatAppearance.MouseOverBackColor = System.Drawing.Color.WhiteSmoke;
this.btnBack.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnBack.Font = new System.Drawing.Font("Segoe Fluent Icons", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnBack.Font = new System.Drawing.Font("Segoe Fluent Icons", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnBack.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.btnBack.Location = new System.Drawing.Point(0, 0);
this.btnBack.Name = "btnBack";
@ -305,8 +305,8 @@
this.btnHMenu.FlatAppearance.BorderSize = 0;
this.btnHMenu.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Gainsboro;
this.btnHMenu.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnHMenu.Font = new System.Drawing.Font("Segoe Fluent Icons", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnHMenu.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.btnHMenu.Font = new System.Drawing.Font("Segoe Fluent Icons", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnHMenu.ForeColor = System.Drawing.Color.Black;
this.btnHMenu.Location = new System.Drawing.Point(35, 0);
this.btnHMenu.Name = "btnHMenu";
this.btnHMenu.Size = new System.Drawing.Size(42, 38);

View File

@ -43,7 +43,7 @@
this.btnBack.FlatAppearance.BorderSize = 0;
this.btnBack.FlatAppearance.MouseOverBackColor = System.Drawing.Color.WhiteSmoke;
this.btnBack.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnBack.Font = new System.Drawing.Font("Segoe Fluent Icons", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnBack.Font = new System.Drawing.Font("Segoe Fluent Icons", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnBack.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.btnBack.Location = new System.Drawing.Point(0, 0);
this.btnBack.Name = "btnBack";

View File

@ -141,8 +141,8 @@
this.btnHMenu.FlatAppearance.BorderSize = 0;
this.btnHMenu.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Gainsboro;
this.btnHMenu.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnHMenu.Font = new System.Drawing.Font("Segoe Fluent Icons", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnHMenu.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.btnHMenu.Font = new System.Drawing.Font("Segoe Fluent Icons", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnHMenu.ForeColor = System.Drawing.Color.Black;
this.btnHMenu.Location = new System.Drawing.Point(35, 0);
this.btnHMenu.Name = "btnHMenu";
this.btnHMenu.Size = new System.Drawing.Size(42, 38);
@ -156,7 +156,7 @@
this.btnBack.FlatAppearance.BorderSize = 0;
this.btnBack.FlatAppearance.MouseOverBackColor = System.Drawing.Color.WhiteSmoke;
this.btnBack.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnBack.Font = new System.Drawing.Font("Segoe Fluent Icons", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnBack.Font = new System.Drawing.Font("Segoe Fluent Icons", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnBack.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.btnBack.Location = new System.Drawing.Point(0, 0);
this.btnBack.Name = "btnBack";
@ -258,7 +258,7 @@
this.rtbCode.Location = new System.Drawing.Point(17, 17);
this.rtbCode.Name = "rtbCode";
this.rtbCode.ReadOnly = true;
this.rtbCode.Size = new System.Drawing.Size(771, 120);
this.rtbCode.Size = new System.Drawing.Size(826, 120);
this.rtbCode.TabIndex = 12;
this.rtbCode.Text = "#Follow this project on GitHub.\nStart-Process https://github.com/builtbybel/Deblo" +
"os\n";

View File

@ -194,7 +194,7 @@
this.btnBack.FlatAppearance.BorderSize = 0;
this.btnBack.FlatAppearance.MouseOverBackColor = System.Drawing.Color.WhiteSmoke;
this.btnBack.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnBack.Font = new System.Drawing.Font("Segoe Fluent Icons", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnBack.Font = new System.Drawing.Font("Segoe Fluent Icons", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnBack.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.btnBack.Location = new System.Drawing.Point(0, 0);
this.btnBack.Name = "btnBack";

View File

@ -59,7 +59,7 @@
this.btnBack.FlatAppearance.BorderSize = 0;
this.btnBack.FlatAppearance.MouseOverBackColor = System.Drawing.Color.WhiteSmoke;
this.btnBack.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnBack.Font = new System.Drawing.Font("Segoe Fluent Icons", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnBack.Font = new System.Drawing.Font("Segoe Fluent Icons", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnBack.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.btnBack.Location = new System.Drawing.Point(0, 0);
this.btnBack.Name = "btnBack";