SimpleLauncher User Guide
Complete product user guide for SimpleLauncher
Compatibility
Section titled “Compatibility”- Unreal Engine 5.2–5.8
- Version 1.1.0 (Version 2)
Quick Start
Section titled “Quick Start”Launch an external program from your game in just two steps:
Step 1: Configure a Preset
Open Project Settings → Plugins → Simple Launcher, and add a preset in Launchers:
- Set Key to a preset name, e.g.
MyServer - Set CommandLine to the command to execute, e.g.
notepad.exeorpython script.py
Step 2: Call the API to Launch
Call from Blueprint or C++:
FProcessId Id = USimpleLauncherGameSubsystem::StartProcess(FName("MyServer"));The program will start. When the game exits, the plugin will automatically shut it down.
Configuration
Section titled “Configuration”Each preset contains the following settings:
Key (Preset Name)
Section titled “Key (Preset Name)”A name for this preset. All APIs reference presets by this name.
- Use any name you like, e.g.
MyServer,Logger,DataSync - Names must be unique across all presets
CommandLine
Section titled “CommandLine”The full command to execute, including the program path and arguments.
notepad.exe file.txt"C:\Program Files\app.exe" -port 8080'/usr/bin/app' -argIf the path contains spaces, you must wrap the program path in quotes, otherwise parsing will fail.
bLaunchHidden
Section titled “bLaunchHidden”Whether to hide the program window. Defaults to false (window visible).
- Set to
true: the program runs in the background with no visible window - Ideal for background services or tools that don’t need user interaction
bLaunchDetached
Section titled “bLaunchDetached”Controls whether the program is shut down when the game exits. Defaults to false (shut down with game).
false(default): the program is automatically closed when the game exits — ideal for game servers, temporary toolstrue: the program continues running after the game exits — ideal for log collectors or other persistent services
WorkingDirectory
Section titled “WorkingDirectory”The working directory for the program. Defaults to empty (uses the game’s working directory).
- Use an absolute path, e.g.
C:\MyAppor/home/user/app - Relative paths used by the program will resolve based on this directory
API Reference
Section titled “API Reference”All APIs are static functions on USimpleLauncherGameSubsystem, callable from both Blueprint and C++.
Config Management
Section titled “Config Management”| Function | Description |
|---|---|
UpdateConfig(Name, Config, bOverrideIfExists, bCreateIfNotExists) | Create or update a preset |
GetConfig(Name, OutConfig) | Get preset configuration |
GetAllConfig() | Get all presets |
RemoveConfig(Name) | Remove a preset (also stops all its processes) |
UpdateConfig has two optional parameters for precise control:
| Parameter | Default | Description |
|---|---|---|
bOverrideIfExists | true | Whether to overwrite if the preset already exists. Set to false to prevent accidental overwrites |
bCreateIfNotExists | true | Whether to create if the preset doesn’t exist. Set to false to only update existing presets |
In addition to configuring presets in Project Settings, you can create them dynamically at runtime:
FLauncherConfig Config;Config.CommandLine = TEXT("python script.py");Config.bLaunchHidden = true;USimpleLauncherGameSubsystem::UpdateConfig(FName("TempTask"), Config);Presets created at runtime are lost when the game restarts. For persistent presets, configure them in Project Settings.
Process Control
Section titled “Process Control”| Function | Description |
|---|---|
StartProcess(Name) | Start a process, returns ProcessId |
StopProcess(ProcessId) | Stop a single process |
StopProcesses(Name) | Stop all processes for a preset |
StopAllProcesses() | Stop all processes |
You can call StartProcess multiple times on the same preset. Each call launches a new process and returns a different ProcessId:
FProcessId Id1 = USimpleLauncherGameSubsystem::StartProcess(FName("MyServer"));FProcessId Id2 = USimpleLauncherGameSubsystem::StartProcess(FName("MyServer"));// Id1 和 Id2 是两个独立运行的进程Status Queries
Section titled “Status Queries”| Function | Description |
|---|---|
IsProcessRunning(ProcessId) | Check if a specific process is still running |
HasRunningProcesses(Name) | Check if a preset has any running processes |
GetProcessCount(Name) | Get the number of running processes for a preset |
GetProcesses(Name) | Get all running ProcessIds for a preset |
Process Exit Callbacks
Section titled “Process Exit Callbacks”Get notified when a process exits and execute custom logic (e.g. restart, logging).
| Function | Description |
|---|---|
BindProcessExited(ProcessId, Delegate) | Listen for a specific process exit |
UnbindProcessExited(ProcessId, Delegate) | Stop listening for a specific process |
BindProcessesExited(Name, Delegate) | Listen for all process exits under a preset |
UnbindProcessesExited(Name, Delegate) | Stop listening for a preset |
The callback receives two parameters:
ProcessId— which process exitedbNaturalExit— exit reason:truemeans the program terminated on its own,falsemeans it was stopped by code
When callbacks are triggered:
| Scenario | Callback Triggered | bNaturalExit |
|---|---|---|
| Program finishes or crashes on its own | Yes | true |
| Stopped via StopProcess | Yes | false |
| Stopped via StopProcesses | Yes | false |
| Stopped via RemoveConfig | Yes | false |
| Auto-cleanup on game exit | No | - |
Binding the same delegate multiple times is silently ignored — it won’t trigger duplicate callbacks.
Callbacks are not triggered during game exit to avoid accessing destroyed objects, which would cause crashes.
UpdateConfigonly updates configuration data and does not affect already running processes. The new configuration takes effect on the nextStartProcesscall.RemoveConfigstops all processes for the preset before removing it. However, bound callbacks are not cleared — they remain active if you recreate a preset with the same name.
Platform Support
Section titled “Platform Support”The plugin supports Windows, Linux, and macOS. It uses UE’s FPlatformProcess::CreateProc under the hood, so any program the OS can execute can be launched — there are no file type restrictions.
Version History
Section titled “Version History”Open Edit → Project Settings, select the SimpleLauncher settings page, and set Language to English or Chinese. English is the default. Available user-facing UI, tooltips, notifications, and functional logs update immediately without restarting the editor. Public API names and module startup/shutdown logs remain in English.
Contact
Section titled “Contact”For usage questions or collaboration, please visit the contact page.
- Contact: Contact and collaboration
Supplementary Usage Instructions
Section titled “Supplementary Usage Instructions”SimpleLauncher User Guide
Section titled “SimpleLauncher User Guide”Launch and manage external programs through named presets. The same preset can run multiple instances.
Configuration and Process Interfaces
Section titled “Configuration and Process Interfaces”1.1 Preset Configuration System
Section titled “1.1 Preset Configuration System”The plugin uses presets to manage process configuration:
USTRUCT(BlueprintType)struct FLauncherConfig{ // 完整命令行(可执行文件路径 + 参数) FString CommandLine;
// 隐藏进程窗口 bool bLaunchHidden = false;
// 分离运行(true=游戏退出后进程继续运行) bool bLaunchDetached = false;
// 工作目录 FString WorkingDirectory;};You can configure multiple launchers in Project Settings, each with an independent name:
Path: Edit > Project Settings > Simple Launcher
Launchers: "LocalServer" → "D:/Server/server.exe --port 7777" "LogCollector" → "python D:/Tools/log_collector.py" "AIService" → "D:/AI/inference.exe --model gpt"1.2 Process Lifecycle Management
Section titled “1.2 Process Lifecycle Management”Start a process:
// 通过预设名称启动FProcessId Id = USimpleLauncherGameSubsystem::StartProcess("LocalServer");Stop processes:
// 停止单个进程StopProcess(ProcessId);
// 停止某个预设的所有实例StopProcesses("LocalServer");
// 停止所有进程StopAllProcesses();Automatic cleanup:
When bLaunchDetached = false (the default), the plugin automatically terminates the process when the game exits, managing process cleanup at shutdown. Detached processes with this value set to true continue running after the game exits.
1.3 Multiple Instances
Section titled “1.3 Multiple Instances”The same preset can launch multiple instances, each with an independent FProcessId:
USTRUCT(BlueprintType)struct FProcessId{ FName Name; // 预设名称 int32 Index; // 实例索引(自动递增)};// 启动3个本地服务器实例FProcessId Server1 = StartProcess("LocalServer"); // Index = 0FProcessId Server2 = StartProcess("LocalServer"); // Index = 1FProcessId Server3 = StartProcess("LocalServer"); // Index = 2
// 独立管理每个实例StopProcess(Server2); // 只停止第二个IsProcessRunning(Server1); // 检查第一个是否在运行GetProcessCount("LocalServer"); // 返回 2(还剩两个在运行)1.4 Process Exit Callbacks
Section titled “1.4 Process Exit Callbacks”The plugin polls process status through Tick and supports exit notifications at two levels:
Individual process callback:
// 监听特定进程的退出事件BindProcessExited(ProcessId, OnExitDelegate);// 回调参数:ProcessId, bNaturalExit(true=自然退出,false=被强制停止)Preset-level callback:
// 监听某个预设下所有实例的退出事件BindProcessesExited("LocalServer", OnExitDelegate);Typical use: automatic restart:
OnProcessExited(ProcessId, bNaturalExit): if bNaturalExit: // 进程意外退出,自动重启 StartProcess(ProcessId.Name)1.5 Runtime Configuration Management
Section titled “1.5 Runtime Configuration Management”In addition to static editor configuration, the plugin supports dynamic management at runtime:
// 运行时更新配置UpdateConfig("DynamicServer", NewConfig, true, true);
// 查询配置GetConfig("LocalServer", OutConfig);
// 获取所有配置GetAllConfig();
// 删除配置(同时停止该预设的所有进程)RemoveConfig("OldServer");1.6 Smart Command-Line Parsing
Section titled “1.6 Smart Command-Line Parsing”The plugin automatically handles quoted paths and argument splitting:
// 支持带空格的路径"C:/Program Files/MyApp/app.exe" --port 8080
// 也支持不带引号的简单路径D:/Tools/server.exe --config defaultCall Examples
Section titled “Call Examples”Scenario 1: Start a Local Server with the Game
Section titled “Scenario 1: Start a Local Server with the Game”1. Configure the "LocalServer" preset in Project Settings CommandLine: "D:/Server/dedicated_server.exe -port=7777" bLaunchHidden: true bLaunchDetached: false // 游戏退出时自动关闭
2. When the game starts: StartProcess("LocalServer")
3. When the game exits: The plugin automatically terminates the server processScenario 2: Background Data Processing
Section titled “Scenario 2: Background Data Processing”1. Configure a Python script preset CommandLine: "python D:/Scripts/data_processor.py --input data.json" bLaunchHidden: true
2. Start it when needed: FProcessId Id = StartProcess("DataProcessor") BindProcessExited(Id, OnDataProcessed)
3. The callback is triggered automatically when the script finishesScenario 3: Multi-Server Cluster Testing
Section titled “Scenario 3: Multi-Server Cluster Testing”// 启动多个服务器实例for i in 0..4: StartProcess("TestServer")
// 查询运行状态GetProcessCount("TestServer") // 5
// 测试完成后一键停止StopProcesses("TestServer")Installation and Usage
Section titled “Installation and Usage”Step 1: Install the Plugin
Section titled “Step 1: Install the Plugin”Copy the plugin folder into the project’s Plugins directory and restart the editor.
Step 2: Configure Presets
Section titled “Step 2: Configure Presets”Path: Edit > Project Settings > Simple Launcher
Add the launcher configurations you need.
Step 3: Use in Blueprints
Section titled “Step 3: Use in Blueprints”All functions are in the SimpleLauncher category. The core workflow is:
1. StartProcess("预设名") → Obtain ProcessId2. IsProcessRunning(ProcessId) → Check status3. BindProcessExited(ProcessId, Callback) → Listen for exit4. StopProcess(ProcessId) → Stop manuallyLifecycle Notes
Section titled “Lifecycle Notes”When bLaunchDetached is false, game shutdown cleans up processes launched by that configuration. When true, the processes can continue running. Choose the setting according to the external program’s purpose to avoid closing programs that still need to run when testing stops.