Skip to main content

Module updater

Module updater 

Source
Expand description

Self-update checks against GitHub releases.

On Linux, in-app updates are typically disabled (the distro / Flatpak manages updates instead). On Windows, the standalone server can pull a release zip from GitHub, extract it next to the running binary, replace the executable atomically, and open the changelog so the user actually reads it.

The two relevant pieces of public surface are:

Both have *_with variants that take an explicit release-fetching closure; those are the actual implementations and the ones the unit tests exercise.

Structs§

Updater
Marker type used as a namespace for updater-related items.

Enums§

UpdateChannel
Channels RPFM can pull updates from.

Constants§

BETA
Setting value identifying the beta update channel.
CHANGELOG_FILE
Filename of the changelog inside the release archive. Opened with the system handler at the end of update_main_program_with.
REPO_NAME 🔒
REPO_OWNER 🔒
STABLE
Setting value identifying the stable update channel.
UPDATE_EXTENSION 🔒
UPDATE_FOLDER_PREFIX 🔒

Functions§

check_updates_rpfm
This function takes care of checking for new RPFM updates.
check_updates_rpfm_with
Inner function that accepts injectable parameters for testability.
extract_zip 🔒
Extract a zip archive at source into into_dir.
last_release
Fetch the most recent release from GitHub matching update_channel.
update_channel
Read the persisted update channel from settings. Defaults to UpdateChannel::Stable when the setting is missing or unrecognised.
update_main_program
Download the latest release for the configured update channel and replace the running install with it. Opens the changelog at the end.
update_main_program_with
Implementation backing update_main_program, with the release source abstracted as a closure so unit tests can inject a stub release without hitting the network.