param([Parameter(Mandatory=$true)][string]$GodotExe) $ErrorActionPreference='Stop' $repo=Split-Path -Parent $PSScriptRoot $project=Join-Path $repo 'Demon_v0.12' $output=Join-Path $repo 'Demon_v0.12_Windows' $engine=(Resolve-Path -LiteralPath $GodotExe).Path $template=Join-Path $PSScriptRoot 'templates/windows_release_x86_64.exe' if(-not (Test-Path -LiteralPath $template)){throw 'Run tools/fetch_windows_template.py first.'} New-Item -ItemType Directory -Force -Path $output | Out-Null & $engine --headless --path $project --editor --import if($LASTEXITCODE -ne 0){throw 'Godot import failed'} # The enabled EditorExportPlugin embeds a fresh random ID on every export. & $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')