Skip to content

Commit d9bc8b3

Browse files
author
Belim
authored
Add files via upload
1 parent a716b3a commit d9bc8b3

File tree

7 files changed

+302
-145
lines changed

7 files changed

+302
-145
lines changed

src/Bloatbox/Bloatbox.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
<PropertyGroup>
3838
<ApplicationIcon>bloatbox.ico</ApplicationIcon>
3939
</PropertyGroup>
40+
<PropertyGroup>
41+
<ApplicationManifest>app.manifest</ApplicationManifest>
42+
</PropertyGroup>
4043
<ItemGroup>
4144
<Reference Include="System" />
4245
<Reference Include="System.Core" />
@@ -86,6 +89,7 @@
8689
<SubType>Designer</SubType>
8790
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
8891
</EmbeddedResource>
92+
<None Include="app.manifest" />
8993
<None Include="Properties\Settings.settings">
9094
<Generator>SettingsSingleFileGenerator</Generator>
9195
<LastGenOutput>Settings.Designer.cs</LastGenOutput>

src/Bloatbox/MainWindow.Designer.cs

Lines changed: 114 additions & 101 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Bloatbox/MainWindow.cs

Lines changed: 95 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.ComponentModel;
34
using System.Diagnostics;
45
using System.IO;
56
using System.Linq;
@@ -17,13 +18,21 @@ public partial class MainWindow : Form
1718
private List<string> _listSystemApps = new List<string>();
1819

1920
// General strings
20-
private string _successRemove = "Successfully removed:\n";
21-
22-
private string _failedRemove = "Failed to remove:\n";
2321
private readonly string _installCount = "My apps";
22+
2423
private readonly string _removeCount = "Remove apps";
2524
private readonly string _nothingCount = "No apps to uninstall!";
2625

26+
// Community strings
27+
private readonly string _uriPkg = "https://github.com/Sycnex/Windows10Debloater/raw/master/Windows10Debloater.ps1";
28+
private readonly string _infoPkg = "This will download the PowerShell based Community version \"Windows10Debloater.ps1\"" +
29+
"\n\nThis is a interactive script with prompts which runs the following functions:" +
30+
"\n- Debloat (a list of Bloatware that is removed can be viewed on the authors GitHub repository)" +
31+
"\n- Removes registry keys leftover that are associated with the bloatware apps" +
32+
"\n- Protect privacy by stopping some telemetry functions, stops Cortana from being used as your Search Index, disables unneccessary scheduled tasks, and more" +
33+
"\n- Stop-EdgePDF" +
34+
"\r\n\nDo you wish to continue?\r\n\nMore information about this script can be found here https://github.com/Sycnex/Windows10Debloater";
35+
2736
// Update strings
2837
private readonly string _releaseURL = "https://raw.githubusercontent.com/builtbybel/bloatbox/master/latest.txt";
2938

