mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-06-27 16:44:46 -05:00
Test 2023 12 19 (#1294)
* Compile Winutil * Issue #1283, #1280 fixes, more (#1288) * Explorer Fix * Wifi, Explorer Crash, WinUtil Icon fixes. First attempt at white theme * White theme * Fix for clashing microwin directories if process fails, now new directory will be generated * * Tested latest Windows 10 (22H2) images work fine * Made dialog box more clear for issue #1283 * Added better logic for handling takeown /D flag for different locals issue #1280 * Refreshed the UI to more modern look * Improved white theme * Regrouped Tweak tab to make more sense * Advanced tweaks were in a separate column but the button applied both Essential and advanced now they are in the same column and button applies both * All instant action buttons were moved to Customize preferences column * Explorer lockup Fix * Wifi, Explorer Crash, WinUtil Icon fixes. * Fix for clashing microwin directories if process fails, now new directory will be generated * Merge all * Theme improvement, adding icon to the shortcut * Ability to download oscdimg from github, reorginizing Apps to fit better on more (smaller screens) * Fixing release branch to WinUtil * Adding double click to fullscreen * Update Get-Oscdimg.ps1 --------- Co-authored-by: KonTy <KonTy@github.com> Co-authored-by: Chris Titus <contact@christitus.com> * Update winutil.ps1 * remove merc and thorium * Ashlyn Programs * Also inject drivers into boot.wim * copy #1291 new branch --------- Co-authored-by: ChrisTitusTech <ChrisTitusTech@users.noreply.github.com> Co-authored-by: KonTy <9524513+KonTy@users.noreply.github.com> Co-authored-by: KonTy <KonTy@github.com> Co-authored-by: Cedric Lewe <0skillallluck@pm.me>
This commit is contained in:
27
functions/private/ConvertTo-Icon.ps1
Normal file
27
functions/private/ConvertTo-Icon.ps1
Normal file
@ -0,0 +1,27 @@
|
||||
function ConvertTo-Icon {
|
||||
<#
|
||||
|
||||
.DESCRIPTION
|
||||
This function will convert PNG to ICO file
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-Icon -bitmapPath "$env:TEMP\cttlogo.png" -iconPath $iconPath
|
||||
#>
|
||||
param( [Parameter(Mandatory=$true)]
|
||||
$bitmapPath,
|
||||
$iconPath = "$env:temp\newicon.ico"
|
||||
)
|
||||
|
||||
Add-Type -AssemblyName System.Drawing
|
||||
|
||||
if (Test-Path $bitmapPath) {
|
||||
$b = [System.Drawing.Bitmap]::FromFile($bitmapPath)
|
||||
$icon = [System.Drawing.Icon]::FromHandle($b.GetHicon())
|
||||
$file = New-Object System.IO.FileStream($iconPath, 'OpenOrCreate')
|
||||
$icon.Save($file)
|
||||
$file.Close()
|
||||
$icon.Dispose()
|
||||
#explorer "/SELECT,$iconpath"
|
||||
}
|
||||
else { Write-Warning "$BitmapPath does not exist" }
|
||||
}
|
@ -13,17 +13,27 @@ function Get-LocalizedYesNo {
|
||||
#>
|
||||
|
||||
# Run takeown.exe and capture its output
|
||||
$takeownOutput = & takeown.exe /? | Out-String
|
||||
$takeownOutput = & takeown.exe /? | Out-String
|
||||
|
||||
# Parse the output and retrieve lines until there are at least 2 characters in the array
|
||||
$found = $false
|
||||
$charactersArray = @()
|
||||
foreach ($line in $takeownOutput -split "`r`n")
|
||||
{
|
||||
# skip everything before /D flag help
|
||||
if ($found)
|
||||
{
|
||||
$characters = $line -split '(")([A-Za-z])(")' | Where-Object { $_ -match '^[A-Za-z]$' }
|
||||
$charactersArray += $characters
|
||||
# now that /D is found start looking for a single character in double quotes
|
||||
# in help text there is another string in double quotes but it is not a single character
|
||||
$regexPattern = '"([a-zA-Z])"'
|
||||
|
||||
$charactersArray = [regex]::Matches($line, $regexPattern) | ForEach-Object { $_.Groups[1].Value }
|
||||
|
||||
# if ($charactersArray.Count -gt 0) {
|
||||
# Write-Output "Extracted symbols: $($matches -join ', ')"
|
||||
# } else {
|
||||
# Write-Output "No matches found."
|
||||
# }
|
||||
|
||||
if ($charactersArray.Count -ge 2)
|
||||
{
|
||||
|
28
functions/private/Get-Oscdimg.ps1
Normal file
28
functions/private/Get-Oscdimg.ps1
Normal file
@ -0,0 +1,28 @@
|
||||
function Get-Oscdimg {
|
||||
<#
|
||||
|
||||
.DESCRIPTION
|
||||
This function will get oscdimg file for from github Release foldersand put it into env:temp
|
||||
|
||||
.EXAMPLE
|
||||
Get-Oscdimg
|
||||
#>
|
||||
param( [Parameter(Mandatory=$true)]
|
||||
$oscdimgPath = "$env:TEMP\oscdimg.exe"
|
||||
)
|
||||
|
||||
$githubUserName = "ChrisTitusTech"
|
||||
$downloadUrl = "https://github.com/$githubUserName/winutil/releases/oscdimg.exe"
|
||||
Invoke-RestMethod -Uri $downloadUrl -OutFile $oscdimgPath
|
||||
$hashResult = Get-FileHash -Path $oscdimgPath -Algorithm SHA256
|
||||
$sha256Hash = $hashResult.Hash
|
||||
|
||||
Write-Host "[INFO] oscdimg.exe SHA-256 Hash: $sha256Hash"
|
||||
|
||||
$expectedHash = "F62B91A06F94019A878DD9D1713FFBA2140B863C131EB78A329B4CCD6102960E" # Replace with the actual expected hash
|
||||
if ($sha256Hash -eq $expectedHash) {
|
||||
Write-Host "Hashes match. File is verified."
|
||||
} else {
|
||||
Write-Host "Hashes do not match. File may be corrupted or tampered with."
|
||||
}
|
||||
}
|
@ -147,6 +147,7 @@ function Remove-FileOrDirectory([string] $pathToDelete, [string] $mask = "", [sw
|
||||
if (-not (Test-Path -Path "$($pathToDelete)")) { return }
|
||||
|
||||
$yesNo = Get-LocalizedYesNo
|
||||
Write-Host "[INFO] In Your local takeown expects '$($yesNo[0])' as a Yes answer."
|
||||
|
||||
# Specify the path to the directory
|
||||
# $directoryPath = "$($scratchDir)\Windows\System32\LogFiles\WMI\RtBackup"
|
||||
|
Reference in New Issue
Block a user