mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-11-14 06:35:51 -06:00
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:
parent
771c268130
commit
a2b12ae4b0
@ -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 {
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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
|
||||
|
32
winutil.ps1
32
winutil.ps1
@ -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"></TextBlock>
|
||||
</Grid>
|
||||
<TextBlock Text="Version: 24.01.03" VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
Margin="10,0,0,0"/>
|
||||
<Button Content="×" 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*"/>
|
||||
@ -4461,8 +4478,10 @@ $inputXML = '<Window x:Class="WinUtility.MainWindow"
|
||||
</StackPanel> <!-- End of Customize Preferences Section -->
|
||||
</Border>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
<TabItem Header="Config" Visibility="Collapsed" Name="WPFTab3">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<Grid Background="Transparent">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
@ -4499,8 +4518,10 @@ $inputXML = '<Window x:Class="WinUtility.MainWindow"
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
<TabItem Header="Updates" Visibility="Collapsed" Name="WPFTab4">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<Grid Background="Transparent">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
@ -4527,8 +4548,10 @@ $inputXML = '<Window x:Class="WinUtility.MainWindow"
|
||||
</StackPanel>
|
||||
</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="*"/>
|
||||
@ -4673,6 +4696,7 @@ $inputXML = '<Window x:Class="WinUtility.MainWindow"
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</Grid>
|
||||
|
@ -571,12 +571,15 @@
|
||||
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" FontFamily="Segoe MDL2 Assets"
|
||||
FontSize="14" Margin="16,0,0,0"></TextBlock>
|
||||
</Grid>
|
||||
<TextBlock Text="Version: CTTVersion" VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
Margin="10,0,0,0"/>
|
||||
<Button Content="×" 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*"/>
|
||||
@ -769,8 +773,10 @@
|
||||
</StackPanel> <!-- End of Customize Preferences Section -->
|
||||
</Border>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
<TabItem Header="Config" Visibility="Collapsed" Name="WPFTab3">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<Grid Background="Transparent">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
@ -807,8 +813,10 @@
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
<TabItem Header="Updates" Visibility="Collapsed" Name="WPFTab4">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<Grid Background="Transparent">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
@ -835,8 +843,10 @@
|
||||
</StackPanel>
|
||||
</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="*"/>
|
||||
@ -981,6 +991,7 @@
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</Grid>
|
||||
|
Loading…
Reference in New Issue
Block a user