@@ -36,7 +45,7 @@ public partial class MainWindow : Form
3645
/// <summary>
3746
/// Check for updates
3847
/// </summary>
39-
private void CheckNewReleases_Click(object sender, EventArgs e)
48+
private void CheckUpdates_Click(object sender, EventArgs e)
4049
{
4150
try
4251
{
@@ -90,6 +99,9 @@ public MainWindow()
9099
BtnClear.Text = "\ue894"; // Clear
91100
}
92101

102+
/// <summary>
103+
/// Retrieve UWP apps
104+
/// </summary>
93105
private void GetUWP()
94106
{
95107
LstUWP.Items.Clear();
@@ -110,16 +122,22 @@ private void GetUWP()
110122
string appInst = LstUWP.Items.ToString();
111123
foreach (string item in LstUWPRemove.Items) if (item.Any(appInst.Contains)) LstUWP.Items.Remove(item);
112124

113-
RefreshInstalled();
125+
RefreshUWP();
114126
}
115127

116128
private void BtnRefresh_Click(object sender, EventArgs e)
117129
{
118130
GetUWP();
119131
}
120132

133+
/// <summary>
134+
/// App uninstaller
135+
/// </summary>
121136
private string RemoveUWP()
122137
{
138+
string success = "Successfully removed:\n";
139+
string failed = "Failed to remove:\n";
140+
123141
foreach (var item in LstUWPRemove.Items)
124142
{
125143
powerShell.Commands.Clear();
@@ -132,32 +150,31 @@ private string RemoveUWP()
132150
foreach (var p in powerShell.Streams.Progress)
133151
{
134152
if (p.Activity.Contains(item.ToString()) && p.StatusDescription == "Completed") // Removed successfully
135-
{
136-
_successRemove += "\t" + item.ToString() + "\n";
137-
// Console.WriteLine( _successRemove + item.ToString());
153+
{
154+
success += "\t" + item.ToString() + "\n";
155+
// Console.WriteLine(success + item.ToString());
138156
break;
139157
}
140158
else if (p.Activity.Contains(item.ToString()) && p.StatusDescription == "Error") // NOT removed
141159
{
142-
if (!_failedRemove.Contains(item.ToString())) _failedRemove += "\t" + item.ToString() + "\n";
143-
// Console.WriteLine(_failedRemove + p.Activity);
144-
}
145-
}
146-
147-
powerShell.Streams.Progress.Clear();
148-
149-
/* Detailed log OFF!
150-
if (powerShell.HadErrors) foreach (var p in powerShell.Streams.Error) { Console.WriteLine("\n\nERROR:\n" + p.ToString() + "\n\n"); } */
151-
}
152-
153-
string outputPS = "";
154-
if (powerShell.HadErrors) { outputPS = _successRemove + "\n" + _failedRemove; powerShell.Streams.Error.Clear(); }
155-
else { outputPS = _successRemove; }
156-
160+
if (!failed.Contains(item.ToString())) failed += "\t" + item.ToString() + "\n";
161+
// Console.WriteLine(failed + p.Activity);
162+
}
163+
}
164+
165+
powerShell.Streams.Progress.Clear();
166+
/* Detailed lof OFF
167+
if (powerShell.HadErrors) foreach (var p in powerShell.Streams.Error) { Console.WriteLine("\n\nERROR:\n" + p.ToString() + "\n\n"); } */
168+
}
169+
170+
string outputPS = "";
171+
if (powerShell.HadErrors) { outputPS = success + "\n" + failed; powerShell.Streams.Error.Clear(); }
172+
else { outputPS = success; }
173+
157174
return outputPS;
158175
}
159176

160-
private void RefreshInstalled()
177+
private void RefreshUWP()
161178
{
162179
int installed = LstUWP.Items.Count;
163180
int remove = LstUWPRemove.Items.Count;
@@ -240,7 +257,7 @@ private void BtnAddAll_Click(object sender, EventArgs e)
240257
// LstUWP.Items.Remove(item);
241258
}
242259
LstUWP.Items.Clear();
243-
RefreshInstalled();
260+
RefreshUWP();
244261
}
245262

246263
private void BtnAdd_Click(object sender, EventArgs e)
@@ -253,7 +270,7 @@ private void BtnAdd_Click(object sender, EventArgs e)
253270
LstUWPRemove.Items.Add(LstUWP.SelectedItem);
254271
LstUWP.Items.Remove(LstUWP.SelectedItem);
255272
}
256-
RefreshInstalled();
273+
RefreshUWP();
257274
}
258275
}
259276

@@ -265,7 +282,7 @@ private void BtnRemoveAll_Click(object sender, EventArgs e)
265282
// LstUWP.Items.Remove(item);
266283
}
267284
LstUWPRemove.Items.Clear();
268-
RefreshInstalled();
285+
RefreshUWP();
269286
}
270287

271288
private void BtnRemove_Click(object sender, EventArgs e)
@@ -278,7 +295,7 @@ private void BtnRemove_Click(object sender, EventArgs e)
278295
LstUWP.Items.Add(LstUWPRemove.SelectedItem);
279296
LstUWPRemove.Items.Remove(LstUWPRemove.SelectedItem);
280297
}
281-
RefreshInstalled();
298+
RefreshUWP();
282299
}
283300
}
284301

@@ -307,11 +324,6 @@ private void LstUWPRemove_DoubleClick(object sender, EventArgs e)
307324
BtnRemove_Click(sender, e);
308325
}
309326

