Repository navigation
feat(ENG-4705): install plugin updates in the background, apply on restart (staging) - #270
Merged
vgoat21 merged 1 commit intoNov 18, 2026
Conversation
… them on restart When a newer release is found, download the build for the running Ghidra version, verify it against GitHub's SHA-256 asset digest and unpack it into reai-plugin-update/ in the user settings folder. A shutdown hook starts ExtensionSwapper in its own JVM, which waits for Ghidra to exit and swaps the staged folder over the installed extension, restoring the old one on failure. Adds an 'Install updates automatically' option; with it off, or when the extension is not in the user's Extensions folder, the existing download prompt is shown.
brettwold
approved these changes
Nov 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linear: ENG-4705 (part of ENG-4528)
What changed
The update check added in v1.2.0 now installs updates instead of only opening the download in the browser.
UpdateInstallerdownloads it in the background. It checks the zip against the SHA-256 digest GitHub publishes for each release asset (digestin the releases API), so the release workflow doesn't need a separateSHA256SUMSfile. It then unpacks the zip into<user settings>/reai-plugin-update/. That folder is outsideExtensions/, so Ghidra doesn't load the update as a second copy.ExtensionSwapperin a separate JVM, running from a copy of the plugin jar. The swapper waits for the Ghidra process to exit, then moves the installedplugin-ghidrafolder aside and moves the staged one in. If the move fails, it restores the old folder. It retries the moves for a short while to give Windows time to release file locks.update.log) is written to Ghidra's log and the staging folder is removed. If a staged update is still newer than the running version, for example because the swap failed while another Ghidra instance had the jars open, it is kept and installed on the next exit. No new download is needed, and this works offline.Extensions/folder (for example, it's in the Ghidra install folder),extension.propertieshas been renamed away.Testing
./gradlew test: all 68 test classes pass. New tests:UpdateInstallerTest: extraction, rejecting zip entries that would land outside the extension folder, rejecting a zip with no plugin jar, checksum verification, reading the staged version.ExtensionSwapperTest: install, skipped update, uninstalled extension, rollback when the staged folder is missing.UpdateCheckerTest: parsing the digest../gradlew buildExtensionbuilds against Ghidra 12.1.2.ghidra_12.1.2_plugin-ghidra.zip:ExtensionSwapperran in its own JVM with only its class on the classpath, waited for a stand-in "Ghidra" process to exit, swapped the folder, and cleaned up the staging folder.unknownand skips the update check, so this needs a released build, or a build withreai_ghidra_plugin_version.txtset to an older tag, installed inExtensions/.