Skip to content
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/content/dev/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ winutil/
- `Initialize-WPFUI.ps1`: Sets up the GUI
- `Invoke-WPFTweak*`: Applies system tweaks
- `Invoke-WPFFeature*`: Enables Windows features
- `Install-WinUtilProgram*`: Installs applications
- `Invoke-WPFInstall*`: Installs applications

**Naming Convention**: Functions start with `WPF` or `Winutil` to be loaded into the runspace.

Expand Down Expand Up @@ -291,7 +291,7 @@ Check if WinGet/Choco is installed
Install-WinUtilWinget/Choco (if needed)
Install-WinUtilProgramWinget/Choco → Install app
Invoke-WPFInstall → Install app
Update UI with progress
Expand Down
16 changes: 0 additions & 16 deletions functions/private/Install-WinUtilProgramChoco.ps1

This file was deleted.

16 changes: 0 additions & 16 deletions functions/private/Install-WinUtilProgramWinget.ps1

This file was deleted.

15 changes: 8 additions & 7 deletions functions/public/Invoke-WPFInstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ function Invoke-WPFInstall {

$PackagesToInstall = $sync.selectedApps | Foreach-Object { $sync.configs.applicationsHashtable.$_ }


if($sync.ProcessRunning) {
if ($sync.ProcessRunning) {
$msg = "[Invoke-WPFInstall] An Install process is currently running."
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
return
Expand All @@ -31,15 +30,17 @@ function Invoke-WPFInstall {

try {
$sync.ProcessRunning = $true
if($packagesWinget.Count -gt 0 -and $packagesWinget -ne "0") {
Show-WPFInstallAppBusy -text "Installing apps..."
Show-WPFInstallAppBusy -text "Installing apps..."

if ($packagesWinget.Count -gt 0) {
Install-WinUtilWinget
Install-WinUtilProgramWinget -Action Install -Programs $packagesWinget
Start-Process -FilePath winget -ArgumentList "install $packagesWinget --silent --source winget --accept-package-agreements" -NoNewWindow -Wait
}
if($packagesChoco.Count -gt 0) {
if ($packagesChoco.Count -gt 0) {
Install-WinUtilChoco
Install-WinUtilProgramChoco -Action Install -Programs $packagesChoco
Start-Process -FilePath choco -ArgumentList "install $packagesChoco -y" -NoNewWindow -Wait
}

Hide-WPFInstallAppBusy
Write-Host "==========================================="
Write-Host "-- Installs have finished ---"
Expand Down
12 changes: 8 additions & 4 deletions functions/public/Invoke-WPFUnInstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,16 @@ function Invoke-WPFUnInstall {
Show-WPFInstallAppBusy -text "Uninstalling apps..."

# Uninstall all selected programs in new window
if($packagesWinget.Count -gt 0) {
Install-WinUtilProgramWinget -Action Uninstall -Programs $packagesWinget
if ($packagesWinget.Count -gt 0) {
Install-WinUtilWinget
Start-Process -FilePath winget -ArgumentList "uninstall $packagesWinget --source winget --silent" -NoNewWindow -Wait
}
if($packagesChoco.Count -gt 0) {
Install-WinUtilProgramChoco -Action Uninstall -Programs $packagesChoco

if ($packagesChoco.Count -gt 0) {
Install-WinUtilChoco
Start-Process -FilePath choco -ArgumentList "uninstall $packagesChoco -y" -NoNewWindow -Wait
}

Hide-WPFInstallAppBusy
Write-Host "==========================================="
Write-Host "-- Uninstalls have finished ---"
Expand Down