diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 2520c8d3..c75d8a2a 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -2,7 +2,7 @@ name: Bug report about: Create a report to help us improve title: '' -labels: '' +labels: 'bug' assignees: '' --- diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index a6f653e0..a614d708 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -2,7 +2,7 @@ name: Feature request about: Suggest an idea for this project title: '' -labels: '' +labels: 'enhancement' assignees: '' --- diff --git a/Compile.ps1 b/Compile.ps1 index 6f7a0313..afbe943d 100644 --- a/Compile.ps1 +++ b/Compile.ps1 @@ -1,7 +1,8 @@ param ( [switch]$Debug, [switch]$Run, - [switch]$SkipPreprocessing + [switch]$SkipPreprocessing, + [string]$Arguments ) $OFS = "`r`n" $scriptname = "winutil.ps1" @@ -118,10 +119,12 @@ catch { Write-Progress -Activity "Validating" -Completed if ($run) { - try { - Start-Process -FilePath "pwsh" -ArgumentList "$workingdir\$scriptname" - } catch { - Start-Process -FilePath "powershell" -ArgumentList "$workingdir\$scriptname" - } + $script = "& '$workingdir\$scriptname' $Arguments" + $powershellcmd = if (Get-Command pwsh -ErrorAction SilentlyContinue) { "pwsh" } else { "powershell" } + $processCmd = if (Get-Command wt.exe -ErrorAction SilentlyContinue) { "wt.exe" } else { $powershellcmd } + + Start-Process $processCmd -ArgumentList "$powershellcmd -NoProfile -Command $script" + + break } diff --git a/README.md b/README.md index adb2ab9b..230a5523 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ If you have Issues, refer to [Known Issues](https://christitustech.github.io/win These are the sponsors that help keep this project alive with monthly contributions. -Yusuke SaitoTriHyderaMark AmosJason A. DiegmuellerwyattStefanthaddlPaulDave JonesAnthony MendezMichael WozniakxPandakuClaudemodsHalil KolatanTimothy Cook +Yusuke SaitoTriHyderaMark AmosJason A. DiegmuellerwyattStefanthaddlPaulDave JonesAnthony MendezMichael WozniakxPandakuClaudemodsHalil KolatanTimothy CookMax ## 🏅 Thanks to all Contributors Thanks a lot for spending your time helping Winutil grow. Thanks a lot! Keep rocking 🍻. diff --git a/config/themes.json b/config/themes.json index efada878..eedb2f83 100644 --- a/config/themes.json +++ b/config/themes.json @@ -6,7 +6,7 @@ "CustomDialogWidth": "400", "CustomDialogHeight": "200", - "FontSize": "14", + "FontSize": "12", "FontFamily": "Arial", "FontSizeHeading": "16", "HeaderFontFamily": "Consolas, Monaco", @@ -26,6 +26,7 @@ "CloseIconFontSize": "18", "MicroWinLogoSize": "10", + "MicrowinCheckBoxMargin": "-10,5,0,0", "ProgressBarForegroundColor": "#FFAC1C", "ProgressBarBackgroundColor": "Transparent", diff --git a/functions/public/Invoke-WPFGetIso.ps1 b/functions/public/Invoke-WPFGetIso.ps1 index 9a0b7455..31a37e4f 100644 --- a/functions/public/Invoke-WPFGetIso.ps1 +++ b/functions/public/Invoke-WPFGetIso.ps1 @@ -114,7 +114,7 @@ function Invoke-WPFGetIso { # @ChrisTitusTech please copy this wiki and change the link below to your copy of the wiki Write-Error "Failed to mount the image. Error: $($_.Exception.Message)" Write-Error "This is NOT winutil's problem, your ISO might be corrupt, or there is a problem on the system" - Write-Error "Please refer to this wiki for more details https://github.com/ChrisTitusTech/winutil/blob/main/wiki/Error-in-Winutil-MicroWin-during-ISO-mounting%2Cmd" + Write-Host "Please refer to this wiki for more details: https://christitustech.github.io/winutil/KnownIssues/#troubleshoot-errors-during-microwin-usage" -ForegroundColor Red Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning" return } diff --git a/functions/public/Invoke-WPFImpex.ps1 b/functions/public/Invoke-WPFImpex.ps1 index 43d835de..d97f025e 100644 --- a/functions/public/Invoke-WPFImpex.ps1 +++ b/functions/public/Invoke-WPFImpex.ps1 @@ -57,6 +57,7 @@ function Invoke-WPFImpex { } } + $flattenedJson = [string]$flattenedJson Invoke-WPFPresets -preset $flattenedJson -imported $true } } diff --git a/scripts/main.ps1 b/scripts/main.ps1 index a18ed0b9..0d706c32 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -439,6 +439,12 @@ $sync["SearchBar"].Add_TextChanged({ } }) +$sync["Form"].Add_Loaded({ + param($e) + $sync["Form"].MaxWidth = [Double]::PositiveInfinity + $sync["Form"].MaxHeight = [Double]::PositiveInfinity +}) + # Initialize the hashtable $winutildir = @{} diff --git a/scripts/start.ps1 b/scripts/start.ps1 index 0d070cd0..c289709c 100644 --- a/scripts/start.ps1 +++ b/scripts/start.ps1 @@ -5,6 +5,7 @@ GitHub : https://github.com/ChrisTitusTech Version : #{replaceme} #> + param ( [switch]$Debug, [string]$Config, @@ -27,12 +28,6 @@ if ($Run) { $PARAM_RUN = $true } -$dateTime = Get-Date -Format "yyyy-MM-dd_HH-mm-ss" - -$logdir = "$env:localappdata\winutil\logs" -[System.IO.Directory]::CreateDirectory("$logdir") -Start-Transcript -Path "$logdir\winutil_$dateTime.log" -Append - # Load DLLs Add-Type -AssemblyName PresentationFramework Add-Type -AssemblyName System.Windows.Forms @@ -46,8 +41,22 @@ $sync.ProcessRunning = $false if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { Write-Output "Winutil needs to be run as Administrator. Attempting to relaunch." + $argList = @() + + $PSBoundParameters.GetEnumerator() | ForEach-Object { + $argList += if ($_.Value -is [switch] -and $_.Value) { + "-$($_.Key)" + } elseif ($_.Value) { + "-$($_.Key) `"$($_.Value)`"" + } + } + + $script = if ($MyInvocation.MyCommand.Path) { + "& { & '$($MyInvocation.MyCommand.Path)' $argList }" + } else { + "iex '& { $(irm https://github.com/ChrisTitusTech/winutil/releases/latest/download/winutil.ps1) } $argList'" + } - $script = if ($MyInvocation.MyCommand.Path) { "& '" + $MyInvocation.MyCommand.Path + "'" } else { "irm 'https://github.com/ChrisTitusTech/winutil/releases/latest/download/winutil.ps1' | iex"} $powershellcmd = if (Get-Command pwsh -ErrorAction SilentlyContinue) { "pwsh" } else { "powershell" } $processCmd = if (Get-Command wt.exe -ErrorAction SilentlyContinue) { "wt.exe" } else { $powershellcmd } @@ -56,6 +65,12 @@ if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]: break } +$dateTime = Get-Date -Format "yyyy-MM-dd_HH-mm-ss" + +$logdir = "$env:localappdata\winutil\logs" +[System.IO.Directory]::CreateDirectory("$logdir") | Out-Null +Start-Transcript -Path "$logdir\winutil_$dateTime.log" -Append -NoClobber | Out-Null + # Set PowerShell window title $Host.UI.RawUI.WindowTitle = $myInvocation.MyCommand.Definition + "(Admin)" clear-host diff --git a/xaml/inputXML.xaml b/xaml/inputXML.xaml index b6097a17..8094af4a 100644 --- a/xaml/inputXML.xaml +++ b/xaml/inputXML.xaml @@ -9,7 +9,11 @@ WindowStartupLocation="CenterScreen" UseLayoutRounding="True" WindowStyle="None" - Title="Chris Titus Tech's Windows Utility" Height="800" Width="1280"> + Width="Auto" + Height="Auto" + MaxWidth="1280" + MaxHeight="800" + Title="Chris Titus Tech's Windows Utility"> @@ -689,10 +693,10 @@ - - - - + + + + - -