mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-06-28 09:04:47 -05:00
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>
This commit is contained in:
@ -43,20 +43,24 @@ Function Install-WinUtilProgramWinget {
|
||||
$status = $(Start-Process -FilePath "winget" -ArgumentList "install --id $($Program.winget) --silent --accept-source-agreements --accept-package-agreements" -Wait -PassThru -NoNewWindow).ExitCode
|
||||
if($status -eq 0) {
|
||||
Write-Host "$($Program.winget) installed successfully."
|
||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -value ($x/$count) })
|
||||
continue
|
||||
}
|
||||
if ($status -eq -1978335189) {
|
||||
Write-Host "$($Program.winget) No applicable update found"
|
||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -value ($x/$count) })
|
||||
continue
|
||||
}
|
||||
Write-Host "Attempt with User scope"
|
||||
$status = $(Start-Process -FilePath "winget" -ArgumentList "install --id $($Program.winget) --scope user --silent --accept-source-agreements --accept-package-agreements" -Wait -PassThru -NoNewWindow).ExitCode
|
||||
if($status -eq 0) {
|
||||
Write-Host "$($Program.winget) installed successfully with User scope."
|
||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -value ($x/$count) })
|
||||
continue
|
||||
}
|
||||
if ($status -eq -1978335189) {
|
||||
Write-Host "$($Program.winget) No applicable update found"
|
||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -value ($x/$count) })
|
||||
continue
|
||||
}
|
||||
Write-Host "Attempt with User prompt"
|
||||
@ -71,15 +75,18 @@ Function Install-WinUtilProgramWinget {
|
||||
}
|
||||
if($status -eq 0) {
|
||||
Write-Host "$($Program.winget) installed successfully with User prompt."
|
||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -value ($x/$count) })
|
||||
continue
|
||||
}
|
||||
if ($status -eq -1978335189) {
|
||||
Write-Host "$($Program.winget) No applicable update found"
|
||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -value ($x/$count) })
|
||||
continue
|
||||
}
|
||||
} catch {
|
||||
Write-Host "Failed to install $($Program.winget). With winget"
|
||||
$failedPackages += $Program
|
||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Error" -value ($x/$count) })
|
||||
}
|
||||
}
|
||||
elseif($manage -eq "Uninstalling") {
|
||||
@ -88,6 +95,7 @@ Function Install-WinUtilProgramWinget {
|
||||
$status = $(Start-Process -FilePath "winget" -ArgumentList "uninstall --id $($Program.winget) --silent" -Wait -PassThru -NoNewWindow).ExitCode
|
||||
if($status -ne 0) {
|
||||
Write-Host "Failed to uninstall $($Program.winget)."
|
||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Error" })
|
||||
} else {
|
||||
Write-Host "$($Program.winget) uninstalled successfully."
|
||||
$failedPackages += $Program
|
||||
@ -95,7 +103,9 @@ Function Install-WinUtilProgramWinget {
|
||||
} catch {
|
||||
Write-Host "Failed to uninstall $($Program.winget) due to an error: $_"
|
||||
$failedPackages += $Program
|
||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Error" })
|
||||
}
|
||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -value ($x/$count) })
|
||||
}
|
||||
else {
|
||||
throw "[Install-WinUtilProgramWinget] Invalid Value for Parameter 'manage', Provided Value is: $manage"
|
||||
|
Reference in New Issue
Block a user