#Requires -Version 5.1 <# .SYNOPSIS Custom Windows App Installer (WPF GUI + winget) .DESCRIPTION A lightweight, self-contained PowerShell GUI for bulk-installing and upgrading Windows apps via winget. Designed to run locally (.\win.ps1) or remotely via: irm "https://win.xpp.wtf" | iex #> [CmdletBinding()] param() $ErrorActionPreference = 'Stop' # --------------------------------------------------------------------------- # App Catalog - add new categories or apps here # --------------------------------------------------------------------------- $Apps = @( # Browsers @{ Category = 'Browsers'; Name = 'Google Chrome'; Id = 'Google.Chrome' } @{ Category = 'Browsers'; Name = 'Mozilla Firefox'; Id = 'Mozilla.Firefox' } @{ Category = 'Browsers'; Name = 'Brave'; Id = 'Brave.Brave' } @{ Category = 'Browsers'; Name = 'Vivaldi'; Id = 'Vivaldi.Vivaldi' } @{ Category = 'Browsers'; Name = 'Zen Browser'; Id = 'Zen-Team.Zen-Browser' } # Communication @{ Category = 'Communication'; Name = 'Discord'; Id = 'Discord.Discord' } @{ Category = 'Communication'; Name = 'Telegram Desktop'; Id = 'Telegram.TelegramDesktop' } # Development @{ Category = 'Development'; Name = 'Visual Studio Code'; Id = 'Microsoft.VisualStudioCode' } # Gaming @{ Category = 'Gaming'; Name = 'Steam'; Id = 'Valve.Steam' } # Media @{ Category = 'Media'; Name = 'VLC media player'; Id = 'VideoLAN.VLC' } ) # --------------------------------------------------------------------------- # Load WPF Assemblies # --------------------------------------------------------------------------- try { Add-Type -AssemblyName PresentationFramework Add-Type -AssemblyName PresentationCore Add-Type -AssemblyName WindowsBase } catch { Write-Error "Failed to load WPF assemblies. Run this script in Windows PowerShell 5.1 or PowerShell 7+ on Windows." return } # --------------------------------------------------------------------------- # Check winget availability # --------------------------------------------------------------------------- $wingetCmd = Get-Command winget -ErrorAction SilentlyContinue $wingetAvailable = $null -ne $wingetCmd $wingetVersion = if ($wingetAvailable) { try { (& winget --version 2>$null | Select-Object -First 1).Trim() } catch { 'detected' } } else { 'not found' } # --------------------------------------------------------------------------- # WPF XAML Layout # --------------------------------------------------------------------------- [xml]$xaml = @"