Skip to content

Installation and Setup

buntatoes edited this page Nov 28, 2026 · 1 revision

Installation and Setup

EU5 RPC ships as a self-contained native executable with zero external runtime dependencies. You only need Steam, Europa Universalis V (Steam AppID 3450310), and a running Discord desktop client (or compatible client on Linux). No Discord Developer Portal application or manual App ID is required.


Windows Installation

Standard GUI Install

  1. Download EU5-RPC-Setup-v4.1.0-win64.exe from the Latest Release page.
  2. Run EU5-RPC-Setup-v4.1.0-win64.exe and confirm installation.
  3. Double-click the "EU5 RPC" shortcut on your Desktop (or Start Menu) to launch Europa Universalis V with Discord Rich Presence and the system tray icon.

Note

Windows SmartScreen may display "Windows protected your PC" because the release binaries are unsigned. Click More info and then Run anyway, or verify and compile the binary yourself following Build and Packaging.

What the Windows Installer Does

Implemented in src/installer_win.zig, the installer extracts its @embedFile payloads into %LOCALAPPDATA%\EU5-RPC (falling back to C:\EU5-RPC if CSIDL_LOCAL_APPDATA cannot be queried):

  • %LOCALAPPDATA%\EU5-RPC\eu5-rpc.exe — main native executable (built with .windows subsystem so no console window flashes)
  • %LOCALAPPDATA%\EU5-RPC\EU5-RPC-Setup.exe — copy of the installer used for uninstall
  • %LOCALAPPDATA%\EU5-RPC\assets\icon.ico and assets\icon.png — application icons
  • %LOCALAPPDATA%\EU5-RPC\LICENSE and README.md
  • Desktop (EU5 RPC.lnk) and Start Menu (EU5 RPC.lnk) shortcuts via Win32 COM IShellLinkW / IPersistFile
  • Per-user Add/Remove Programs registry entry under HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\Eu5RpcZig

No administrator privileges are required.

Silent Install & Uninstall (Windows)

EU5-RPC-Setup-v4.1.0-win64.exe (and the installed %LOCALAPPDATA%\EU5-RPC\EU5-RPC-Setup.exe) supports headless automation flags:

Command Behavior
EU5-RPC-Setup-v4.1.0-win64.exe --silent Installs to %LOCALAPPDATA%\EU5-RPC without GUI message boxes
EU5-RPC-Setup.exe --uninstall Prompts to remove %LOCALAPPDATA%\EU5-RPC, shortcuts, and registry entries
EU5-RPC-Setup.exe --uninstall --silent Silently removes all installed files, shortcuts, and registry entries

You can also uninstall interactively through Windows Settings -> Apps -> EU5 RPC (Europa Universalis V).


Linux Installation

Native .tar.gz Bundle

The Linux release (eu5-rpc-linux-x86_64.tar.gz) is compiled for x86_64-linux-gnu targeting glibc 2.31+ for broad compatibility across Ubuntu, Debian, Arch, Fedora, openSUSE, Bazzite, SteamOS, and NixOS.

tar -xzf eu5-rpc-linux-x86_64.tar.gz
cd eu5-rpc-linux-x86_64
./eu5-rpc --install
eu5-rpc

What --install Writes on Linux

By default, ./eu5-rpc --install installs into $HOME/.local (or $PREFIX if set) and $XDG_DATA_HOME (defaulting to <base_prefix>/share):

Artifact Default Destination
Executable binary (0755) $XDG_DATA_HOME/eu5-rpc/eu5-rpc (default ~/.local/share/eu5-rpc/eu5-rpc)
Symlink in PATH ~/.local/bin/eu5-rpc -> installed binary
Application icon (256x256) $XDG_DATA_HOME/icons/hicolor/256x256/apps/eu5-rpc.png
XDG Desktop Entry $XDG_DATA_HOME/applications/eu5-rpc.desktop

After writing the desktop entry, EU5 RPC runs update-desktop-database quietly so "EU5 RPC" appears immediately in your desktop application launcher (KDE Plasma, GNOME, XFCE, Cinnamon, etc.).

To install into a custom prefix:

PREFIX=/opt/local ./eu5-rpc --install

Uninstalling on Linux

eu5-rpc --uninstall

This removes the binary, ~/.local/bin/eu5-rpc symlink, icon, .desktop file, and cleans up any legacy Ruby folders inside the app directory. Your user configuration in $XDG_CONFIG_HOME/eu5-rpc/config.toml (or ~/.config/eu5-rpc/config.toml) is left untouched.


Steam Launch Options Integration (%command%)

Instead of launching EU5 RPC via its Desktop shortcut, you can wrap Europa Universalis V directly inside Steam's Launch Options using --launch-with-command -- %command%:

Linux (Steam Properties -> Launch Options)

~/.local/bin/eu5-rpc --launch-with-command -- %command%

