MyDrift
2024-07-09 00:52:24 +02:00
parent b47036630c
commit a86b07a826
11 changed files with 37 additions and 0 deletions

View File

@ -24,6 +24,7 @@ function Invoke-WPFGetInstalled {
param($checkbox, $DebugPreference)
$sync.ProcessRunning = $true
# $sync["Form"].taskbarItemInfo.ProgressState = "Indeterminate"
if($checkbox -eq "winget"){
Write-Host "Getting Installed Programs..."
@ -42,5 +43,6 @@ function Invoke-WPFGetInstalled {
Write-Host "Done..."
$sync.ProcessRunning = $false
# $sync["Form"].taskbarItemInfo.ProgressState = "None"
}
}

View File

@ -15,6 +15,8 @@ function Invoke-WPFGetIso {
$sync.BusyMessage.Visibility="Visible"
$sync.BusyText.Text="N Busy"
$sync["Form"].taskbarItemInfo.ProgressState = "Indeterminate"
Write-Host " _ __ __ _ "
Write-Host " /\/\ (_) ___ _ __ ___ / / /\ \ \(_) _ __ "
@ -239,6 +241,7 @@ function Invoke-WPFGetIso {
$sync.BusyMessage.Visibility="Hidden"
$sync.ProcessRunning = $false
$sync["Form"].taskbarItemInfo.ProgressState = "None"
}

View File

@ -20,6 +20,8 @@ function Invoke-WPFInstall {
return
}
$sync["Form"].taskbarItemInfo.ProgressState = "Normal"
Invoke-WPFRunspace -ArgumentList $PackagesToInstall -DebugPreference $DebugPreference -ScriptBlock {
param($PackagesToInstall, $DebugPreference)
$packagesWinget, $packagesChoco = {
@ -52,11 +54,13 @@ function Invoke-WPFInstall {
Write-Host "==========================================="
Write-Host "-- Installs have finished ---"
Write-Host "==========================================="
# $sync["Form"].taskbarItemInfo.ProgressState = "Indeterminate"
}
Catch {
Write-Host "==========================================="
Write-Host "Error: $_"
Write-Host "==========================================="
# $sync["Form"].taskbarItemInfo.ProgressState = "Error"
}
Start-Sleep -Seconds 5
$sync.ProcessRunning = $False

View File

@ -4,6 +4,8 @@ function Invoke-WPFMicrowin {
Invoke MicroWin routines...
#>
$sync["Form"].taskbarItemInfo.ProgressState = "Indeterminate"
if($sync.ProcessRunning) {
$msg = "GetIso process is currently running."
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
@ -477,5 +479,6 @@ public class PowerManagement {
# Allow the machine to sleep again (optional)
[PowerManagement]::SetThreadExecutionState(0)
$sync.ProcessRunning = $false
$sync["Form"].taskbarItemInfo.ProgressState = "None"
}
}

View File

@ -29,6 +29,8 @@ function Invoke-WPFUnInstall {
if($confirm -eq "No"){return}
$sync["Form"].taskbarItemInfo.ProgressState = "Normal"
Invoke-WPFRunspace -ArgumentList $PackagesToInstall -DebugPreference $DebugPreference -ScriptBlock {
param($PackagesToInstall, $DebugPreference)
$packagesWinget, $packagesChoco = {
@ -66,11 +68,13 @@ function Invoke-WPFUnInstall {
Write-Host "==========================================="
Write-Host "-- Uninstalls have finished ---"
Write-Host "==========================================="
# $sync["Form"].taskbarItemInfo.ProgressState = "Indeterminate"
}
Catch {
Write-Host "==========================================="
Write-Host "Error: $_"
Write-Host "==========================================="
# $sync["Form"].taskbarItemInfo.ProgressState = "Error"
}
$sync.ProcessRunning = $False
}