System Variables
System Variables allow your launcher to interact directly with the user's operating system and hardware. They provide a powerful way to fetch localized file paths, hardware specifications, and user identities to create a highly personalized launcher experience.
The Crucial Difference: File Paths vs. UI Logic
Before diving in, it is important to understand that the launcher handles File Paths and UI/Logic Variables differently. Because both use percent signs, they are easy to mix up!
1. File Paths (Auto-Parsing Environment Variables)
If you are simply telling the launcher where a file is located (e.g., launching a local file, downloading a file, or reading an INI file), the runtime engine features a built-in auto-parser.
You can type standard Windows environment variables using single percent signs—like %AppData%\MyGame\config.ini or %LocalAppData%—directly into path fields in the editor. The engine will automatically expand these behind the scenes. You do not need to use the Variables system for this.
2. UI and Logic (System Data Variables)
If you want to use system data inside your launcher's user interface (like making a text label say "Welcome, JohnDoe") or in your logic (like checking if the user has enough RAM before letting them click Play), you cannot just type %username%.
Instead, you must use an Action to "fetch" the data from the PC and store it in your Global Memory Bank. Once it is stored, you display it using the universal %-%variable_name%-% syntax.
Available System Data Types
When you want to fetch system data to use in your UI or logic, the runtime engine supports specific "keys". When configuring your Action, you will use these exact keys:
username- Fetches the current logged-in Windows/OS username (e.g., "JohnDoe").myDocuments- Returns the absolute file path to the user's Documents folder.desktop- Returns the absolute file path to the user's Desktop folder.osVersion- Returns the operating system and architecture type (e.g., "windows amd64").computerName- Fetches the hostname of the user's PC.cpuName- Fetches the system architecture (e.g., "amd64").totalRam- Returns the total virtual memory (RAM) available on the system in Megabytes (MB).
Advanced System Data (Parameters Required)
Some system data requires extra instructions to know what to look for. In the editor, these parameters are separated by a pipe character (|).
envVar- Fetches a specific Windows Environment Variable to store in memory. Format:envVar|VARIABLE_NAME(e.g.,envVar|APPDATA)regKey- Directly queries the Windows Registry (highly useful for finding auto-detected install paths like Steam games). Format:regKey|ROOT|PATH|VALUE_NAMEExample:regKey|HKCU|Software-!BS!~Valve-!BS!~Steam|SteamPath(Note: In the runtime, backslashes inside registry paths are escaped using the-!BS!~string to prevent formatting errors).
How to Fetch and Use System Variables
To use this data in your launcher's design or logic, you must bridge the gap between the user's system and your Global Variables.
- Create a Global Variable: Open the Variables manager (database icon) and create a blank variable to catch the data (e.g., name it
user_ramorsys_username). Leave the default value blank. - Trigger the Action: Select an object (like a Button, or the Page itself via On Page Load events) and add a new Action.
- Select the Action: Set Variable from System Data.
- Configure the Action:
- System Data Config: Enter the system key you want to pull (e.g., type exactly
usernameortotalRam). - Target Variable: Enter the exact name of the Global Variable you created in step 1.
- System Data Config: Enter the system key you want to pull (e.g., type exactly
- Display or Use the Data: Now that the system data is safely stored in your variable, you can display it in a text label by typing
Welcome back, %-%sys_username%-%!, or use it in a Logic Action to compare if their%-%user_ram%-%is greater than8000.
Timing is Key: If you try to display the variable before the Action has run, it will appear blank. A best practice is to attach the "Set Variable from System Data" action to your Page's On Load events so the data is fetched and ready the moment the user sees the screen.
Summary
By understanding the difference between file path auto-parsing and UI variables, you unlock dynamic hardware and OS integration. Using the Set Variable from System Data action allows you to effortlessly verify hardware requirements, greet your users by name, and create a smarter, fully autonomous game launcher.