Skip to content

About

migration of GenLauncher to rust egui, with Linux support

Resources

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

Repository files navigation

GenLauncher-Linux

This is a based off of GenLauncher. Tested on Windows 10 and Ubuntu.

image

Why migrate this to Rust?

  1. The original is writen in .NET Framework, which generally isn't suppport on Linux
  2. I comtemplated migrated .NET Framwork to .NET Core, but .NET Core isn't support on BSD, which is a goal
  3. A Systems language is a better language for this kind of tool, as the code base dropped from ~100k loc to ~20k loc.
  4. I have limited time to support this and LLMs can provide more trustworthy outputs for rust.

Install

  1. Grab a binary from the releases
  2. Move the binary into the Generals folder
  3. run executable (Linux users may need to chmod +x binary)

You don't have to launch the vanilla game first, as GenLauncher-Linux will create the options.ini file if it doesn't exist.

If you're having issues running the game, check protondb and configure the compatability mode of the game to use the newest version of proton. I used experimental on ubuntu26.

Linux

The launcher is a native Linux program; it can force the game to run through Proton, and Steam is not required. Which Proton depends on whether the game is a Steam installation (has steam_api.dll in the game folder).

  • A Steam installation Uses Steam's Proton settings to run. Start the game once from Steam first, so Steam has set it up.
  • Anything else runs on the launcher's own GE-Proton. The first launch downloads the latest GE-Proton and the Steam Linux Runtime it was built for (~750 MB, checksums verified), and the game runs inside that runtime, as Steam would run it. Update in the options fetches newer releases.
  • Use a Proton folder of my own overrides both: any Proton, e.g. one installed by Steam or ProtonUp-Qt.

A Steam installation in its Steam library keeps Steam's own prefix, so saves and Options.ini are shared with Steam's launch, whichever Proton runs it. Anything else gets the launcher's own prefix. GE-Proton, the runtime and that prefix live in ~/.local/share/genlauncher/ (runtime/, prefix/), shared by every game folder.

Differences from the original

  • lock file rather than a mutex, so it works the same on Windows/Linux.
  • .rar extraction uses 7-Zip, unrar or unar if one is installed (on PATH, or in 7-Zip's or WinRAR's default folder on Windows). .zip and .7z need nothing.
  • Add mod from files understands downloaded archives. Pick the .zip/.rar/.7z as downloaded (e.g. from ModDB): the name and version are suggested from the file name, wrapper folders are stepped through, a full-game repack is reduced to the files the mod actually changes, and you are asked afterwards whether to delete the archive. A banner.png/.jpg shipped with the mod (or picked alongside its files) becomes the mod's card artwork, or failing that a .bmp it ships (such as its Install_Final.bmp splash), shown whole rather than stretched; and mods added this way are marked "(user added mod)" beside their version.
  • Mods with their own game engine. A mod's .exe/.dll files are never linked into the game. If a mod ships a modified game engine (and so crashes with "Technical Difficulties" on the normal one), the launcher detects it at launch and asks whether to run the mod's engine, the standard one, or not launch. The answer is kept per mod; right-click the mod's card to change it.
  • Game engines. Some mods come with their own custom game engine; sometimes with no .big archives, and .bat scripts to start it (Zero Hour Reimagined). Added from files as a mod, its card is tagged GAME ENGINE. Scripts are read, never run: only their set NAME=value lines and the line that starts the engine are used, and they are left out of the install. When the scripts start one of several engines, that one is used. A package with several scripts (e.g. Updated and Original) starts with the plainest, the one with the fewest settings and arguments; right-click the card, Start with, to switch. A package that brings no game data runs on the game's own, stock AI scripts included; one that also brings .big archives or a Data folder runs on those, as a mod does. An archive with a package per game (Zero Hour/, Generals/) installs the one for the game in use. GenTool does not hook a 64-bit engine.
  • Launch vanilla. A second launch button starts the game with no mods, patches or add-ons, whatever is selected, and leaves the selection alone. GenTool is still used, even when its option is off.
  • No self-update
  • No advertising card
  • Modded executable. Use modded exe files [default] now downloads the repository's ModdedExe and runs it.
  • With Install and autoupdate Gentool on [default], each game launch checks gentool.net and installs or updates GenTool's d3d8.dll in the game folder. With it off, d3d8.dll is moved aside for the run.
  • ultra-wide resolution support.
  • linux binary includes baked in proton support (similar to umu-launcher) for ease of use with non-steam versions of the game

Known issues and their workarounds

  • Steam edition sometimes gets error "Failed to fetch Steam App Name!". Make sure Use modded exe files is on.

  • With more than one monitor, the game can ignore the mouse. This is due to how Wine runs the virtual desktop

  • If the game is running, GenLauncher will refuse to close by design to prevent any race condition from the lock file.

Releases

bumping version in Cargo.toml triggers the release.yml CI

Build and run

cargo run --release

On Windows, build.rs generates the .exe icon from assets/icon.png and embeds it with the version from Cargo.toml.

Tests

cargo test

On Linux, one more drives a whole launch through a stand-in wine script: mod linking into differently-cased folders, the environment Wine receives, waiting for game.dat, and restoring the folder. It claims the process-wide game folder, so run it on its own (CI does):

cargo test game::launcher::tests::proton_launch_end_to_end -- --ignored --exact

A second does the same for a copy of the game outside Steam, on the launcher's own GE-Proton and runtime (stand-ins), and live_listings_parse checks that GE-Proton's and Valve's real release listings still parse, without downloading the archives:

cargo test game::launcher::tests::managed_proton_launch_end_to_end -- --ignored --exact
cargo test live_listings_parse -- --ignored

A third starts a stand-in game engine package in place of the game's engine (CI runs it too), and on any platform a real package archive can be installed and linked into a scratch game folder:

cargo test game::launcher::tests::engine_package_launch_end_to_end -- --ignored --exact
GL_ENGINE_PACKAGE=/path/to/ZeroHourReimagined_1.0.0.zip cargo test tasks::tests::installs_a_real_engine_package -- --ignored --exact

General Network usage:

Action What
Start-up the repository index and the manifests/logos of mods you already have
Adding a mod that mod's manifest and its patch/addon manifests
Installing the mod's files, from its S3 bucket or its share link
Installing (S3 only) one SNTP query to time.windows.com, to warn about a skewed clock
Launching with GenTool on the gentool.net front page, and GenTool itself when it is missing or outdated
Launching Zero Hour with "Use modded exe files" on the repository's modded executable, once
Launching with Vulkan on the Vulkan layer, if the repository has a newer one
Launching on Linux with the launcher's GE-Proton GitHub's GE-Proton release listing and GE-Proton itself, and repo.steampowered.com's Steam Linux Runtime, the first time only; Options > Proton > Update checks for newer ones

About

migration of GenLauncher to rust egui, with Linux support

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages