param([string]$GodotExe=(Join-Path $PSScriptRoot 'godot/Godot_v4.3-stable_win64_console.exe')) $ErrorActionPreference='Stop' $repo=Split-Path -Parent $PSScriptRoot $project=Join-Path $repo 'Demon_v0.13' $output=Join-Path $repo 'Demon_v0.13_Windows' $engine=(Resolve-Path -LiteralPath $GodotExe).Path if(-not (Test-Path -LiteralPath (Join-Path $PSScriptRoot 'templates/windows_release_x86_64.exe'))){throw 'Download the official template with tools/fetch_windows_template.py first.'} New-Item -ItemType Directory -Force -Path $output | Out-Null & $engine --headless --path $project --editor --import --quit if($LASTEXITCODE -ne 0){throw 'Godot import failed'} & $engine --headless --path $project --export-release 'Windows Desktop' (Join-Path $output 'Demon.exe') if($LASTEXITCODE -ne 0){throw 'Godot export failed'} Write-Output (Join-Path $output 'Demon.exe')