diff --git a/.gitignore b/.gitignore index 31ae740..3e811c3 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,5 @@ Thumbs.db ## Claude .claude/ + +builds \ No newline at end of file diff --git a/README.md b/README.md index 49fd961..c78b8d0 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,8 @@ dotnet run --project src/OpenTheBox ## Distribute ```powershell -dotnet publish -c Release -r win-x64 +dotnet publish src/OpenTheBox -c Release -r win-x64 -o "builds/$(Get-Date -Format yyyyMMdd_HHmmss)_win" +dotnet publish src/OpenTheBox -c Release -r linux-x64-o "builds/$(Get-Date -Format yyyyMMdd_HHmmss)_linux" ``` This produces a self-contained single-file executable in `publish//`. The target machine does **not** need .NET installed. Distribute the entire folder (exe + `content/`). diff --git a/src/OpenTheBox/OpenTheBox.csproj b/src/OpenTheBox/OpenTheBox.csproj index 9d1c2bb..cdec17b 100644 --- a/src/OpenTheBox/OpenTheBox.csproj +++ b/src/OpenTheBox/OpenTheBox.csproj @@ -42,4 +42,10 @@ + + + + + + diff --git a/src/OpenTheBox/launcher/Launch.ps1 b/src/OpenTheBox/launcher/Launch.ps1 new file mode 100644 index 0000000..db0972d --- /dev/null +++ b/src/OpenTheBox/launcher/Launch.ps1 @@ -0,0 +1,17 @@ +$Host.UI.RawUI.WindowTitle = 'Open The Box' +[Console]::OutputEncoding = [Text.Encoding]::UTF8 +[Console]::InputEncoding = [Text.Encoding]::UTF8 +Set-Location $PSScriptRoot + +$exe = Join-Path $PSScriptRoot 'OpenTheBox.exe' +if (-not (Test-Path $exe)) { + Write-Host "ERROR: OpenTheBox.exe not found in $PSScriptRoot" -ForegroundColor Red + Read-Host 'Press Enter to exit' + exit 1 +} + +& $exe @args +if ($LASTEXITCODE -ne 0) { + Write-Host "`nGame exited with code $LASTEXITCODE" -ForegroundColor Yellow + Read-Host 'Press Enter to exit' +} diff --git a/src/OpenTheBox/launcher/LaunchOpenTheBox.cmd b/src/OpenTheBox/launcher/LaunchOpenTheBox.cmd new file mode 100644 index 0000000..2747fc3 --- /dev/null +++ b/src/OpenTheBox/launcher/LaunchOpenTheBox.cmd @@ -0,0 +1,29 @@ +@echo off +REM Launcher for Open The Box — opens in Windows Terminal, PowerShell, or cmd with UTF-8. +REM Point Steam's launch target to this file. + +title Open The Box +set "LAUNCH_PS1=%~dp0Launch.ps1" + +where wt >nul 2>nul +if %ERRORLEVEL% equ 0 ( + wt new-tab --title "Open The Box" -- powershell -NoProfile -ExecutionPolicy Bypass -File "%LAUNCH_PS1%" %* + goto :eof +) + +where pwsh >nul 2>nul +if %ERRORLEVEL% equ 0 ( + pwsh -NoProfile -ExecutionPolicy Bypass -File "%LAUNCH_PS1%" %* + goto :eof +) + +where powershell >nul 2>nul +if %ERRORLEVEL% equ 0 ( + powershell -NoProfile -ExecutionPolicy Bypass -File "%LAUNCH_PS1%" %* + goto :eof +) + +REM Fallback: cmd with UTF-8 codepage +chcp 65001 >nul 2>nul +"%~dp0OpenTheBox.exe" %* +if %ERRORLEVEL% neq 0 pause