winutil/functions/public/Invoke-WPFGetInstalled.ps1
MyDrift 1032d3d5aa
Taskbaritem > Progressbar / Overlay icon / description / asset mgmt (#2309)
* Add Progress bar to some stuff

https://learn.microsoft.com/en-us/dotnet/api/system.windows.shell.taskbariteminfo?view=windowsdesktop-8.0

* add function to manage taskbar item

changed from manually setting the taskbar overlay, progressvalue and progress state to setting them through a function

* add description feature

* use Dispatcher.Invoke

* restructure, fix, additions

* fix merge conflicts

* add check to progresses

* remove progress from wiget & choco install

* fix

* polish

* fix

* Update functions/private/Set-WinUtilTaskbarItem.ps1

Co-authored-by: Mr.k <mineshtine28546271@gmail.com>

* fix syntax

* Update functions/private/Set-WinUtilTaskbarItem.ps1

Co-authored-by: Mr.k <mineshtine28546271@gmail.com>

* rework

- add overlay presets
- rework image saving & converting
- removed popup after uninstalling applications

* fix description of function

* undo winutil

* remove check.png

* Update functions/private/Set-WinUtilTaskbarItem.ps1

Co-authored-by: Mr.k <mineshtine28546271@gmail.com>

* Update functions/private/Set-WinUtilTaskbarItem.ps1

Co-authored-by: Mr.k <mineshtine28546271@gmail.com>

* rework assets directory & its usage

* fixes

- ability to set no overlay added
- added relative path to winutildir

* hotfix

* last fixes

* add comment

* remove trailing whitespaces

THX to Mr.K :)

* renamed checkmark & added warning

* last fixes

remove bitmap
remove unneeded "| out-null"

* hotfix for new commit

---------

Co-authored-by: Mr.k <mineshtine28546271@gmail.com>
2024-07-25 16:19:45 -05:00

49 lines
1.5 KiB
PowerShell

function Invoke-WPFGetInstalled {
<#
.SYNOPSIS
Invokes the function that gets the checkboxes to check in a new runspace
.PARAMETER checkbox
Indicates whether to check for installed 'winget' programs or applied 'tweaks'
#>
param($checkbox)
if($sync.ProcessRunning){
$msg = "[Invoke-WPFGetInstalled] Install process is currently running."
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
return
}
if(((Test-WinUtilPackageManager -winget) -eq "not-installed") -and $checkbox -eq "winget"){
return
}
Invoke-WPFRunspace -ArgumentList $checkbox -DebugPreference $DebugPreference -ScriptBlock {
param($checkbox, $DebugPreference)
$sync.ProcessRunning = $true
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" })
if($checkbox -eq "winget"){
Write-Host "Getting Installed Programs..."
}
if($checkbox -eq "tweaks"){
Write-Host "Getting Installed Tweaks..."
}
$Checkboxes = Invoke-WinUtilCurrentSystem -CheckBox $checkbox
$sync.form.Dispatcher.invoke({
foreach($checkbox in $Checkboxes){
$sync.$checkbox.ischecked = $True
}
})
Write-Host "Done..."
$sync.ProcessRunning = $false
$sync.form.Dispatcher.Invoke([action] { Set-WinUtilTaskbaritem -state "None" })
}
}