JosefNemec/Playnite · error · FileNotFoundException

Emulator startup script not found.

Error message

Emulator startup script not found.

What it means

Thrown by GenericGameController.StartEmulator when a built-in profile requires a startup script (profileDef.ScriptStartup true) but Emulation.GetDefition(BuiltInConfigId) is null OR the startup script file at Emulation.GetStartupScriptPath(def) does not exist. It is a FileNotFoundException using a localized resource string (LOC.ErrorEmulatorStartupScriptNotFound).

Source

Thrown at source/Playnite/Controllers/GenericGameController.cs:165

                    startupDir = expandedProfile.WorkingDirectory;
                    startupPath = expandedProfile.Executable;
                    StartEmulatorProcess(startupPath, startupArgs, startupDir, emulator.InstallDir, romPath, asyncExec, emulator.GetClone(), expandedProfile.GetClone(), expandedProfile.TrackingMode, expandedProfile.TrackingPath);
                }
            }
            else if (currentEmuProfile is BuiltInEmulatorProfile builtIn)
            {
                var profileDef = Emulation.GetProfile(emulator.BuiltInConfigId, builtIn.BuiltInProfileName);
                if (profileDef == null)
                {
                    throw new Exception($"Can't find built-in {builtIn.BuiltInProfileName} emulator profile.");
                }

                if (profileDef.ScriptStartup)
                {
                    var def = Emulation.GetDefition(emulator.BuiltInConfigId);
                    if (def == null || !FileSystem.FileExists(Emulation.GetStartupScriptPath(def)))
                    {
                        throw new FileNotFoundException(ResourceProvider.GetString(LOC.ErrorEmulatorStartupScriptNotFound));
                    }

                    RunStartScriptFile(
                        $"{emulator.Name} runtime for {Game.Name}",
                        Emulation.GetStartupScriptPath(def),
                        emulator.InstallDir,
                        new Dictionary<string, object>
                        {
                            { "Emulator", emulator.GetClone() },
                            { "EmulatorProfile", profileDef.GetClone() },
                            { "RomPath", romPath }
                        },
                        asyncExec);
                }
                else
                {
                    builtIn = builtIn.GetClone();
                    startupDir = emulator.InstallDir;

View on GitHub (pinned to 5911f4e964)

Solutions

  1. Confirm the emulator add-on providing the startup script is installed and enabled.
  2. Verify FileSystem.FileExists(Emulation.GetStartupScriptPath(def)) before launching.
  3. Reinstall/repair the emulator support extension to restore the script.
  4. Restore the script from AV quarantine and exclude the Playnite folder.

Example fix

// before
currentEmuProfile = builtIn;
controller.StartEmulator(action, asyncExec, args);

// after — verify definition + script presence first
var def = Emulation.GetDefition(emulator.BuiltInConfigId);
if (def == null || !FileSystem.FileExists(Emulation.GetStartupScriptPath(def)))
{
    dialogs.ShowMessage("Emulator startup script is missing. Reinstall the emulator support add-on.");
    return;
}
currentEmuProfile = builtIn;
controller.StartEmulator(action, asyncExec, args);
Defensive patterns

Strategy: validation

Validate before calling

var def = Emulation.GetDefition(emulator.BuiltInConfigId);
if (def == null || !FileSystem.FileExists(Emulation.GetStartupScriptPath(def))) throw new FileNotFoundException("startup script missing");

Type guard

static bool StartupScriptReady(Emulator e) { var d = Emulation.GetDefition(e.BuiltInConfigId); return d != null && FileSystem.FileExists(Emulation.GetStartupScriptPath(d)); }

Try / catch

try { controller.StartEmulator(action, asyncExec, args); }
catch (FileNotFoundException ex) { logger.Error(ex, "startup script missing"); dialogs.ShowMessage("Reinstall the emulator support add-on."); }

Prevention

When it happens

Trigger: A built-in profile flagged as needing a startup script, but the supporting definition is missing or its startup script file is absent from disk; the emulator add-on that ships the script was uninstalled/disabled; script file deleted by AV or user cleanup.

Common situations: Emulator support add-on removed or corrupted after the profile was configured; portable install missing the script; AV quarantined the startup script; partial Playnite install.

Related errors


AI-assisted analysis of JosefNemec/Playnite@5911f4e964 (2026-08-13). Data as JSON: /api/errors/bba1e821092e1996. Report an issue: GitHub.