Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #32 from WereDev/develop
Browse files Browse the repository at this point in the history
version 4.2.1
  • Loading branch information
WereDev committed Sep 19, 2020
2 parents 9c89807 + e45103f commit 33d0308
Show file tree
Hide file tree
Showing 26 changed files with 805 additions and 858 deletions.
2 changes: 1 addition & 1 deletion AdvancedInstaller/wu10man.aip
Expand Up @@ -16,7 +16,7 @@
<ROW Property="ProductCode" Value="1033:{00273625-7096-487C-A5AB-A5116B423932} " Type="16"/>
<ROW Property="ProductLanguage" Value="1033"/>
<ROW Property="ProductName" Value="Wu10Man"/>
<ROW Property="ProductVersion" Value="4.2.0.0" Type="32" TargetFile="Wu10Man.exe"/>
<ROW Property="ProductVersion" Value="4.2.1.0" Type="32" TargetFile="Wu10Man.exe"/>
<ROW Property="REBOOT" MultiBuildValue="DefaultBuild:ReallySuppress"/>
<ROW Property="RUNAPPLICATION" Value="1" Type="4"/>
<ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND"/>
Expand Down
10 changes: 10 additions & 0 deletions CreatePortable.ps1
@@ -0,0 +1,10 @@
$compress = @{
Path = "Wu10Man\bin\Release\Wu10Man.exe",
"Wu10Man\bin\Release\Wu10Man.exe.config",
"Wu10Man\bin\Release\nlog.config",
"Wu10Man\bin\Release\declutter.json",
"Wu10Man\bin\Release\*.dll"
CompressionLevel = "Optimal"
DestinationPath = "Publish\Wu10Man_Portable.zip"
}
Compress-Archive @compress -Force
22 changes: 0 additions & 22 deletions README.md
Expand Up @@ -48,28 +48,6 @@ If you have Windows 10 Home, you don't have access to the Group Policy Editor, b
- **Notify of Download and Installation:** Provides notifications for download and install. Should function similar to older version of Windows that had this option.
- **Automatic Download, Notify of Installation:** Will automatically download updates, but provide notification before installation.


## BETA - Declutter
Windows 10 comes with a lot of clutter. There's the random stuff that they install that aren't particularly necessary, and then there's the 3rd party apps that Windows tries to include. There's plenty of apps and scripts to remove a bunch of these, but I wanted to add it here as well so that I had a single solution.

This is still sort of in BETA, so definitely use with added caution.


## Legacy
With any application, somethings things just are no longer necessary. With that, there comes some depricated parts of this application as well. These parts aren't really supported any more, as much as this application has support.


### Group Policy

If you have Windows 10 Home, you don't have access to the Group Policy Editor, but you can still set it via the registry. This application will make those updates for you, because who can remember where those settings are. This setting should be sufficient to block most automatic updates, but with some security updates, Microsoft will push those down regardless of these settings.

#### Group Policy Options:
- **Enable Automatic Updates:** Allows updates to function as normal.
- **Disable Automatic Updates:** Disables automatic updates.
- **Notify of Download and Installation:** Provides notifications for download and install. Should function similar to older version of Windows that had this option.
- **Automatic Download, Notify of Installation:** Will automatically download updates, but provide notification before installation.


## Additional Info

### System Updates
Expand Down
4 changes: 2 additions & 2 deletions Wu10Man/Properties/AssemblyInfo.cs
Expand Up @@ -48,6 +48,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.2.0.0")]
[assembly: AssemblyFileVersion("4.2.0.0")]
[assembly: AssemblyVersion("4.2.1.0")]
[assembly: AssemblyFileVersion("4.2.1.0")]
[assembly: NeutralResourcesLanguage("en-US")]
122 changes: 62 additions & 60 deletions Wu10Man/UserControls/DeclutterControl.xaml
@@ -1,60 +1,62 @@
<UserControl x:Class="WereDev.Utils.Wu10Man.UserControls.DeclutterControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:WereDev.Utils.Wu10Man.UserControls"
mc:Ignorable="d"
d:DesignHeight="353"
d:DesignWidth="558">
<Grid Background="LightGray">
<Label Content="Uninstall Windows Clutter" HorizontalAlignment="Center" VerticalAlignment="Top" ClipToBounds="True" FontSize="14" FontWeight="Bold"/>