310-
private void LnkMSSettingsAppsandfeatures_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
311-
{
312-
Process.Start("ms-settings:appsfeatures");
313-
}
314-
315327
private void LblMainMenu_Click(object sender, EventArgs e)
316328
{
317329
this.MainMenu.Show(Cursor.Position.X, Cursor.Position.Y);
@@ -331,5 +343,55 @@ private void AppInfo_Click(object sender, EventArgs e)
331343
"(C) 2020, Builtbybel (former Mirinsoft)",
332344
"Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
333345
}
346+
347+
/// <summary>
348+
/// Download optional community version Windows10Debloater.ps1
349+
/// </summary>
350+
private void LnkGetCommunityVer_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
351+
{
352+
if (MessageBox.Show(_infoPkg, this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
353+
{
354+
PBar.Visible = true;
355+
var pkg = _uriPkg;
356+
357+
try
358+
{
359+
WebClient wc = new WebClient();
360+
wc.DownloadProgressChanged += new DownloadProgressChangedEventHandler(DownloadProgressChanged);
361+
wc.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed);
362+
363+
wc.DownloadFileAsync(new Uri(pkg.Trim()), @"Windows10Debloater.ps1");
364+
}
365+
catch (Exception ex)
366+
{ MessageBox.Show(ex.Message, this.Text); }
367+
}
368+
}
369+
370+
public void DownloadProgressChanged(Object sender, DownloadProgressChangedEventArgs e)
371+
{
372+
PBar.Value = e.ProgressPercentage;
373+
}
374+
375+
public void Completed(object sender, AsyncCompletedEventArgs e)
376+
{
377+
try
378+
{
379+
var ps1File = @"Windows10Debloater.ps1";
380+
var startInfo = new ProcessStartInfo()
381+
{
382+
FileName = "powershell.exe",
383+
Arguments = $"-NoProfile -ExecutionPolicy unrestricted -file \"{ps1File}\"",
384+
UseShellExecute = true,
385+
CreateNoWindow = true
386+
};
387+
Process.Start(startInfo);
388+
PBar.Visible = false;
389+
}
390+
catch (Exception ex)
391+
{
392+
MessageBox.Show(ex.Message, this.Text);
393+
PBar.Visible = false;
394+
}
395+
}
334396
}
335397
}

src/Bloatbox/MainWindow.resx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,12 @@
123123
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
124124
<data name="LinkGitHub.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
125125
<value>
126-
iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
127-
YQUAAAEcSURBVEhL7dU9SgNBHIbxtbAx4gcBGxFL7SPYeg2LnEALL2ApFhaCCLZiCitLhVRBEDxAQFsP
128-
YCUIiqA+j86ILNmQmSVdXvjB7O4/+yaTsCkmSc0CtmryHpVx4Ksm71GZWLAX1il8zcgFg4YW0QpmPFHK
129-
sNf+ZdDQEi7wDq/pFSeYQ0xWwTKe8IZ488hzD2jCZBVcweM1bGMXO2hjFV7z05nkAvf8Ay9hXc4snuHW
130-
uVXJBZthfYOq+O6d2UBywXpY91GVHpxxNrlgGm7PIw7hnk/BrGAfn3DG2eQCc4AuTtHxRMgtnJPlJqug
131-
gTtcw19QzCWcu4dftskqMPM4wvnP0W/OcIz/D7bsglGTVDD2h10dQwvG/oczSSlF8Q3qQonB/m9ttAAA
132-
AABJRU5ErkJggg==
126+
iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAARxJREFUSEvt
127+
1T1KA0EchvG1sDHiBwEbEUvtI9h6DYucQAsvYCkWFoIItmIKK0uFVEEQPEBAWw9gJQiKoD6Pzogs2ZCZ
128+
JV1e+MHs7j/7JpOwKSZJzQK2avIelXHgqybvUZlYsBfWKXzNyAWDhhbRCmY8Ucqw1/5l0NASLvAOr+kV
129+
J5hDTFbBMp7whnjzyHMPaMJkFVzB4zVsYxc7aGMVXvPTmeQC9/wDL2Fdziye4da5VckFm2F9g6r47p3Z
130+
QHLBelj3UZUenHE2uWAabs8jDuGeT8GsYB+fcMbZ5AJzgC5O0fFEyC2ck+Umq6CBO1zDX1DMJZy7h1+2
131+
ySow8zjC+c/Rb85wjP8PtuyCUZNUMPaHXR1DC8b+hzNJKUXxDepCicH+b220AAAAAElFTkSuQmCC
133132
</value>
134133
</data>
135134
</root>

