mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-01-16 01:40:35 -06:00
Compare commits
No commits in common. "e7e742044b5808090255b7f794d487849dea0f67" and "cd35c74896af7f195e7e79e71f9b2b49759341ac" have entirely different histories.
e7e742044b
...
cd35c74896
BIN
docs/assets/check.png
Normal file
BIN
docs/assets/check.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 42 KiB |
@ -4,39 +4,27 @@ function Set-WinUtilTaskbaritem {
|
|||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Modifies the Taskbaritem of the WPF Form
|
Modifies the Taskbaritem of the WPF Form
|
||||||
|
|
||||||
|
.PARAMETER state
|
||||||
|
State can be 'None' > No progress, 'Indeterminate' > Without value, 'Normal' > when using value, 'Error' > Red (when using value), 'Paused' > Yellow (when using value)
|
||||||
.PARAMETER value
|
.PARAMETER value
|
||||||
Value can be between 0 and 1, 0 being no progress done yet and 1 being fully completed
|
Value can be between 0 and 1, 0 being no progress done yet and 1 being fully completed
|
||||||
Value does not affect item without setting the state to 'Normal', 'Error' or 'Paused'
|
|
||||||
Set-WinUtilTaskbaritem -value 0.5
|
|
||||||
|
|
||||||
.PARAMETER state
|
|
||||||
State can be 'None' > No progress, 'Indeterminate' > inf. loading gray, 'Normal' > Gray, 'Error' > Red, 'Paused' > Yellow
|
|
||||||
no value needed:
|
|
||||||
- Set-WinUtilTaskbaritem -state "None"
|
|
||||||
- Set-WinUtilTaskbaritem -state "Indeterminate"
|
|
||||||
value needed:
|
|
||||||
- Set-WinUtilTaskbaritem -state "Error"
|
|
||||||
- Set-WinUtilTaskbaritem -state "Normal"
|
|
||||||
- Set-WinUtilTaskbaritem -state "Paused"
|
|
||||||
|
|
||||||
.PARAMETER overlay
|
.PARAMETER overlay
|
||||||
Overlay icon to display on the taskbar item, there are the presets 'logo' and 'checkmark' or you can specify a path/link to an image file.
|
Overlay icon to display on the taskbar item
|
||||||
CTT logo preset:
|
|
||||||
- Set-WinUtilTaskbaritem -overlay "logo"
|
.EXAMPLE
|
||||||
Checkmark preset:
|
Set-WinUtilTaskbaritem -value 0.5 -state "Normal"
|
||||||
- Set-WinUtilTaskbaritem -overlay "checkmark"
|
Set-WinUtilTaskbaritem -state "Error"
|
||||||
Custom icon:
|
Set-WinUtilTaskbaritem -state "Indeterminate"
|
||||||
- Set-WinUtilTaskbaritem -overlay "C:\path\to\icon.png"
|
|
||||||
|
|
||||||
.PARAMETER description
|
|
||||||
Description to display on the taskbar item preview
|
|
||||||
Set-WinUtilTaskbaritem -description "This is a description"
|
Set-WinUtilTaskbaritem -description "This is a description"
|
||||||
|
Set-WinUtilTaskbaritem -overlay "C:\path\to\icon.png"
|
||||||
|
|
||||||
#>
|
#>
|
||||||
param (
|
param (
|
||||||
[string]$state,
|
|
||||||
[double]$value,
|
[double]$value,
|
||||||
[string]$overlay,
|
$state,
|
||||||
[string]$description
|
$overlay,
|
||||||
|
$description
|
||||||
)
|
)
|
||||||
|
|
||||||
if ($value) {
|
if ($value) {
|
||||||
@ -45,29 +33,37 @@ function Set-WinUtilTaskbaritem {
|
|||||||
|
|
||||||
if ($state) {
|
if ($state) {
|
||||||
switch ($state) {
|
switch ($state) {
|
||||||
'None' { $sync["Form"].taskbarItemInfo.ProgressState = "None" }
|
|
||||||
'Indeterminate' { $sync["Form"].taskbarItemInfo.ProgressState = "Indeterminate" }
|
'Indeterminate' { $sync["Form"].taskbarItemInfo.ProgressState = "Indeterminate" }
|
||||||
'Normal' { $sync["Form"].taskbarItemInfo.ProgressState = "Normal" }
|
'Normal' { $sync["Form"].taskbarItemInfo.ProgressState = "Normal" }
|
||||||
'Error' { $sync["Form"].taskbarItemInfo.ProgressState = "Error" }
|
'Error' { $sync["Form"].taskbarItemInfo.ProgressState = "Error" }
|
||||||
'Paused' { $sync["Form"].taskbarItemInfo.ProgressState = "Paused" }
|
'Paused' { $sync["Form"].taskbarItemInfo.ProgressState = "Paused" }
|
||||||
default { throw "[Set-WinUtilTaskbarItem] Invalid state" }
|
default { $sync["Form"].taskbarItemInfo.ProgressState = "None" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($overlay) {
|
if ($overlay -and (Test-Path $overlay)) {
|
||||||
switch ($overlay) {
|
# Read the image file as a byte array
|
||||||
'logo' {
|
$imageBytes = [System.IO.File]::ReadAllBytes($overlay)
|
||||||
$sync["Form"].taskbarItemInfo.Overlay = (ConvertTo-Bitmap -image "$env:LOCALAPPDATA\winutil\cttlogo.png")
|
|
||||||
}
|
# Convert the byte array to a Base64 string
|
||||||
'checkmark' {
|
[System.Convert]::ToBase64String($imageBytes)
|
||||||
$sync["Form"].taskbarItemInfo.Overlay = (ConvertTo-Bitmap -image "$env:LOCALAPPDATA\winutil\cttcheckmark.png")
|
|
||||||
}
|
# Load the image file as a bitmap
|
||||||
default {
|
$bitmap = [System.Drawing.Bitmap]::new($overlay)
|
||||||
if (Test-Path $overlay) {
|
|
||||||
$sync["Form"].taskbarItemInfo.Overlay = (ConvertTo-Bitmap -image $overlay)
|
# Create a streaming image by streaming the bitmap to a memory stream
|
||||||
}
|
$memoryStream = [System.IO.MemoryStream]::new()
|
||||||
}
|
$bitmap.Save($memoryStream, [System.Drawing.Imaging.ImageFormat]::Png)
|
||||||
}
|
$memoryStream.Position = 0
|
||||||
|
|
||||||
|
# Create a bitmap image from the memory stream
|
||||||
|
$bitmapImage = [System.Windows.Media.Imaging.BitmapImage]::new()
|
||||||
|
$bitmapImage.BeginInit()
|
||||||
|
$bitmapImage.StreamSource = $memoryStream
|
||||||
|
$bitmapImage.EndInit()
|
||||||
|
$bitmapImage.Freeze()
|
||||||
|
|
||||||
|
$sync["Form"].taskbarItemInfo.Overlay = $bitmapImage
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($description) {
|
if ($description) {
|
||||||
|
@ -1,31 +0,0 @@
|
|||||||
function ConvertTo-Bitmap {
|
|
||||||
<#
|
|
||||||
.SYNOPSIS
|
|
||||||
Converts an image file to a Bitmap object
|
|
||||||
|
|
||||||
.PARAMETER image
|
|
||||||
The path to the image file to convert
|
|
||||||
|
|
||||||
.EXAMPLE
|
|
||||||
ConvertTo-Bitmap -image "C:\path\to\image.png"
|
|
||||||
#>
|
|
||||||
param (
|
|
||||||
$image
|
|
||||||
)
|
|
||||||
|
|
||||||
# Read the image file as a byte array
|
|
||||||
$imageBytes = [System.IO.File]::ReadAllBytes($image)
|
|
||||||
|
|
||||||
# Convert the byte array to a Base64 string
|
|
||||||
$base64String = [System.Convert]::ToBase64String($imageBytes)
|
|
||||||
|
|
||||||
# Create a streaming image by streaming the base64 string to a bitmap streamsource
|
|
||||||
$bitmap = New-Object System.Windows.Media.Imaging.BitmapImage
|
|
||||||
$bitmap.BeginInit()
|
|
||||||
$bitmap.StreamSource = [System.IO.MemoryStream][System.Convert]::FromBase64String($base64String)
|
|
||||||
$bitmap.EndInit()
|
|
||||||
$bitmap.Freeze()
|
|
||||||
|
|
||||||
# Return the bitmap object
|
|
||||||
return $bitmap
|
|
||||||
}
|
|
@ -18,15 +18,15 @@ function Invoke-WPFFeatureInstall {
|
|||||||
param($Features, $DebugPreference)
|
param($Features, $DebugPreference)
|
||||||
$sync.ProcessRunning = $true
|
$sync.ProcessRunning = $true
|
||||||
if ($Features.count -eq 1){
|
if ($Features.count -eq 1){
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 })
|
||||||
} else {
|
} else {
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value 0.01 -overlay "logo" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value 0.01 })
|
||||||
}
|
}
|
||||||
|
|
||||||
Invoke-WinUtilFeatureInstall $Features
|
Invoke-WinUtilFeatureInstall $Features
|
||||||
|
|
||||||
$sync.ProcessRunning = $false
|
$sync.ProcessRunning = $false
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "None" -overlay "checkmark" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "None" -overlay "$env:TEMP\cttcheck.png" })
|
||||||
|
|
||||||
Write-Host "==================================="
|
Write-Host "==================================="
|
||||||
Write-Host "--- Features are Installed ---"
|
Write-Host "--- Features are Installed ---"
|
||||||
|
@ -89,7 +89,7 @@ function Invoke-WPFGetIso {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
Set-WinUtilTaskbaritem -state "Indeterminate" -overlay "logo"
|
Set-WinUtilTaskbaritem -state "Indeterminate"
|
||||||
|
|
||||||
# Detect the file size of the ISO and compare it with the free space of the system drive
|
# Detect the file size of the ISO and compare it with the free space of the system drive
|
||||||
$isoSize = (Get-Item -Path $filePath).Length
|
$isoSize = (Get-Item -Path $filePath).Length
|
||||||
@ -245,7 +245,7 @@ function Invoke-WPFGetIso {
|
|||||||
|
|
||||||
$sync.BusyMessage.Visibility="Hidden"
|
$sync.BusyMessage.Visibility="Hidden"
|
||||||
$sync.ProcessRunning = $false
|
$sync.ProcessRunning = $false
|
||||||
Set-WinUtilTaskbaritem -state "None" -overlay "checkmark"
|
Set-WinUtilTaskbaritem -state "None"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,9 +24,9 @@ function Invoke-WPFInstall {
|
|||||||
Invoke-WPFRunspace -ArgumentList $PackagesToInstall -DebugPreference $DebugPreference -ScriptBlock {
|
Invoke-WPFRunspace -ArgumentList $PackagesToInstall -DebugPreference $DebugPreference -ScriptBlock {
|
||||||
param($PackagesToInstall, $DebugPreference)
|
param($PackagesToInstall, $DebugPreference)
|
||||||
if ($PackagesToInstall.count -eq 1){
|
if ($PackagesToInstall.count -eq 1){
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 })
|
||||||
} else {
|
} else {
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value 0.01 -overlay "logo" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value 0.01 })
|
||||||
}
|
}
|
||||||
$packagesWinget, $packagesChoco = {
|
$packagesWinget, $packagesChoco = {
|
||||||
$packagesWinget = [System.Collections.Generic.List`1[System.Object]]::new()
|
$packagesWinget = [System.Collections.Generic.List`1[System.Object]]::new()
|
||||||
@ -58,7 +58,7 @@ function Invoke-WPFInstall {
|
|||||||
Write-Host "==========================================="
|
Write-Host "==========================================="
|
||||||
Write-Host "-- Installs have finished ---"
|
Write-Host "-- Installs have finished ---"
|
||||||
Write-Host "==========================================="
|
Write-Host "==========================================="
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "None" -overlay "checkmark" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "None" -overlay "$env:TEMP\cttcheck.png" })
|
||||||
}
|
}
|
||||||
Catch {
|
Catch {
|
||||||
Write-Host "==========================================="
|
Write-Host "==========================================="
|
||||||
@ -66,6 +66,7 @@ function Invoke-WPFInstall {
|
|||||||
Write-Host "==========================================="
|
Write-Host "==========================================="
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Error" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Error" })
|
||||||
}
|
}
|
||||||
|
Start-Sleep -Seconds 5
|
||||||
$sync.ProcessRunning = $False
|
$sync.ProcessRunning = $False
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,11 +40,10 @@ public class PowerManagement {
|
|||||||
|
|
||||||
if ($SaveDialog.FileName -eq "") {
|
if ($SaveDialog.FileName -eq "") {
|
||||||
Write-Host "No file name for the target image was specified"
|
Write-Host "No file name for the target image was specified"
|
||||||
Set-WinUtilTaskbaritem -state "Error" -value 1
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
Set-WinUtilTaskbaritem -state "Indeterminate" -overlay "logo"
|
Set-WinUtilTaskbaritem -state "Indeterminate"
|
||||||
|
|
||||||
Write-Host "Target ISO location: $($SaveDialog.FileName)"
|
Write-Host "Target ISO location: $($SaveDialog.FileName)"
|
||||||
|
|
||||||
@ -475,7 +474,7 @@ public class PowerManagement {
|
|||||||
#$msg = "Done. ISO image is located here: $env:temp\microwin.iso"
|
#$msg = "Done. ISO image is located here: $env:temp\microwin.iso"
|
||||||
$msg = "Done. ISO image is located here: $($SaveDialog.FileName)"
|
$msg = "Done. ISO image is located here: $($SaveDialog.FileName)"
|
||||||
Write-Host $msg
|
Write-Host $msg
|
||||||
Set-WinUtilTaskbaritem -state "None" -overlay "checkmark"
|
Set-WinUtilTaskbaritem -state "None"
|
||||||
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Information)
|
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Information)
|
||||||
} else {
|
} else {
|
||||||
Write-Host "ISO creation failed. The "$($mountDir)" directory has not been removed."
|
Write-Host "ISO creation failed. The "$($mountDir)" directory has not been removed."
|
||||||
@ -488,5 +487,6 @@ public class PowerManagement {
|
|||||||
# Allow the machine to sleep again (optional)
|
# Allow the machine to sleep again (optional)
|
||||||
[PowerManagement]::SetThreadExecutionState(0)
|
[PowerManagement]::SetThreadExecutionState(0)
|
||||||
$sync.ProcessRunning = $false
|
$sync.ProcessRunning = $false
|
||||||
|
Set-WinUtilTaskbaritem -state "None"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -27,6 +27,12 @@ function Invoke-WPFShortcut {
|
|||||||
$ArgumentsToSourceExe = "$powershell '$IRM'"
|
$ArgumentsToSourceExe = "$powershell '$IRM'"
|
||||||
$DestinationName = "WinUtil.lnk"
|
$DestinationName = "WinUtil.lnk"
|
||||||
|
|
||||||
|
Invoke-WebRequest -Uri "https://christitus.com/images/logo-full.png" -OutFile "$env:TEMP\cttlogo.png"
|
||||||
|
|
||||||
|
if (Test-Path -Path "$env:TEMP\cttlogo.png") {
|
||||||
|
$iconPath = "$env:LOCALAPPDATA\winutil\cttlogo.ico"
|
||||||
|
ConvertTo-Icon -bitmapPath "$env:TEMP\cttlogo.png" -iconPath $iconPath
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,8 +54,8 @@ function Invoke-WPFShortcut {
|
|||||||
$Shortcut = $WshShell.CreateShortcut($FileBrowser.FileName)
|
$Shortcut = $WshShell.CreateShortcut($FileBrowser.FileName)
|
||||||
$Shortcut.TargetPath = $SourceExe
|
$Shortcut.TargetPath = $SourceExe
|
||||||
$Shortcut.Arguments = $ArgumentsToSourceExe
|
$Shortcut.Arguments = $ArgumentsToSourceExe
|
||||||
if (Test-Path -Path $ctticologo) {
|
if ($iconPath -ne $null) {
|
||||||
$shortcut.IconLocation = $ctticologo
|
$shortcut.IconLocation = $iconPath
|
||||||
}
|
}
|
||||||
|
|
||||||
# Save the Shortcut to disk
|
# Save the Shortcut to disk
|
||||||
|
@ -33,9 +33,9 @@ function Invoke-WPFUnInstall {
|
|||||||
Invoke-WPFRunspace -ArgumentList $PackagesToInstall -DebugPreference $DebugPreference -ScriptBlock {
|
Invoke-WPFRunspace -ArgumentList $PackagesToInstall -DebugPreference $DebugPreference -ScriptBlock {
|
||||||
param($PackagesToInstall, $DebugPreference)
|
param($PackagesToInstall, $DebugPreference)
|
||||||
if ($PackagesToInstall.count -eq 1){
|
if ($PackagesToInstall.count -eq 1){
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 })
|
||||||
} else {
|
} else {
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value 0.01 -overlay "logo" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value 0.01 })
|
||||||
}
|
}
|
||||||
$packagesWinget, $packagesChoco = {
|
$packagesWinget, $packagesChoco = {
|
||||||
$packagesWinget = [System.Collections.Generic.List`1[System.Object]]::new()
|
$packagesWinget = [System.Collections.Generic.List`1[System.Object]]::new()
|
||||||
@ -67,7 +67,7 @@ function Invoke-WPFUnInstall {
|
|||||||
Write-Host "==========================================="
|
Write-Host "==========================================="
|
||||||
Write-Host "-- Uninstalls have finished ---"
|
Write-Host "-- Uninstalls have finished ---"
|
||||||
Write-Host "==========================================="
|
Write-Host "==========================================="
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "None" -overlay "checkmark" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "None" -overlay "$env:TEMP\cttcheck.png" })
|
||||||
}
|
}
|
||||||
Catch {
|
Catch {
|
||||||
Write-Host "==========================================="
|
Write-Host "==========================================="
|
||||||
@ -77,5 +77,9 @@ function Invoke-WPFUnInstall {
|
|||||||
}
|
}
|
||||||
$sync.ProcessRunning = $False
|
$sync.ProcessRunning = $False
|
||||||
|
|
||||||
|
$ButtonType = [System.Windows.MessageBoxButton]::OK
|
||||||
|
$MessageboxTitle = "Uninstalls are Finished "
|
||||||
|
$Messageboxbody = ("Done")
|
||||||
|
$MessageIcon = [System.Windows.MessageBoxImage]::Information
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,9 +31,9 @@ function Invoke-WPFtweaksbutton {
|
|||||||
$sync.ProcessRunning = $true
|
$sync.ProcessRunning = $true
|
||||||
|
|
||||||
if ($Tweaks.count -eq 1){
|
if ($Tweaks.count -eq 1){
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 })
|
||||||
} else {
|
} else {
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value 0.01 -overlay "logo" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value 0.01 })
|
||||||
}
|
}
|
||||||
$cnt = 0
|
$cnt = 0
|
||||||
# Execute other selected tweaks
|
# Execute other selected tweaks
|
||||||
@ -45,7 +45,7 @@ function Invoke-WPFtweaksbutton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sync.ProcessRunning = $false
|
$sync.ProcessRunning = $false
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "None" -overlay "checkmark" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "None" -overlay "$env:TEMP\cttcheck.png" })
|
||||||
Write-Host "================================="
|
Write-Host "================================="
|
||||||
Write-Host "-- Tweaks are Finished ---"
|
Write-Host "-- Tweaks are Finished ---"
|
||||||
Write-Host "================================="
|
Write-Host "================================="
|
||||||
|
@ -25,9 +25,9 @@ function Invoke-WPFundoall {
|
|||||||
|
|
||||||
$sync.ProcessRunning = $true
|
$sync.ProcessRunning = $true
|
||||||
if ($Tweaks.count -eq 1){
|
if ($Tweaks.count -eq 1){
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 })
|
||||||
} else {
|
} else {
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value 0.01 -overlay "logo" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value 0.01 })
|
||||||
}
|
}
|
||||||
$cnt = 0
|
$cnt = 0
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ function Invoke-WPFundoall {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sync.ProcessRunning = $false
|
$sync.ProcessRunning = $false
|
||||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "None" -overlay "checkmark" })
|
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "None" -overlay "$env:TEMP\cttcheck.png" })
|
||||||
Write-Host "=================================="
|
Write-Host "=================================="
|
||||||
Write-Host "--- Undo Tweaks are Finished ---"
|
Write-Host "--- Undo Tweaks are Finished ---"
|
||||||
Write-Host "=================================="
|
Write-Host "=================================="
|
||||||
|
@ -154,6 +154,19 @@ Invoke-WPFRunspace -ScriptBlock {
|
|||||||
# Print the logo
|
# Print the logo
|
||||||
Invoke-WPFFormVariables
|
Invoke-WPFFormVariables
|
||||||
|
|
||||||
|
# download the logo
|
||||||
|
$logoUrl = "https://christitus.com/images/logo-full.png"
|
||||||
|
# Download the image
|
||||||
|
$logoPath = "$env:TEMP\cttlogo.png"
|
||||||
|
Invoke-WebRequest -Uri $logoUrl -OutFile $logoPath
|
||||||
|
|
||||||
|
# download the check
|
||||||
|
$CheckUrl = "https://raw.githubusercontent.com/ChrisTitusTech/winutil/main/docs/assets/check.png"
|
||||||
|
|
||||||
|
# Download the image
|
||||||
|
$CheckPath = "$env:TEMP\cttcheck.png"
|
||||||
|
Invoke-WebRequest -Uri $CheckUrl -OutFile $CheckPath
|
||||||
|
|
||||||
# Progress bar in taskbaritem > Set-WinUtilProgressbar
|
# Progress bar in taskbaritem > Set-WinUtilProgressbar
|
||||||
$sync["Form"].TaskbarItemInfo = New-Object System.Windows.Shell.TaskbarItemInfo
|
$sync["Form"].TaskbarItemInfo = New-Object System.Windows.Shell.TaskbarItemInfo
|
||||||
Set-WinUtilTaskbaritem -state "None"
|
Set-WinUtilTaskbaritem -state "None"
|
||||||
@ -292,6 +305,9 @@ Add-Type @"
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Set the overlay icon for the taskbar
|
||||||
|
Set-WinUtilTaskbaritem -overlay $logoPath
|
||||||
|
|
||||||
$rect = New-Object RECT
|
$rect = New-Object RECT
|
||||||
[Window]::GetWindowRect($windowHandle, [ref]$rect)
|
[Window]::GetWindowRect($windowHandle, [ref]$rect)
|
||||||
$width = $rect.Right - $rect.Left
|
$width = $rect.Right - $rect.Left
|
||||||
@ -430,25 +446,8 @@ $sync["SearchBar"].Add_TextChanged({
|
|||||||
$label.Visibility = "Collapsed"}
|
$label.Visibility = "Collapsed"}
|
||||||
})
|
})
|
||||||
|
|
||||||
$cttpnglogo = "$env:LOCALAPPDATA\winutil\cttlogo.png"
|
$sync["Form"].Add_Activated({
|
||||||
$ctticologo = "$env:LOCALAPPDATA\winutil\cttlogo.ico"
|
Set-WinUtilTaskbaritem -overlay $logoPath -state "None"
|
||||||
if (-NOT (Test-Path -Path $cttpnglogo) -or -NOT (Test-Path -Path $ctticologo)) {
|
|
||||||
Invoke-WebRequest -Uri "https://christitus.com/images/logo-full.png" -OutFile $cttpnglogo
|
|
||||||
}
|
|
||||||
|
|
||||||
$cttpngcheckmark = "$env:LOCALAPPDATA\winutil\cttcheckmark.png"
|
|
||||||
$ctticocheckmark = "$env:LOCALAPPDATA\winutil\cttcheckmark.ico"
|
|
||||||
if (-NOT (Test-Path -Path $cttpngcheckmark) -or -NOT (Test-Path -Path $ctticocheckmark)) {
|
|
||||||
Invoke-WebRequest -Uri "https://christitus.com/images/checkmark.png" -OutFile $cttpngcheckmark
|
|
||||||
}
|
|
||||||
|
|
||||||
ConvertTo-Icon -bitmapPath $cttpnglogo -iconPath $ctticologo
|
|
||||||
|
|
||||||
Set-WinUtilTaskbaritem -overlay "logo" | Out-Null
|
|
||||||
$sync["Form"].icon = $cttpnglogo
|
|
||||||
|
|
||||||
$sync["Form"].Add_Activated({
|
|
||||||
Set-WinUtilTaskbaritem -overlay "logo"
|
|
||||||
})
|
})
|
||||||
|
|
||||||
# Define event handler for button click
|
# Define event handler for button click
|
||||||
|
Loading…
Reference in New Issue
Block a user