Skip to main content

RestartAppIfNecessary Bootstrap Generator

Copy-paste-friendly starter for relaunch-through-Steam behavior and dual-distribution guards.

Pick wrapper and App ID; export Markdown for your repo. Pair with Player.log triage when Init or launch context is unclear.

Generates a minimal early bootstrap pattern. Adjust to your entry point (Player loop script, Boot scene, or native plugin).

using Steamworks;
public static class SteamBootstrap
{
    // SteamAPI_RestartAppIfNecessary must run before SteamAPI_Init when applicable.
    public static bool TryRestartThroughSteam()
    {
        return SteamAPI.RestartAppIfNecessary(new AppId_t(uint.Parse("480")));
    }
}
// Usage (very early, e.g. before first scene load):
// if (SteamBootstrap.TryRestartThroughSteam()) {
//     Application.Quit();
//     return;
// }
Generated Markdown
Where should this run?
As early as possible in process startup, before Init and before creating the game window when practical.