<Grid Width="200" HorizontalAlignment="Left" Margin="5, 30, 5, 5" Background="#EEEEEE">
<Label>
<Label.Content>
<StackPanel>
<TextBlock Margin="5, 0, 5, 0" TextWrapping="Wrap">
Windows 10 comes with a lot of "extra" software, aka clutter.
Many of them are more annoying than useful and can be
somewhat obtrusive. This screen can be used to uninstall
that software. Reinstalling them can be done through
the Windows Store.
</TextBlock>
<Button x:Name="btnShowMicrosoft" Margin="15, 30, 15, 0" Click="ShowMicrosoftApps">Show Microsoft Apps</Button>
<Button x:Name="btnShowThirdParty" Margin="15, 30, 15, 0" Click="ShowThirdPartyApps">Show 3rd Party Apps</Button>
</StackPanel>
</Label.Content>
</Label>
</Grid>
<Grid Width="350" HorizontalAlignment="Right" Margin="5, 30, 5, 5" Background="#EEEEEE" Name="grdMicrosoft" Visibility="Visible">
<ListView Height="275" Width="350" VerticalAlignment="Top" ItemsSource="{Binding Path=Packages}"
BorderThickness="0" Background="Transparent" HorizontalAlignment="Center" Name="ListViewWindowsApps">
<ListView.ItemContainerStyle>
<Style TargetType="{x:Type ListViewItem}">
<Setter Property="Background" Value="Transparent" />
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListViewItem}">
<ContentPresenter />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListView.ItemContainerStyle>
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0" Visibility="{Binding GetVisibility}">
<CheckBox Margin="0" VerticalAlignment="Center" IsChecked="{Binding CheckedForRemoval}" />
<Label Content="{Binding AppName}" Margin="0" VerticalAlignment="Center" HorizontalAlignment="Left" Width="300"/>
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<Button Content="Remove Checked Apps" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="10" Width="150" Click="RemoveCheckedApps" />
<Button Content="{Binding SelectButtonText}" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="10" Width="150" Click="ToggleAppsSelection" />
</Grid>
<local:ProgressBarControl Visibility="Hidden" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" x:Name="ProgressBar"></local:ProgressBarControl>
</Grid>
</UserControl>
<localControls:UserControlBaseWithWorker
x:Class="WereDev.Utils.Wu10Man.UserControls.DeclutterControl"
x:TypeArguments="localModels:DeclutterModel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:localControls="clr-namespace:WereDev.Utils.Wu10Man.UserControls"
xmlns:localModels="clr-namespace:WereDev.Utils.Wu10Man.UserControls.Models"
mc:Ignorable="d"
d:DesignHeight="353"
d:DesignWidth="558">
<Grid Background="LightGray">
<Label Content="Uninstall Windows Clutter" HorizontalAlignment="Center" VerticalAlignment="Top" ClipToBounds="True" FontSize="14" FontWeight="Bold"/>

