Test 2024 01 02 Main Merge (#1345)

* Add Version to App Display

* Keep Windows Security (#1341)

Adds a switch to Remove-ProvisionedPackages to determine whether we should remove Windows Security (GUI component, Microsoft.SecHealthUI).

This commit fixes issue #1339

* Added scrollbar to all tabs (#1344)

* Add scrollbar to Tweaks

* Added scrollbar to all tabs

* Compile Winutil

---------

Co-authored-by: CodingWonders <101426328+CodingWonders@users.noreply.github.com>
Co-authored-by: Munkk <152475628+munkk01@users.noreply.github.com>
Co-authored-by: ChrisTitusTech <ChrisTitusTech@users.noreply.github.com>
This commit is contained in:
Chris Titus 2024-01-03 09:49:23 -06:00 committed by GitHub
parent 771c268130
commit a2b12ae4b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 76 additions and 27 deletions

View File

@ -23,8 +23,9 @@ Get-ChildItem .\functions -Recurse -File | ForEach-Object {
Get-ChildItem .\xaml | ForEach-Object {
$xaml = (Get-Content $psitem.FullName).replace("'","''")
$newXaml = $xaml -replace 'CTTVersion', (Get-Date -Format 'yy.MM.dd')
Write-output "`$$($psitem.BaseName) = '$xaml'" | Out-File ./$scriptname -Append -Encoding ascii
Write-output "`$$($psitem.BaseName) = '$newXaml'" | Out-File ./$scriptname -Append -Encoding ascii
}
Get-ChildItem .\config | Where-Object {$psitem.extension -eq ".json"} | ForEach-Object {

View File

@ -90,8 +90,20 @@ function Remove-Packages
Write-Progress -Activity "Removing Apps" -Status "Ready" -Completed
}
function Remove-ProvisionedPackages
function Remove-ProvisionedPackages([switch] $keepSecurity = $false)
{
<#
.SYNOPSIS
Removes AppX packages from a Windows image during MicroWin processing
.PARAMETER Name
keepSecurity - Boolean that determines whether to keep "Microsoft.SecHealthUI" (Windows Security) in the Windows image
.EXAMPLE
Remove-ProvisionedPackages -keepSecurity:$false
#>
$appxProvisionedPackages = Get-AppxProvisionedPackage -Path "$($scratchDir)" | Where-Object {
$_.PackageName -NotLike "*AppInstaller*" -AND
$_.PackageName -NotLike "*Store*" -and
@ -107,6 +119,7 @@ function Remove-ProvisionedPackages
if ($?)
{
if ($keepSecurity) { $appxProvisionedPackages = $appxProvisionedPackages | Where-Object { $_.PackageName -NotLike "*SecHealthUI*" }}
$counter = 0
foreach ($appx in $appxProvisionedPackages)
{

View File

@ -63,7 +63,7 @@ function Invoke-WPFMicrowin {
}
if (!$keepProvisionedPackages)
{
Remove-ProvisionedPackages
Remove-ProvisionedPackages -keepSecurity:$keepDefender
}
# special code, for some reason when you try to delete some inbox apps

View File

@ -10,7 +10,7 @@
Author : Chris Titus @christitustech
Runspace Author: @DeveloperDurp
GitHub : https://github.com/ChrisTitusTech
Version : 24.01.02
Version : 24.01.03
#>
Start-Transcript $ENV:TEMP\Winutil.log -Append
@ -22,7 +22,7 @@ Add-Type -AssemblyName System.Windows.Forms
# Variable to sync between runspaces
$sync = [Hashtable]::Synchronized(@{})
$sync.PSScriptRoot = $PSScriptRoot
$sync.version = "24.01.02"
$sync.version = "24.01.03"
$sync.configs = @{}
$sync.ProcessRunning = $false
@ -1121,8 +1121,20 @@ function Remove-Packages
Write-Progress -Activity "Removing Apps" -Status "Ready" -Completed
}
function Remove-ProvisionedPackages
function Remove-ProvisionedPackages([switch] $keepSecurity = $false)
{
<#
.SYNOPSIS
Removes AppX packages from a Windows image during MicroWin processing
.PARAMETER Name
keepSecurity - Boolean that determines whether to keep "Microsoft.SecHealthUI" (Windows Security) in the Windows image
.EXAMPLE
Remove-ProvisionedPackages -keepSecurity:$false
#>
$appxProvisionedPackages = Get-AppxProvisionedPackage -Path "$($scratchDir)" | Where-Object {
$_.PackageName -NotLike "*AppInstaller*" -AND
$_.PackageName -NotLike "*Store*" -and
@ -1138,6 +1150,7 @@ function Remove-ProvisionedPackages
if ($?)
{
if ($keepSecurity) { $appxProvisionedPackages = $appxProvisionedPackages | Where-Object { $_.PackageName -NotLike "*SecHealthUI*" }}
$counter = 0
foreach ($appx in $appxProvisionedPackages)
{
@ -2640,7 +2653,7 @@ function Invoke-WPFMicrowin {
}
if (!$keepProvisionedPackages)
{
Remove-ProvisionedPackages
Remove-ProvisionedPackages -keepSecurity:$keepDefender
}
# special code, for some reason when you try to delete some inbox apps
@ -4263,12 +4276,15 @@ $inputXML = '<Window x:Class="WinUtility.MainWindow"
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" FontFamily="Segoe MDL2 Assets"
FontSize="14" Margin="16,0,0,0">&#xE721;</TextBlock>
</Grid>
<TextBlock Text="Version: 24.01.03" VerticalAlignment="Center" HorizontalAlignment="Center"
Margin="10,0,0,0"/>
<Button Content="&#xD7;" BorderThickness="0"
BorderBrush="Transparent"
Background="{MainBackgroundColor}"
HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,5,5,0"
FontFamily="Arial"
Foreground="{MainForegroundColor}" FontSize="18" Name="WPFCloseButton" />
</DockPanel>
<TabControl Name="WPFTabNav" Background="Transparent" Width="Auto" Height="Auto" BorderBrush="Transparent" BorderThickness="0" Grid.Row="1" Grid.Column="0" Padding="-1">
@ -4333,6 +4349,7 @@ $inputXML = '<Window x:Class="WinUtility.MainWindow"
</Grid>
</TabItem>
<TabItem Header="Tweaks" Visibility="Collapsed" Name="WPFTab2">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<Grid Background="Transparent">
<Grid.ColumnDefinitions>
<ColumnDefinition Width=".50*"/>
@ -4459,10 +4476,12 @@ $inputXML = '<Window x:Class="WinUtility.MainWindow"
</StackPanel> <!-- End of Customize Preferences Section -->
</Border>
</Grid>
</Border>
</Grid>
</ScrollViewer>
</TabItem>
<TabItem Header="Config" Visibility="Collapsed" Name="WPFTab3">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<Grid Background="Transparent">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
@ -4497,10 +4516,12 @@ $inputXML = '<Window x:Class="WinUtility.MainWindow"
<Button Name="WPFPanelsystem" FontSize="14" Content="System Properties" HorizontalAlignment = "Left" Margin="5" Padding="20,5" Width="200"/>
<Button Name="WPFPaneluser" FontSize="14" Content="User Accounts" HorizontalAlignment = "Left" Margin="5" Padding="20,5" Width="200"/>
</StackPanel>
</Border>
</Grid>
</Border>
</Grid>
</ScrollViewer>
</TabItem>
<TabItem Header="Updates" Visibility="Collapsed" Name="WPFTab4">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<Grid Background="Transparent">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
@ -4525,10 +4546,12 @@ $inputXML = '<Window x:Class="WinUtility.MainWindow"
<TextBlock Margin="20,0,20,0" Padding="10" TextWrapping="WrapWithOverflow" MaxWidth="300">This completely disables ALL Windows Updates and is NOT RECOMMENDED.<LineBreak/><LineBreak/> However, it can be suitable if you use your system for a select purpose and do not actively browse the internet. <LineBreak/><LineBreak/>Note: Your system will be easier to hack and infect without security updates.</TextBlock>
<TextBlock Text=" " Margin="20,0,20,0" Padding="10" TextWrapping="WrapWithOverflow" MaxWidth="300"/>
</StackPanel>
</Border>
</Grid>
</Border>
</Grid>
</ScrollViewer>
</TabItem>
<TabItem Header="MicroWin" Visibility="Collapsed" Name="WPFTab5" Width="Auto" Height="Auto">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<Grid Width="Auto" Height="Auto">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
@ -4669,10 +4692,11 @@ $inputXML = '<Window x:Class="WinUtility.MainWindow"
| |-- Driver2.inf
| |-- Driver2.sys
|-- OtherFiles...
</TextBlock>
</StackPanel>
</Border>
</Grid>
</TextBlock>
</StackPanel>
</Border>
</Grid>
</ScrollViewer>
</TabItem>
</TabControl>
</Grid>

View File

@ -571,12 +571,15 @@
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" FontFamily="Segoe MDL2 Assets"
FontSize="14" Margin="16,0,0,0">&#xE721;</TextBlock>
</Grid>
<TextBlock Text="Version: CTTVersion" VerticalAlignment="Center" HorizontalAlignment="Center"
Margin="10,0,0,0"/>
<Button Content="&#xD7;" BorderThickness="0"
BorderBrush="Transparent"
Background="{MainBackgroundColor}"
HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,5,5,0"
FontFamily="Arial"
Foreground="{MainForegroundColor}" FontSize="18" Name="WPFCloseButton" />
</DockPanel>
<TabControl Name="WPFTabNav" Background="Transparent" Width="Auto" Height="Auto" BorderBrush="Transparent" BorderThickness="0" Grid.Row="1" Grid.Column="0" Padding="-1">
@ -641,6 +644,7 @@
</Grid>
</TabItem>
<TabItem Header="Tweaks" Visibility="Collapsed" Name="WPFTab2">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<Grid Background="Transparent">
<Grid.ColumnDefinitions>
<ColumnDefinition Width=".50*"/>
@ -767,10 +771,12 @@
</StackPanel> <!-- End of Customize Preferences Section -->
</Border>
</Grid>
</Border>
</Grid>
</ScrollViewer>
</TabItem>
<TabItem Header="Config" Visibility="Collapsed" Name="WPFTab3">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<Grid Background="Transparent">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
@ -805,10 +811,12 @@
<Button Name="WPFPanelsystem" FontSize="14" Content="System Properties" HorizontalAlignment = "Left" Margin="5" Padding="20,5" Width="200"/>
<Button Name="WPFPaneluser" FontSize="14" Content="User Accounts" HorizontalAlignment = "Left" Margin="5" Padding="20,5" Width="200"/>
</StackPanel>
</Border>
</Grid>
</Border>
</Grid>
</ScrollViewer>
</TabItem>
<TabItem Header="Updates" Visibility="Collapsed" Name="WPFTab4">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<Grid Background="Transparent">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
@ -833,10 +841,12 @@
<TextBlock Margin="20,0,20,0" Padding="10" TextWrapping="WrapWithOverflow" MaxWidth="300">This completely disables ALL Windows Updates and is NOT RECOMMENDED.<LineBreak/><LineBreak/> However, it can be suitable if you use your system for a select purpose and do not actively browse the internet. <LineBreak/><LineBreak/>Note: Your system will be easier to hack and infect without security updates.</TextBlock>
<TextBlock Text=" " Margin="20,0,20,0" Padding="10" TextWrapping="WrapWithOverflow" MaxWidth="300"/>
</StackPanel>
</Border>
</Grid>
</Border>
</Grid>
</ScrollViewer>
</TabItem>
<TabItem Header="MicroWin" Visibility="Collapsed" Name="WPFTab5" Width="Auto" Height="Auto">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<Grid Width="Auto" Height="Auto">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
@ -977,10 +987,11 @@
| |-- Driver2.inf
| |-- Driver2.sys
|-- OtherFiles...
</TextBlock>
</StackPanel>
</Border>
</Grid>
</TextBlock>
</StackPanel>
</Border>
</Grid>
</ScrollViewer>
</TabItem>
</TabControl>
</Grid>