If you want EU5 RPC to exit automatically when the game closes, also set exit_when_game_closes = true in config.toml (see Configuration and Usage).

Windows (Steam Properties -> Launch Options)

"%LOCALAPPDATA%\EU5-RPC\eu5-rpc.exe" --launch-with-command -- %command%

How --launch-with-command Interacts with Single-Instance Locking

EU5 RPC enforces a single running daemon per user session:

  • Windows: Named kernel mutex Local\Eu5RpcZigSingleInstance (CreateMutexA).
  • Linux: Advisory fcntl write lock (F_SETLK / F_WRLCK) on $XDG_RUNTIME_DIR/eu5-rpc.lock (falling back to /tmp/eu5-rpc-<uid>.lock).

If an EU5 RPC instance is already running when Steam invokes --launch-with-command -- %command%, the second invocation detects the lock, directly spawns the %command% game process (waiting for its exit so Steam tracks playtime accurately), and exits cleanly while the existing tray daemon continues reporting Rich Presence.


Launching EU5 Automatically

By default (launch_game_on_start = true), starting eu5-rpc without --no-launch or --launch-with-command automatically launches Europa Universalis V via Steam if the game is not already running:

  • Windows: Locates Steam via Registry (HKCU\Software\Valve\Steam, HKLM\SOFTWARE\WOW6432Node\Valve\Steam, HKLM\SOFTWARE\Valve\Steam) or standard Program Files paths and launches "<SteamRoot>\steam.exe" -applaunch 3450310.
  • Linux: Double-forks to detach cleanly and tries in order:
    1. steam -applaunch 3450310
    2. $HOME/.local/share/Steam/steam.sh -applaunch 3450310 or $HOME/.steam/steam.sh -applaunch 3450310
    3. flatpak run com.valvesoftware.Steam -applaunch 3450310
    4. xdg-open steam://rungameid/3450310

Auto-Updater & Legacy Ruby Migration

EU5 RPC includes a built-in pure-Zig updater (src/updater.zig) backed by Zig's std.http.Client and pure-Zig TLS.

Update Check Flow

flowchart TD
    A["Startup or Tray/CLI Trigger"] --> B["GET GitHub API /releases/latest"]
    B --> C{"Valid Release & Not Draft/Prerelease?"}
    C -- "No" --> D["Keep Current Version"]
    C -- "Yes" --> E{"Legacy Ruby Install Detected or SemVer Newer?"}
    E -- "No" --> F["Up to Date"]
    E -- "Yes" --> G["Validate Trusted GitHub Download Host"]
    G --> H{"Platform"}
    H -- "Windows" --> I["Download Setup .exe, Verify MZ Header, Rename Running .exe to .old, Run --silent, Relaunch"]
    H -- "Linux" --> J["Download .tar.gz, Pure-Zig Gzip + USTAR Extract, Verify ELF Header, Atomic Rename, Relaunch"]
Loading

Security Safeguards

  • Host Allowlist: isTrustedDownloadUrl() only accepts asset URLs starting with:
    • https://github.com/buntatoes/eu5-rpc/
    • https://objects.githubusercontent.com/
    • https://release-assets.githubusercontent.com/
  • Size & Magic-Byte Validation: Downloads are capped at 32 MiB and verified for PE (MZ) headers on Windows or ELF (\x7fELF) headers on Linux before installation.
  • Clean Self-Replacement:
    • On Windows, the running eu5-rpc.exe is moved to eu5-rpc.exe.old via MoveFileExW, the downloaded installer runs with --silent, the updated binary is launched with --no-launch --no-update, and cleanupOldBinary() deletes eu5-rpc.exe.old on next startup.
    • On Linux, the extracted ELF binary is written to <exe>.new with mode 0755, atomically renamed over /proc/self/exe, symlinked at ~/.local/bin/eu5-rpc, and relaunched with --no-launch --no-update.

Migrating from Legacy Ruby Releases (v0.1–v0.3.3)

Both the Windows installer (installer_win.zig), Linux --install, and the auto-updater automatically detect legacy Ruby installations:

  • Windows: Checks HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\Eu5RpcRuby and %LOCALAPPDATA%\EU5-RPC\lib\eu5_rpc.rb. On upgrade, deletes the legacy lib\ and bin\ folders and the Eu5RpcRuby uninstall registry key while preserving config.toml and logs\.
  • Linux: Checks $XDG_DATA_HOME/eu5-rpc/lib/eu5_rpc.rb, ~/.local/share/eu5-rpc/lib/eu5_rpc.rb, and ~/.local/share/eu5-rpc/bin/eu5-rpc. On upgrade, removes the legacy lib/ and bin/ directories while keeping your configuration intact.

CLI Update Commands

# Check whether a newer release or Ruby migration is available
eu5-rpc --check-update

# Download and apply the latest release immediately
eu5-rpc --update

# Start without running the background startup update check
eu5-rpc --no-update

Clone this wiki locally