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:
check_updates_rpfm— non-destructive: returns anAPIResponsedescribing whether an update is available, what kind, and what version.update_main_program— performs the actual download / extract / replace, then opens the changelog.
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§
- Update
Channel - 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
sourceintointo_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::Stablewhen 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.