mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-27 23:37:05 -05:00
feat: Added update to Nighly/Stable release option
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user