<Grid Width="200" HorizontalAlignment="Left" Margin="5, 30, 5, 5" Background="#EEEEEE">
<Label>
<Label.Content>
<StackPanel>
<TextBlock Margin="5, 0, 5, 0" TextWrapping="Wrap">
Windows 10 comes with a lot of "extra" software, aka clutter.
Many of them are more annoying than useful and can be
somewhat obtrusive. This screen can be used to uninstall
that software. Reinstalling them can be done through
the Windows Store.
</TextBlock>
<Button x:Name="btnShowMicrosoft" Margin="15, 30, 15, 0" Click="ShowMicrosoftApps">Show Microsoft Apps</Button>
<Button x:Name="btnShowThirdParty" Margin="15, 30, 15, 0" Click="ShowThirdPartyApps">Show 3rd Party Apps</Button>
</StackPanel>
</Label.Content>
</Label>
</Grid>
<Grid Width="350" HorizontalAlignment="Right" Margin="5, 30, 5, 5" Background="#EEEEEE" Name="grdMicrosoft" Visibility="Visible">
<ListView Height="275" Width="350" VerticalAlignment="Top" ItemsSource="{Binding Path=Packages}"
BorderThickness="0" Background="Transparent" HorizontalAlignment="Center" Name="ListViewWindowsApps">
<ListView.ItemContainerStyle>
<Style TargetType="{x:Type ListViewItem}">
<Setter Property="Background" Value="Transparent" />
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListViewItem}">
<ContentPresenter />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListView.ItemContainerStyle>
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0" Visibility="{Binding GetVisibility}">
<CheckBox Margin="0" VerticalAlignment="Center" IsChecked="{Binding CheckedForRemoval}" />
<Label Content="{Binding AppName}" Margin="0" VerticalAlignment="Center" HorizontalAlignment="Left" Width="300"/>
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<Button Content="Remove Checked Apps" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="10" Width="150" Click="RemoveCheckedApps" />
<Button Content="{Binding SelectButtonText}" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="10" Width="150" Click="ToggleAppsSelection" />
</Grid>
</Grid>
</localControls:UserControlBaseWithWorker>
155 changes: 36 additions & 119 deletions Wu10Man/UserControls/DeclutterControl.xaml.cs
@@ -1,10 +1,7 @@
using System;
using System.ComponentModel;
using System.Linq;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using WereDev.Utils.Wu10Man.Core;
using WereDev.Utils.Wu10Man.Core.Interfaces;
using WereDev.Utils.Wu10Man.UserControls.Models;
Expand All @@ -14,121 +11,45 @@ namespace WereDev.Utils.Wu10Man.UserControls
/// <summary>
/// Interaction logic for DeclutterControl.xaml.
/// </summary>
public partial class DeclutterControl : UserControl, IDisposable
public partial class DeclutterControl : UserControlBaseWithWorker<DeclutterModel>
{
private const string TabTitle = "Declutter";
private readonly ILogWriter _logWriter;
private readonly IWindowsPackageManager _packageManager;
private readonly DeclutterModel _model;
private BackgroundWorker _worker;
private bool _isDisposed = false;

public DeclutterControl()
: base()
{
_logWriter = DependencyManager.LogWriter;
_packageManager = DependencyManager.WindowsPackageManager;
_model = new DeclutterModel();
TabTitle = "Declutter";

_logWriter.LogInfo("Declutter Control initializing.");
InitializeComponent();
}

// Dispose() calls Dispose(true)
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}

protected override void OnRender(DrawingContext drawingContext)
{
Mouse.OverrideCursor = Cursors.Wait;

if (!DesignerProperties.GetIsInDesignMode(this))
{
SetRuntimeOptions();
}

base.OnRender(drawingContext);

Mouse.OverrideCursor = Cursors.Arrow;
}

// The bulk of the clean-up code is implemented in Dispose(bool)
protected virtual void Dispose(bool disposing)
{
if (_isDisposed)
return;

if (disposing)
{
_worker.Dispose();
}

_isDisposed = true;
}

private bool SetRuntimeOptions()
{
try
{
GetPackageStatus();
DataContext = _model;
_logWriter.LogInfo("Declutter Control rendered.");
return true;
}
catch (Exception ex)
{
_logWriter.LogError(ex);
MessageBox.Show($"Error rendering {TabTitle} tab.", TabTitle, MessageBoxButton.OK, MessageBoxImage.Error);
return false;
}
finally
{
InitializeComponent();
}
}

private void GetPackageStatus()
protected override bool SetRuntimeOptions()
{
var declutter = _packageManager.GetDeclutterConfig();
var installedApps = _packageManager.ListInstalledPackages();
var microsoftApps = _packageManager.MergePackageInfo(declutter.Microsoft, installedApps);
_model.SetPackages(DeclutterModel.PackageSources.Microsoft, microsoftApps.Select(x => new PackageInfo(x)));
Model.SetPackages(DeclutterModel.PackageSource.Microsoft, microsoftApps.Select(x => new PackageInfo(x)));
var thirdPartyApps = _packageManager.MergePackageInfo(declutter.ThirdParty, installedApps);
_model.SetPackages(DeclutterModel.PackageSources.ThirdParty, thirdPartyApps.Select(x => new PackageInfo(x)));
Model.SetPackages(DeclutterModel.PackageSource.ThirdParty, thirdPartyApps.Select(x => new PackageInfo(x)));
return true;
}

