Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/CollapseLauncher/Collapse/llms.txt

Use this file to discover all available pages before exploring further.

Collapse Launcher’s plugin system lets community developers ship support for additional games without modifying the launcher’s core codebase. A plugin is a native Windows DLL built with NativeAOT that Collapse loads at runtime, communicating with it through COM Interop interfaces defined in Hi3Helper.Plugin.Core.

What plugins can do

Game management

Report install state, installed version, latest API version, preload availability, and expose install/update/uninstall routines that Collapse drives via IGameInstaller.

Launcher UI content

Supply background images, logo overlays, news articles, carousel banners, and social media links through ILauncherApiMedia and ILauncherApiNews.

Multiple regions

A single plugin DLL can expose multiple IPluginPresetConfig instances — one per game region or server type — each with its own metadata, zone name, and API endpoints.

Self-updating

Plugins can provide a CDN list or implement IPluginSelfUpdate so the launcher can check for and download updates without user intervention.

How plugin loading works

Collapse looks for plugin directories in its plugin folder. Each directory whose name matches the pattern Hi3Helper.Plugin.* is treated as a candidate plugin. The loader follows this sequence:
  1. Manifest discovery — The loader reads manifest.json from the directory root to obtain the DLL filename and asset list.
  2. Sentinel checks — Before loading, pending operations (deletion, update application) are applied and the _markDisabled sentinel is checked. Disabled plugins are registered in memory without loading the DLL.
  3. DLL loadNativeLibrary.TryLoad maps the DLL into the process.
  4. Required export resolution — The loader resolves GetPluginStandardVersion, GetPluginVersion, GetPlugin, and SetLoggerCallback. If any export is missing, the plugin is rejected.
  5. Logger injection — A managed callback delegate is passed to SetLoggerCallback so plugin log output flows into Collapse’s logging system.
  6. COM object retrievalGetPlugin returns a void* COM pointer that is marshalled to an IPlugin managed interface via ComInterfaceMarshaller<IPlugin>.
  7. Preset config enumerationIPlugin.GetPresetConfigCount and IPlugin.GetPresetConfig iterate over all IPluginPresetConfig instances, which are wrapped and registered into Collapse’s metadata system.
  8. Optional services — The loader optionally resolves GetPluginUpdateCdnList, SetDnsResolverCallback, SetDnsResolverCallbackAsync, and RegisterSpeedThrottlerService.
The plugin folder path is controlled by LauncherConfig.AppPluginFolder. You can open it from the Plugin Manager UI inside Collapse Launcher.

Architecture: COM Interop + NativeAOT

Collapse Launcher is a .NET 10 WinUI 3 application. Plugins are built as unmanaged native DLLs — typically with NativeAOT — that expose a C ABI entry point (GetPlugin) returning a COM-compatible IUnknown-derived object pointer. The Hi3Helper.Plugin.Core NuGet package contains:
  • All COM interface definitions (IPlugin, IPluginPresetConfig, IGameManager, ILauncherApiMedia, ILauncherApiNews, IPluginSelfUpdate, IGameInstaller, IGameUninstaller).
  • The GameVersion struct used for version negotiation.
  • Update-related types (PluginManifest, PluginManifestAssetInfo, SelfUpdateReturnInfo, SelfUpdateReturnCode).
  • Utility delegates for logging, DNS resolution, and speed throttling.
Because plugins are native DLLs, they can be written in any language that can produce a standard Windows DLL with the correct C ABI exports — though C# with NativeAOT is the reference implementation.
UPX-packed plugin DLLs are detected and flagged. Collapse will log a warning and the plugin may behave unstably. Do not compress plugin binaries with UPX.

Plugin Manager UI

The Plugin Manager is accessible from Collapse Launcher’s Settings page. It provides:
  • A list of all discovered plugins with their name, version, author, and description.
  • Toggle controls to enable or disable individual plugins (takes effect on next launch).
  • Uninstall controls that mark a plugin for deletion (_markPendingDeletion) — files are removed on the next launcher start.
  • Update controls to manually or automatically check for and apply updates.
  • A button to open the current plugin’s directory in Windows Explorer.
  • An auto-update setting (IsEnablePluginAutoUpdate) that runs update checks in the background on launch.

Plugin discovery and installation

Plugins are installed by placing a properly structured directory in the plugin folder, or by using the Plugin Manager’s import flow. The importer accepts two formats:
A .zip archive whose root (or a single top-level subdirectory) contains manifest.json alongside all plugin assets. Files may be Brotli-compressed with a .br extension inside the archive.
On import, Collapse:
  1. Reads manifest.json to determine the DLL name and asset list.
  2. Creates a directory named Hi3Helper.Plugin.<DllNameWithoutExtension> inside the plugin folder.
  3. Copies all assets into that directory, verifying MD5 hashes for non-manifest files.
  4. Registers the new PluginInfo instance without restarting — the plugin is immediately available.
The plugin directory name is derived from MainLibraryName in the manifest. For a DLL named MyGame.Plugin.dll, the directory will be Hi3Helper.Plugin.MyGame.Plugin.

Build docs developers (and LLMs) love