<#
.SYNOPSIS
    Uninstalls Nuages on Windows.

.DESCRIPTION
    Thin wrapper around `Nuages.exe -uninstall` (see WindowsInstaller.cs), which removes
    the shortcuts, the nuages:// protocol, the Add/Remove Programs entry, and the install
    folder. You can also uninstall from Windows Settings > Apps.
#>
[CmdletBinding()]
param(
    [string] $InstallDir = (Join-Path $env:LOCALAPPDATA 'Programs\Nuages')
)

$ErrorActionPreference = 'SilentlyContinue'
$exe = Join-Path $InstallDir 'Nuages.exe'

if (Test-Path $exe) {
    Write-Host "Uninstalling Nuages via $exe -uninstall ..." -ForegroundColor Cyan
    Start-Process -FilePath $exe -ArgumentList '-uninstall'
} else {
    Write-Host "Nuages.exe not found in $InstallDir - already removed?" -ForegroundColor Yellow
}
