stride3d/stride · error · InvalidOperationException

Could not start install package process

Error message

Could not start install package process [{packageInstall}] with options {arguments}

What it means

NugetStore launches an external installer executable (packageInstall) via Process.Start with hidden-window, redirected-output options, and throws this InvalidOperationException when Process.Start returns null — meaning the OS could not spawn the process at all.

Solutions

  1. Check the file at packageInstall exists and is an executable before calling the install API
  2. Re-download/reinstall the package so the installer binary is intact
  3. Unblock the executable (Windows 'Unblock' / antivirus quarantine; chmod +x on Linux)
  4. Run the process with adequate permissions; ensure WorkingDirectory exists

Example fix

// before
await store.Install(package);
// after
var exePath = Path.Combine(store.PackagesPath, package.Id, expectedInstallerName);
if (!File.Exists(exePath))
    throw new FileNotFoundException("Installer executable missing", exePath);
await store.Install(package);
Defensive patterns

Strategy: validation

Validate before calling

if (!File.Exists(installerPath))
    throw new FileNotFoundException("Package installer executable missing", installerPath);

Type guard

bool IsExecutableFile(string path) => File.Exists(path) && (new FileInfo(path).Attributes & FileAttributes.Directory) == 0;

Try / catch

try { await store.Install(package); }
catch (InvalidOperationException ex) when (ex.Message.Contains("Could not start install package process"))
{
    // check antivirus/quarantine, reinstall package
}

Prevention

When it happens

Trigger: Calling the install flow that spawns the package installer when Process.Start fails to create the process, e.g. the executable path does not exist or cannot be executed.

Common situations: Installer binary deleted by antivirus or a failed download; missing/blocked executable (no execute permission on Linux, blocked file on Windows); wrong working directory so a relative path no longer resolves.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14). Data as JSON: /api/errors/ddb42f544ea1b5e7. Report an issue: GitHub.

Appendix: source

Thrown at sources/assets/Stride.Core.Packages/NugetStore.cs:1056

            foreach (var file in Directory.EnumerateFiles(httpCache, fileName, SearchOption.AllDirectories))
            {
                try { File.Delete(file); } catch { /* in use / permission; skip */ }
            }
        }
        catch { /* best-effort */ }
    }

    private static void RunPackageInstall(string packageInstall, string arguments, ProgressReport progress)
    {
        // Run packageinstall.exe
        using var process = Process.Start(new ProcessStartInfo(packageInstall, arguments)
        {
            UseShellExecute = false,
            CreateNoWindow = true,
            RedirectStandardError = true,
            RedirectStandardOutput = true,
            WorkingDirectory = Path.GetDirectoryName(packageInstall),
        }) ?? throw new InvalidOperationException($"Could not start install package process [{packageInstall}] with options {arguments}");
        var errorOutput = new StringBuilder();

        process.OutputDataReceived += (_, args) =>
        {
            if (!string.IsNullOrEmpty(args.Data))
            {
                var matches = powerShellProgressRegex.Match(args.Data);
                if (matches.Success && int.TryParse(matches.Groups[1].Value, out var percentageResult))
                {
                    // Report progress
                    progress?.UpdateProgress(ProgressAction.Install, percentageResult);
                }
                else
                {
                    lock (process)
                    {
                        errorOutput.AppendLine(args.Data);
                    }

View on GitHub (pinned to 96fad776d2)