if (!(Test-Path -Path ".\launcher")) { New-Item -Path "." -Name "launcher" -ItemType "directory" | Out-Null New-Item -Path ".\launcher" -Name "input" -ItemType "directory" | Out-Null New-Item -Path ".\launcher" -Name "graphics" -ItemType "directory" | Out-Null } Write-Host "Key mappings:" Write-Host " 0 : Create/overwrite key mapping" $inputdirs = Get-ChildItem -Path ".\launcher\input" for ($i = 0; $i -lt $inputdirs.Count; $i++){ Write-Host " " ($i + 1)":"$inputdirs[$i] } $keymap = Read-Host "Select key mapping" if ($keymap -eq 0) { $name = Read-Host "Enter name" $dest = "launcher\input\" + $name if (!(Test-Path -Path $dest)) { New-Item -Path "." -Name $dest -ItemType "directory" | Out-Null } $dest = ".\" + $dest Copy-item -Force -Recurse "input\*" -Destination $dest Write-Host 'Stored key mapping as'$name } elseif (($keymap -gt $inputdirs.Count) -or ($keymap -lt 0)) { Write-Host "Please enter a valid input." } else { $path = ".\launcher\input\" + $inputdirs[$keymap - 1] Copy-item -Force -Recurse "$path\*" -Destination ".\input" | Out-Null Write-Host 'Selected key mapping '$inputdirs[$keymap - 1] } Write-Host "Graphics settings:" Write-Host " 0 : Create/overwrite graphics settings" $inputdirs = Get-ChildItem -Path ".\launcher\graphics" for ($i = 0; $i -lt $inputdirs.Count; $i++){ Write-Host " " ($i + 1)":"$inputdirs[$i] } $keymap = Read-Host "Select graphics settings" if ($keymap -eq 0) { $name = Read-Host "Enter name" $dest = "launcher\graphics\" + $name if (!(Test-Path -Path $dest)) { New-Item -Path "." -Name $dest -ItemType "directory" | Out-Null } $dest = ".\" + $dest Copy-item -Force "startup.cfg" -Destination $dest Write-Host 'Stored graphics mapping as'$name } elseif (($keymap -gt $inputdirs.Count) -or ($keymap -lt 0)) { Write-Host "Please enter a valid input." } else { $path = ".\launcher\graphics\" + $inputdirs[$keymap - 1] Copy-item -Force -Recurse "$path\*" -Destination "." | Out-Null Write-Host 'Selected graphics settings'$inputdirs[$keymap - 1] } $keymap = Read-Host "Press ENTER to launch game, or Ctrl-C to exit" if (Test-Path -Path "{PSScriptRoot}\..\bin\game\Launcher.exe") {#standalone game Start-Process -FilePath "{PSScriptRoot}\..\bin\game\Launcher.exe" }else {#steam install & Start-Process -FilePath "..\..\..\..\steam.exe" -ArgumentList "-applaunch 307960" }