#requires -Version 5.1
param([ValidateSet('Debug', 'Release')][string]$Configuration = 'Release',
[string]$GameDirectory, [string]$PlayerPath, [string]$InstallerPath)
$ErrorActionPreference = 'Stop'
Import-Module Microsoft.PowerShell.Utility -Scope Local
$taskWorkspace = [IO.Path]::GetFullPath((Join-Path $PSScriptRoot '..'))
if (-not $PlayerPath) {
$taskProject = Join-Path $taskWorkspace 'Client/XFEWarframe.Player/XFEWarframe.Player.csproj'
dotnet build $taskProject -c $Configuration -p:Platform=x64 --nologo -v quiet
if ($LASTEXITCODE -ne 0) { throw 'Player build failed; an old executable will not be started.' }
$PlayerPath = Join-Path $taskWorkspace "Client/XFEWarframe.Player/bin/x64/$Configuration/net10.0-windows10.0.22621.0/win-x64/XFEWarframe.Player.exe"
}
$PlayerPath = [IO.Path]::GetFullPath($PlayerPath)
if (-not (Test-Path -LiteralPath $PlayerPath -PathType Leaf)) { throw ('Player executable is missing: ' + $PlayerPath) }
if (-not $GameDirectory) {
Start-Process -FilePath $PlayerPath -WorkingDirectory (Split-Path $PlayerPath)
return
}
$GameDirectory = [IO.Path]::GetFullPath($GameDirectory)
$taskExe = Join-Path $GameDirectory 'Warframe.x64.exe'
$taskServer = @(
'Server/XFEWarframe.Server/bin/Release/net10.0/XFEWarframe.Server.exe'
'Server/XFEWarframe.Server/bin/Debug/net10.0/XFEWarframe.Server.exe'
'artifacts/interaction-perf-20261101/Server/XFEWarframe.Server.exe'
) | ForEach-Object { Join-Path $taskWorkspace $_ } | Where-Object { Test-Path -LiteralPath $_ -PathType Leaf } |
Sort-Object { (Get-Item -LiteralPath $_).LastWriteTimeUtc } -Descending | Select-Object -First 1
$taskRoot = Join-Path $taskWorkspace 'Server/runtime'
$taskInstaller = if ($InstallerPath) { [IO.Path]::GetFullPath($InstallerPath) } else { Join-Path $taskWorkspace 'artifacts/one-click-login-20261102/Installer/XFEWarframe.Installer.exe' }
if (-not $InstallerPath -and -not (Test-Path -LiteralPath $taskInstaller -PathType Leaf)) {
$taskInstaller = Join-Path $taskWorkspace 'Client/XFEWarframe.Installer/bin/Release/net10.0-windows/win-x64/XFEWarframe.Installer.exe'
}
foreach ($taskFile in @($taskExe,$taskInstaller,(Join-Path $GameDirectory 'XFEWarframe/client.json'))) {
if (-not (Test-Path -LiteralPath $taskFile -PathType Leaf)) { throw ('Required file is missing: ' + $taskFile) }
}
$taskRunning = @(Get-Process -Name Warframe.x64 -ErrorAction SilentlyContinue | Where-Object { $_.Path -eq $taskExe })
if ($taskRunning.Count) { Write-Output 'The private game copy is already running. Its session was preserved.'; exit 0 }
$taskConfig = Get-Content -LiteralPath (Join-Path $GameDirectory 'XFEWarframe/client.json') -Raw | ConvertFrom-Json
$taskOrigin = $taskConfig.ServerUrl.TrimEnd('/')
$taskHealth = $null
try { $taskHealth = Invoke-RestMethod -Uri ($taskOrigin + '/health') -TimeoutSec 3 } catch { }
if (-not $taskHealth) {
if ($taskOrigin -ne 'http://127.0.0.1:8444') { throw 'The selected server is unavailable. Start its server before using the launcher.' }
if (-not $taskServer) { throw 'Build the local server before starting the player.' }
$taskLogs = Join-Path $taskWorkspace 'artifacts/player-start'
New-Item -ItemType Directory -Path $taskLogs -Force | Out-Null
$taskStamp = [DateTime]::UtcNow.ToString('yyyyMMdd-HHmmss')
$taskProcess = Start-Process -FilePath $taskServer -ArgumentList ('--root="'+$taskRoot+'"') -WorkingDirectory $taskWorkspace -WindowStyle Hidden -RedirectStandardOutput (Join-Path $taskLogs ($taskStamp+'.log')) -RedirectStandardError (Join-Path $taskLogs ($taskStamp+'.err.log')) -PassThru
$taskUntil = [DateTime]::UtcNow.AddSeconds(30)
while ([DateTime]::UtcNow -lt $taskUntil) {
if ($taskProcess.HasExited) { throw 'The local server exited. Inspect artifacts/player-start.' }
try { $taskHealth = Invoke-RestMethod -Uri ($taskOrigin+'/health') -TimeoutSec 2; break } catch { }
Start-Sleep -Milliseconds 250
}
}
if (-not $taskHealth -or $taskHealth.service -ne 'XFEWarframe' -or $taskHealth.status -ne 'ok') { throw 'The selected private server is not ready.' }
$taskPayload = Join-Path (Split-Path $PlayerPath) 'Bridge'
$taskManifest = Get-Content -LiteralPath (Join-Path $taskPayload 'payload.json') -Raw | ConvertFrom-Json
$taskState = Get-Content -LiteralPath (Join-Path $GameDirectory 'XFEWarframe/installation.json') -Raw | ConvertFrom-Json
$taskInstalled = Join-Path $GameDirectory 'XFEWarframe/XFEWarframe.Bridge.dll'
if ($taskState.Version -ne $taskManifest.Version -or -not (Test-Path -LiteralPath $taskInstalled) -or (Get-FileHash -LiteralPath $taskInstalled -Algorithm SHA256).Hash -ne $taskManifest.Sha256) {
& $taskInstaller repair --game $GameDirectory --server $taskOrigin --payload $taskPayload
if ($LASTEXITCODE -ne 0) { throw 'The component update failed. The game was not started.' }
}
# No credentials appear in arguments or configuration. The launcher restores its own
# Windows-protected account and submits it over the authenticated local runtime API.
$taskPlayer = Start-Process -FilePath $PlayerPath -ArgumentList @('--play=true',('--game="'+$GameDirectory+'"'),('--server="'+$taskOrigin+'"')) -WorkingDirectory (Split-Path $PlayerPath) -PassThru
Write-Output ('Player launcher started. PID: ' + $taskPlayer.Id)
#requires -Version 5.1
param([ValidateSet('Debug', 'Release')][string]$Configuration = 'Release',
[string]$GameDirectory, [string]$PlayerPath, [string]$InstallerPath)
$ErrorActionPreference = 'Stop'
Import-Module Microsoft.PowerShell.Utility -Scope Local
$taskWorkspace = [IO.Path]::GetFullPath((Join-Path $PSScriptRoot '..'))
if (-not $PlayerPath) {
$taskProject = Join-Path $taskWorkspace 'Client/XFEWarframe.Player/XFEWarframe.Player.csproj'
dotnet build $taskProject -c $Configuration -p:Platform=x64 --nologo -v quiet
if ($LASTEXITCODE -ne 0) { throw 'Player build failed; an old executable will not be started.' }
$PlayerPath = Join-Path $taskWorkspace "Client/XFEWarframe.Player/bin/x64/$Configuration/net10.0-windows10.0.22621.0/win-x64/XFEWarframe.Player.exe"
}
$PlayerPath = [IO.Path]::GetFullPath($PlayerPath)
if (-not (Test-Path -LiteralPath $PlayerPath -PathType Leaf)) { throw ('Player executable is missing: ' + $PlayerPath) }
if (-not $GameDirectory) {
Start-Process -FilePath $PlayerPath -WorkingDirectory (Split-Path $PlayerPath)
return
}
$GameDirectory = [IO.Path]::GetFullPath($GameDirectory)
$taskExe = Join-Path $GameDirectory 'Warframe.x64.exe'
$taskServer = @(
'Server/XFEWarframe.Server/bin/Release/net10.0/XFEWarframe.Server.exe'
'Server/XFEWarframe.Server/bin/Debug/net10.0/XFEWarframe.Server.exe'
'artifacts/interaction-perf-20261101/Server/XFEWarframe.Server.exe'
) | ForEach-Object { Join-Path $taskWorkspace $_ } | Where-Object { Test-Path -LiteralPath $_ -PathType Leaf } |
Sort-Object { (Get-Item -LiteralPath $_).LastWriteTimeUtc } -Descending | Select-Object -First 1
$taskRoot = Join-Path $taskWorkspace 'Server/runtime'
$taskInstaller = if ($InstallerPath) { [IO.Path]::GetFullPath($InstallerPath) } else { Join-Path $taskWorkspace 'artifacts/one-click-login-20261102/Installer/XFEWarframe.Installer.exe' }
if (-not $InstallerPath -and -not (Test-Path -LiteralPath $taskInstaller -PathType Leaf)) {
$taskInstaller = Join-Path $taskWorkspace 'Client/XFEWarframe.Installer/bin/Release/net10.0-windows/win-x64/XFEWarframe.Installer.exe'
}
foreach ($taskFile in @($taskExe,$taskInstaller,(Join-Path $GameDirectory 'XFEWarframe/client.json'))) {
if (-not (Test-Path -LiteralPath $taskFile -PathType Leaf)) { throw ('Required file is missing: ' + $taskFile) }
}
$taskRunning = @(Get-Process -Name Warframe.x64 -ErrorAction SilentlyContinue | Where-Object { $_.Path -eq $taskExe })
if ($taskRunning.Count) { Write-Output 'The private game copy is already running. Its session was preserved.'; exit 0 }
$taskConfig = Get-Content -LiteralPath (Join-Path $GameDirectory 'XFEWarframe/client.json') -Raw | ConvertFrom-Json
$taskOrigin = $taskConfig.ServerUrl.TrimEnd('/')
$taskHealth = $null
try { $taskHealth = Invoke-RestMethod -Uri ($taskOrigin + '/health') -TimeoutSec 3 } catch { }
if (-not $taskHealth) {
if ($taskOrigin -ne 'http://127.0.0.1:8444') { throw 'The selected server is unavailable. Start its server before using the launcher.' }
if (-not $taskServer) { throw 'Build the local server before starting the player.' }
$taskLogs = Join-Path $taskWorkspace 'artifacts/player-start'
New-Item -ItemType Directory -Path $taskLogs -Force | Out-Null
$taskStamp = [DateTime]::UtcNow.ToString('yyyyMMdd-HHmmss')
$taskProcess = Start-Process -FilePath $taskServer -ArgumentList ('--root="'+$taskRoot+'"') -WorkingDirectory $taskWorkspace -WindowStyle Hidden -RedirectStandardOutput (Join-Path $taskLogs ($taskStamp+'.log')) -RedirectStandardError (Join-Path $taskLogs ($taskStamp+'.err.log')) -PassThru
$taskUntil = [DateTime]::UtcNow.AddSeconds(30)
while ([DateTime]::UtcNow -lt $taskUntil) {
if ($taskProcess.HasExited) { throw 'The local server exited. Inspect artifacts/player-start.' }
try { $taskHealth = Invoke-RestMethod -Uri ($taskOrigin+'/health') -TimeoutSec 2; break } catch { }
Start-Sleep -Milliseconds 250
}
}
if (-not $taskHealth -or $taskHealth.service -ne 'XFEWarframe' -or $taskHealth.status -ne 'ok') { throw 'The selected private server is not ready.' }
$taskPayload = Join-Path (Split-Path $PlayerPath) 'Bridge'
$taskManifest = Get-Content -LiteralPath (Join-Path $taskPayload 'payload.json') -Raw | ConvertFrom-Json
$taskState = Get-Content -LiteralPath (Join-Path $GameDirectory 'XFEWarframe/installation.json') -Raw | ConvertFrom-Json
$taskInstalled = Join-Path $GameDirectory 'XFEWarframe/XFEWarframe.Bridge.dll'
if ($taskState.Version -ne $taskManifest.Version -or -not (Test-Path -LiteralPath $taskInstalled) -or (Get-FileHash -LiteralPath $taskInstalled -Algorithm SHA256).Hash -ne $taskManifest.Sha256) {
& $taskInstaller repair --game $GameDirectory --server $taskOrigin --payload $taskPayload
if ($LASTEXITCODE -ne 0) { throw 'The component update failed. The game was not started.' }
}
# No credentials appear in arguments or configuration. The launcher restores its own
# Windows-protected account and submits it over the authenticated local runtime API.
$taskPlayer = Start-Process -FilePath $PlayerPath -ArgumentList @('--play=true',('--game="'+$GameDirectory+'"'),('--server="'+$taskOrigin+'"')) -WorkingDirectory (Split-Path $PlayerPath) -PassThru
Write-Output ('Player launcher started. PID: ' + $taskPlayer.Id)