<#
.SYNOPSIS
    Installs Nuages on Windows.

.DESCRIPTION
    The install logic lives inside the app itself (Platforms/Windows/WindowsInstaller.cs),
    so this script is just a convenience wrapper around `Nuages.exe -install`. That copies
    the app into %LOCALAPPDATA%\Programs\Nuages, creates Start Menu + Desktop shortcuts,
    registers the nuages:// protocol, adds an Add/Remove Programs entry, and launches the
    installed copy. No admin rights, no separate installer binary.

    Run it from the unzipped build folder, or pass -Source.

.EXAMPLE
    powershell -ExecutionPolicy Bypass -File install-windows.ps1
#>
[CmdletBinding()]
param([string] $Source)

$ErrorActionPreference = 'Stop'
if (-not $Source) { $Source = $PSScriptRoot }
$exe = Join-Path $Source 'Nuages.exe'

if (-not (Test-Path $exe)) {
    throw "Could not find Nuages.exe in '$Source'. Run this from the unzipped build folder, or pass -Source."
}

Write-Host "Installing Nuages via $exe -install ..." -ForegroundColor Cyan
Start-Process -FilePath $exe -ArgumentList '-install'
Write-Host "Launched the installer. Nuages will open from its installed location." -ForegroundColor Green
