Launcher

Executable Setup

Methods for configuring the executable to launch - path, arguments, name, working directory, and environment variables.

Methods for configuring the executable to launch - path, arguments, name, working directory, and environment variables.

WithExecutable sets the full path to the executable file. WithArgument adds a command-line argument - call multiple times to add multiple arguments. WithName assigns a friendly label for identification in logs. SetWorkingDirectory sets the working directory for the launched process. SetEnvironmentVariable sets an environment variable that will be available to the launched process. All configuration methods return the Launcher instance for chaining.

Examples

GPAL Fluent: High-level fluent C# API

//WithArgument adds arguments in the order called - they are passed to the executable in that order. SetEnvironmentVariable sets variables only for the launched process, not for the current GPAL process.

// Configure a launcher with arguments and environment var launcher = GPAL.Launcher .WithExecutable("C:\MyApp\app.exe") .WithArgument("--config=prod") .WithArgument("--verbose") .WithName("MyAppLauncher") .SetWorkingDirectory("C:\MyApp") .SetEnvironmentVariable("APP_ENV", "production") .SetEnvironmentVariable("LOG_LEVEL", "info") .ToGPALObject();