private void ShowMicrosoftApps(object sender, RoutedEventArgs e)
{
_model.PackageSource = DeclutterModel.PackageSources.Microsoft;
Model.ActiveSource = DeclutterModel.PackageSource.Microsoft;
}

private void ShowThirdPartyApps(object sender, RoutedEventArgs e)
{
_model.PackageSource = DeclutterModel.PackageSources.ThirdParty;
}

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "_worker part of larger scope.")]
private void RemoveCheckedApps(object sender, RoutedEventArgs e)
{
var packages = (PackageInfo[])ListViewWindowsApps.ItemsSource;
var packagesToRemove = packages.Where(x => x.CheckedForRemoval).ToArray();
InitializeProgressBar(0, packagesToRemove.Length);

_worker = new BackgroundWorker
{
WorkerReportsProgress = true,
};
_worker.DoWork += RemoveCheckedAppWorker;
_worker.RunWorkerCompleted += RunWorkerCompleted;
_worker.RunWorkerAsync();
Model.ActiveSource = DeclutterModel.PackageSource.ThirdParty;
}

private void ToggleAppsSelection(object sender, RoutedEventArgs e)
{
var setChecked = !_model.AllPackagesSelected;
var setChecked = !Model.AllPackagesSelected;

foreach (var package in _model.Packages)
foreach (var package in Model.Packages)
{
if (package.CheckedForRemoval != setChecked)
{
Expand All @@ -137,41 +58,37 @@ private void ToggleAppsSelection(object sender, RoutedEventArgs e)
}
}

private void RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
ShowMessage("Selected Windows Apps have been removed.");
ProgressBar.Visibility = Visibility.Hidden;
}

private void RemoveCheckedAppWorker(object sender, EventArgs e)
private void RemoveCheckedApps(object sender, RoutedEventArgs e)
{
var packages = (PackageInfo[])ListViewWindowsApps.ItemsSource;
var packagesToRemove = packages.Where(x => x.CheckedForRemoval).ToArray();
var packagesToRemove = packages.Count(x => x.CheckedForRemoval);

foreach (var ptr in packagesToRemove)
{
_packageManager.RemovePackage(ptr.PackageName);
ptr.IsInstalled = false;
ptr.CheckedForRemoval = false;
_logWriter.LogInfo($"Removing Windows App: ${ptr.PackageName}");
AdvanceProgressBar();
}
RunBackgroundProcess(packagesToRemove, RemoveCheckedAppWorker);
}

private void ShowMessage(string message)
private void RemoveCheckedAppWorker(object sender, EventArgs e)
{
MessageBox.Show(message, TabTitle, MessageBoxButton.OK, MessageBoxImage.Information);
}
try
{
var packages = (PackageInfo[])ListViewWindowsApps.ItemsSource;
var packagesToRemove = packages.Where(x => x.CheckedForRemoval);

private void InitializeProgressBar(int minValue, int maxValue)
{
ProgressBar.Visibility = Visibility.Visible;
ProgressBar.Initialize(minValue, maxValue);
}
foreach (var ptr in packagesToRemove)
{
_packageManager.RemovePackage(ptr.PackageName);
ptr.IsInstalled = false;
ptr.CheckedForRemoval = false;
LogWriter.LogInfo($"Removing Windows App: ${ptr.PackageName}");
AdvanceProgressBar();
}

private void AdvanceProgressBar()
{
ProgressBar.Advance();
ShowInfoMessage("Selected Windows Apps have been removed.");
}
catch (Exception ex)
{
LogWriter.LogError(ex);
ShowErrorMessage(ex.Message);
}
}
}
}

0 comments on commit 33d0308

Please sign in to comment.