From 6a99be9e05108e3b6b7af4ace7c4cfa119dddfa5 Mon Sep 17 00:00:00 2001 From: MyDrift Date: Thu, 29 Aug 2024 00:02:00 +0200 Subject: [PATCH 01/33] Improve Transcript (#2620) * improve log logics * spelling fix * change date format --- functions/private/Update-WinUtilProgramWinget.ps1 | 2 +- scripts/start.ps1 | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/functions/private/Update-WinUtilProgramWinget.ps1 b/functions/private/Update-WinUtilProgramWinget.ps1 index 0784657d22..7f50d35e6c 100644 --- a/functions/private/Update-WinUtilProgramWinget.ps1 +++ b/functions/private/Update-WinUtilProgramWinget.ps1 @@ -11,7 +11,7 @@ Function Update-WinUtilProgramWinget { $host.ui.RawUI.WindowTitle = """Winget Install""" - Start-Transcript $ENV:TEMP\winget-update.log -Append + Start-Transcript "$logdir\winget-update_$dateTime.log" -Append winget upgrade --all --accept-source-agreements --accept-package-agreements --scope=machine --silent } diff --git a/scripts/start.ps1 b/scripts/start.ps1 index 06e53b69d2..0d070cd01c 100644 --- a/scripts/start.ps1 +++ b/scripts/start.ps1 @@ -27,11 +27,11 @@ if ($Run) { $PARAM_RUN = $true } -if (!(Test-Path -Path $ENV:TEMP)) { - New-Item -ItemType Directory -Force -Path $ENV:TEMP -} +$dateTime = Get-Date -Format "yyyy-MM-dd_HH-mm-ss" -Start-Transcript $ENV:TEMP\Winutil.log -Append +$logdir = "$env:localappdata\winutil\logs" +[System.IO.Directory]::CreateDirectory("$logdir") +Start-Transcript -Path "$logdir\winutil_$dateTime.log" -Append # Load DLLs Add-Type -AssemblyName PresentationFramework From ece57f8ee2c3708859caa47db7e74d25416d99dd Mon Sep 17 00:00:00 2001 From: Real-MullaC Date: Thu, 29 Aug 2024 01:52:16 +0100 Subject: [PATCH 02/33] Update main.html to say no apps on PR's (#2623) --- overrides/main.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/overrides/main.html b/overrides/main.html index f5f0eb399f..9038d3e90a 100644 --- a/overrides/main.html +++ b/overrides/main.html @@ -1,5 +1,12 @@ {% extends "base.html" %} +{% block header %} + {{ super() }} +
+ Announcement: We are currently not adding any applicatiosn to WinUtil and any apps that will be added through a PR will be declined by the maintainer. +
+{% endblock %} + {% block footer %} {# Empty block to override the footer #} {% endblock %} From 90ddfb02a40389d5c33758599a6b88c158075857 Mon Sep 17 00:00:00 2001 From: MyDrift Date: Thu, 29 Aug 2024 02:58:05 +0200 Subject: [PATCH 03/33] Toggle + Checkbox styling (#2617) * restyle toggle + add animation + change check to blue * use mainforegroundcolor for toggle label --- functions/public/Invoke-WPFUIElements.ps1 | 1 + xaml/inputXML.xaml | 37 ++++++++++++++++++++--- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/functions/public/Invoke-WPFUIElements.ps1 b/functions/public/Invoke-WPFUIElements.ps1 index 2319d6fe5a..f8e9c7ba00 100644 --- a/functions/public/Invoke-WPFUIElements.ps1 +++ b/functions/public/Invoke-WPFUIElements.ps1 @@ -186,6 +186,7 @@ function Invoke-WPFUIElements { $label.ToolTip = $entryInfo.Description $label.HorizontalAlignment = "Left" $label.FontSize = $theme.FontSize + $label.Foreground = $theme.MainForegroundColor $dockPanel.Children.Add($label) | Out-Null $stackPanel.Children.Add($dockPanel) | Out-Null diff --git a/xaml/inputXML.xaml b/xaml/inputXML.xaml index db4be1a9bf..827017f101 100644 --- a/xaml/inputXML.xaml +++ b/xaml/inputXML.xaml @@ -315,7 +315,7 @@ Margin="2" SnapsToDevicePixels="True"/> @@ -427,7 +427,11 @@ Width="34" Height="17"> + HorizontalAlignment="Left" Width="10.8" + RenderTransformOrigin="0.5, 0.5"> + + + @@ -438,12 +442,35 @@ + + + + + + + + + + + + + + + + - - - + + From be6b5b3aa0dccb361d52d63351396b2e06e79b39 Mon Sep 17 00:00:00 2001 From: "Mr.k" Date: Thu, 29 Aug 2024 04:02:59 +0300 Subject: [PATCH 04/33] Improve 'Invoke-WPFPresets' Public Function - Made applying tweaks presets go blazingly fast - Made Clearing Selection work properly (#2608) * Improve 'Invoke-WPFPresets.ps1' Public Function as well as Simple Optimizations * Simple Optimization by providing more info to 'Invoke-WPFPresets.ps1' function calls inside 'Invoke-WPFButton.ps1' * Fix some logic issue in 'Invoke-WPFPresets.ps1' Public Function * Rename Button Names to more clear and Make them follow CamelCase Naming --- functions/public/Invoke-WPFButton.ps1 | 12 +++++----- functions/public/Invoke-WPFPresets.ps1 | 31 ++++++++++++++++---------- xaml/inputXML.xaml | 6 ++--- 3 files changed, 28 insertions(+), 21 deletions(-) diff --git a/functions/public/Invoke-WPFButton.ps1 b/functions/public/Invoke-WPFButton.ps1 index ac5b2f8cdb..e3015f09e0 100644 --- a/functions/public/Invoke-WPFButton.ps1 +++ b/functions/public/Invoke-WPFButton.ps1 @@ -21,13 +21,13 @@ function Invoke-WPFButton { Switch -Wildcard ($Button) { "WPFTab?BT" {Invoke-WPFTab $Button} - "WPFinstall" {Invoke-WPFInstall} - "WPFuninstall" {Invoke-WPFUnInstall} + "WPFInstall" {Invoke-WPFInstall} + "WPFUninstall" {Invoke-WPFUnInstall} "WPFInstallUpgrade" {Invoke-WPFInstallUpgrade} - "WPFstandard" {Invoke-WPFPresets "Standard"} - "WPFminimal" {Invoke-WPFPresets "Minimal"} - "WPFclear" {Invoke-WPFPresets -preset $null -imported $true} - "WPFclearWinget" {Invoke-WPFPresets -preset $null -imported $true -CheckBox "WPFInstall"} + "WPFStandard" {Invoke-WPFPresets "Standard" -checkboxfilterpattern "WPFTweak*"} + "WPFMinimal" {Invoke-WPFPresets "Minimal" -checkboxfilterpattern "WPFTweak*"} + "WPFClearTweaksSelection" {Invoke-WPFPresets -imported $true -checkboxfilterpattern "WPFTweak*"} + "WPFClearInstallSelection" {Invoke-WPFPresets -imported $true -checkboxfilterpattern "WPFInstall*"} "WPFtweaksbutton" {Invoke-WPFtweaksbutton} "WPFOOSUbutton" {Invoke-WPFOOSU} "WPFAddUltPerf" {Invoke-WPFUltimatePerformance -State "Enable"} diff --git a/functions/public/Invoke-WPFPresets.ps1 b/functions/public/Invoke-WPFPresets.ps1 index 1595a8f103..90493899c7 100644 --- a/functions/public/Invoke-WPFPresets.ps1 +++ b/functions/public/Invoke-WPFPresets.ps1 @@ -10,29 +10,36 @@ function Invoke-WPFPresets { .PARAMETER imported If the preset is imported from a file, defaults to false - .PARAMETER checkbox - The checkbox to set the options to, defaults to 'WPFTweaks' + .PARAMETER checkboxfilterpattern + The Pattern to use when filtering through CheckBoxes, defaults to "**" #> - param( - $preset, - [bool]$imported = $false + param ( + [Parameter(position=0)] + [string]$preset = "", + + [Parameter(position=1)] + [bool]$imported = $false, + + [Parameter(position=2)] + [string]$checkboxfilterpattern = "**" ) - if($imported -eq $true) { + if ($imported -eq $true) { $CheckBoxesToCheck = $preset } else { $CheckBoxesToCheck = $sync.configs.preset.$preset } - $CheckBoxes = $sync.GetEnumerator() | Where-Object { $_.Value -is [System.Windows.Controls.CheckBox] -and $_.Name -notlike "WPFToggle*" } - Write-Debug "Getting checkboxes to set $($CheckBoxes.Count)" + $CheckBoxes = ($sync.GetEnumerator()).where{ $_.Value -is [System.Windows.Controls.CheckBox] -and $_.Name -notlike "WPFToggle*" -and $_.Name -like "$checkboxfilterpattern"} + Write-Debug "Getting checkboxes to set, number of checkboxes: $($CheckBoxes.Count)" - $CheckBoxesToCheck | ForEach-Object { - if ($_ -ne $null) { - Write-Debug $_ - } + if ($CheckBoxesToCheck -ne "") { + $debugMsg = "CheckBoxes to Check are: " + $CheckBoxesToCheck | ForEach-Object { $debugMsg += "$_, " } + $debugMsg = $debugMsg -replace (',\s*$', '') + Write-Debug "$debugMsg" } foreach ($CheckBox in $CheckBoxes) { diff --git a/xaml/inputXML.xaml b/xaml/inputXML.xaml index 827017f101..5f82c3f0a4 100644 --- a/xaml/inputXML.xaml +++ b/xaml/inputXML.xaml @@ -814,11 +814,11 @@ -