From 83ea3eb82cec3e516388b7ae362050cf6e2b4226 Mon Sep 17 00:00:00 2001 From: KonTy <9524513+KonTy@users.noreply.github.com> Date: Mon, 3 Jun 2024 18:42:54 -0700 Subject: [PATCH] Fix scratch textbox bug * Fix scratch textbox bug * Fixing Microwin, no more errors and it creats image now without issues --- functions/public/Invoke-WPFGetIso.ps1 | 6 +--- functions/public/Invoke-WPFMicrowin.ps1 | 37 +++++++++++++------------ xaml/inputXML.xaml | 35 ++++++++++++++--------- 3 files changed, 42 insertions(+), 36 deletions(-) diff --git a/functions/public/Invoke-WPFGetIso.ps1 b/functions/public/Invoke-WPFGetIso.ps1 index 483c494a..9e762d74 100644 --- a/functions/public/Invoke-WPFGetIso.ps1 +++ b/functions/public/Invoke-WPFGetIso.ps1 @@ -12,7 +12,7 @@ function Invoke-WPFGetIso { return } - $sync.BusyMessage.Visibility="Visible" + $sync.BusyMessage.Visibility="Visible" $sync.BusyText.Text="N Busy" @@ -23,10 +23,6 @@ function Invoke-WPFGetIso { Write-Host "\/ \/|_| \___||_| \___/ \/ \/ |_||_| |_| " $oscdimgPath = Join-Path $env:TEMP 'oscdimg.exe' - if( ! (Test-Path $oscdimgPath -PathType Leaf) ) { - $oscdimgPath = Join-Path '.\releases\' 'oscdimg.exe' -} - $oscdImgFound = [bool] (Get-Command -ErrorAction Ignore -Type Application oscdimg.exe) -or (Test-Path $oscdimgPath -PathType Leaf) Write-Host "oscdimg.exe on system: $oscdImgFound" diff --git a/functions/public/Invoke-WPFMicrowin.ps1 b/functions/public/Invoke-WPFMicrowin.ps1 index 564a836a..6a817cf7 100644 --- a/functions/public/Invoke-WPFMicrowin.ps1 +++ b/functions/public/Invoke-WPFMicrowin.ps1 @@ -244,26 +244,27 @@ public class PowerManagement { $desktopDir = "$($scratchDir)\Windows\Users\Default\Desktop" New-Item -ItemType Directory -Force -Path "$desktopDir" dism /English /image:$($scratchDir) /set-profilepath:"$($scratchDir)\Windows\Users\Default" - $command = "powershell.exe -NoProfile -ExecutionPolicy Bypass -Command 'irm https://christitus.com/win | iex'" - $shortcutPath = "$desktopDir\WinUtil.lnk" - $shell = New-Object -ComObject WScript.Shell - $shortcut = $shell.CreateShortcut($shortcutPath) - if (Test-Path -Path "$env:TEMP\cttlogo.png") - { - $pngPath = "$env:TEMP\cttlogo.png" - $icoPath = "$env:TEMP\cttlogo.ico" - ConvertTo-Icon -bitmapPath $pngPath -iconPath $icoPath - Write-Host "ICO file created at: $icoPath" - Copy-Item "$env:TEMP\cttlogo.png" "$($scratchDir)\Windows\cttlogo.png" -force - Copy-Item "$env:TEMP\cttlogo.ico" "$($scratchDir)\Windows\cttlogo.ico" -force - $shortcut.IconLocation = "c:\Windows\cttlogo.ico" - } + # $command = "powershell.exe -NoProfile -ExecutionPolicy Bypass -Command 'irm https://christitus.com/win | iex'" + # $shortcutPath = "$desktopDir\WinUtil.lnk" + # $shell = New-Object -ComObject WScript.Shell + # $shortcut = $shell.CreateShortcut($shortcutPath) - $shortcut.TargetPath = "powershell.exe" - $shortcut.Arguments = "-NoProfile -ExecutionPolicy Bypass -Command `"$command`"" - $shortcut.Save() - Write-Host "Shortcut to winutil created at: $shortcutPath" + # if (Test-Path -Path "$env:TEMP\cttlogo.png") + # { + # $pngPath = "$env:TEMP\cttlogo.png" + # $icoPath = "$env:TEMP\cttlogo.ico" + # ConvertTo-Icon -bitmapPath $pngPath -iconPath $icoPath + # Write-Host "ICO file created at: $icoPath" + # Copy-Item "$env:TEMP\cttlogo.png" "$($scratchDir)\Windows\cttlogo.png" -force + # Copy-Item "$env:TEMP\cttlogo.ico" "$($scratchDir)\Windows\cttlogo.ico" -force + # $shortcut.IconLocation = "c:\Windows\cttlogo.ico" + # } + + # $shortcut.TargetPath = "powershell.exe" + # $shortcut.Arguments = "-NoProfile -ExecutionPolicy Bypass -Command `"$command`"" + # $shortcut.Save() + # Write-Host "Shortcut to winutil created at: $shortcutPath" # *************************** Automation black *************************** Write-Host "Copy checkinstall.cmd into the ISO" diff --git a/xaml/inputXML.xaml b/xaml/inputXML.xaml index 5ab073b5..e9deea6a 100644 --- a/xaml/inputXML.xaml +++ b/xaml/inputXML.xaml @@ -772,20 +772,29 @@ - - + Text="Scratch" + Margin="2" + IsReadOnly="False" + ToolTip="Alt Path For Scratch Directory" + Grid.Column="0" + VerticalAlignment="Center" + Foreground="{LabelboxForegroundColor}"> + + +