feat: Added update to Nighly/Stable release option

This commit is contained in:
WerWolv
2025-08-09 12:25:22 +02:00
parent 5c3dfa08b2
commit a403980976
3 changed files with 13 additions and 1 deletions

View File

@@ -234,7 +234,7 @@ int main(int argc, char **argv) {
const auto updatePath = downloadUpdate(updateArtifactUrl);
// Install the update
if (installUpdate(*updatePath)) {
if (!installUpdate(*updatePath)) {
// Open the latest release page in the default browser to allow the user to manually update
hex::openWebpage(releaseUrl);

View File

@@ -128,6 +128,8 @@
"hex.builtin.view.hex_editor.menu.edit.redo": "Redo",
"hex.builtin.view.hex_editor.menu.edit.undo": "Undo",
"hex.builtin.menu.extras": "Extras",
"hex.builtin.menu.extras.switch_to_stable": "Downgrade to Release",
"hex.builtin.menu.extras.switch_to_nightly": "Update to Nightly",
"hex.builtin.menu.file": "File",
"hex.builtin.menu.file.bookmark.export": "Export bookmarks",
"hex.builtin.menu.file.bookmark.import": "Import bookmarks",

View File

@@ -633,6 +633,16 @@ namespace hex::plugin::builtin {
static void createExtrasMenu() {
ContentRegistry::Interface::registerMainMenuItem("hex.builtin.menu.extras", 5000);
if (ImHexApi::System::isNightlyBuild()) {
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.extras", "hex.builtin.menu.extras.switch_to_stable" }, ICON_VS_ROCKET, 2750, Shortcut::None, [] {
ImHexApi::System::updateImHex(ImHexApi::System::UpdateType::Stable);
});
} else {
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.extras", "hex.builtin.menu.extras.switch_to_nightly" }, ICON_VS_ROCKET, 2750, Shortcut::None, [] {
ImHexApi::System::updateImHex(ImHexApi::System::UpdateType::Nightly);
});
}
}
static void createHelpMenu() {