src/Bloatbox/Program.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,20 @@ static class Program
1111
internal static string GetCurrentVersionTostring() => new Version(Application.ProductVersion).ToString(3);
1212

1313
/// <summary>
14-
/// Der Haupteinstiegspunkt für die Anwendung.
14+
/// The main entry point for the application.
1515
/// </summary>
1616
[STAThread]
1717
static void Main()
1818
{
1919
Application.EnableVisualStyles();
2020
Application.SetCompatibleTextRenderingDefault(false);
21-
Application.Run(new MainWindow());
21+
22+
if (Environment.OSVersion.Version.Build < 9200)
23+
24+
MessageBox.Show("You are running Bloatbox on a system older than Windows 10. Bloatbox is limited to Windows 10 ONLY.", "Bloatbox", MessageBoxButtons.OK, MessageBoxIcon.Information);
25+
else
26+
Application.Run(new MainWindow());
27+
2228
}
2329
}
2430
}

src/Bloatbox/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
3333
// übernehmen, indem Sie "*" eingeben:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("0.11.1")]
36-
[assembly: AssemblyFileVersion("0.11.1")]
35+
[assembly: AssemblyVersion("0.12.0")]
36+
[assembly: AssemblyFileVersion("0.12.0")]

src/Bloatbox/app.manifest

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
3+
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
4+
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
5+
<security>
6+
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
7+
<!-- UAC-Manifestoptionen
8+
Wenn Sie die Ebene der Benutzerkontensteuerung für Windows ändern möchten, ersetzen Sie den
9+
Knoten "requestedExecutionLevel" wie folgt.
10+
11+
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
12+
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
13+
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
14+
15+
Durch Angabe des Elements "requestedExecutionLevel" wird die Datei- und Registrierungsvirtualisierung deaktiviert.
16+
Entfernen Sie dieses Element, wenn diese Virtualisierung aus Gründen der Abwärtskompatibilität
17+
für die Anwendung erforderlich ist.
18+
-->
19+
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
20+
</requestedPrivileges>
21+
</security>
22+
</trustInfo>
23+
24+
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
25+
<application>
26+
<!-- Eine Liste der Windows-Versionen, unter denen diese Anwendung getestet
27+
und für die sie entwickelt wurde. Wenn Sie die Auskommentierung der entsprechenden Elemente aufheben,
28+
wird von Windows automatisch die kompatibelste Umgebung ausgewählt. -->
29+
30+
<!-- Windows Vista -->
31+
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
32+
33+
<!-- Windows 7 -->
34+
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
35+
36+
<!-- Windows 8 -->
37+
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
38+
39+
<!-- Windows 8.1 -->
40+
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
41+
42+
<!-- Windows 10 -->
43+
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
44+
45+
</application>
46+
</compatibility>
47+
48+
<!-- Gibt an, dass die Anwendung mit DPI-Werten kompatibel ist und von Windows nicht automatisch auf höhere
49+
DPI-Werte skaliert wird. WPF-Anwendungen (Windows Presentation Foundation) sind automatisch mit DPI-Werten kompatibel und müssen sich nicht
50+
anmelden. Für Windows Forms-Anwendungen für .NET Framework 4.6, die sich für diese Einstellung anmelden, muss
51+
auch die Einstellung "'EnableWindowsFormsHighDpiAutoResizing" in der "app.config" auf "true" festgelegt werden. -->
52+
<application xmlns="urn:schemas-microsoft-com:asm.v3">
53+
<windowsSettings>
54+
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
55+
</windowsSettings>
56+
</application>
57+
<!-- Designs für allgemeine Windows-Steuerelemente und -Dialogfelder (Windows XP und höher) aktivieren -->
58+
<!--
59+
<dependency>
60+
<dependentAssembly>
61+
<assemblyIdentity
62+
type="win32"
63+
name="Microsoft.Windows.Common-Controls"
64+
version="6.0.0.0"
65+
processorArchitecture="*"
66+
publicKeyToken="6595b64144ccf1df"
67+
language="*"
68+
/>
69+
</dependentAssembly>
70+
</dependency>
71+
-->
72+
73+
</assembly>

0 commit comments

Comments
 (0)