Repository navigation
Use win-updater.exe in update API impl - #177
Conversation
Use an external executable instead of script
There was a problem hiding this comment.
🟡 Changes recommended
Cancellation does not terminate the installer helper after readiness, allowing a cancelled update to install if the application exits within the helper’s 60-second wait window.
1 open issue
What changed in this PR
Delegates Windows in-place updates to win-updater, replacing the script-based flow to address the risk of installers being swapped after verification.
Changes:
- Requires a configured native helper beside the application executable.
- Waits for the helper’s
READYsignal before requesting application exit, with timeout and failure handling. - Replaces Java-side signature verification and its tests with helper-command and handshake tests, and documents deployment requirements.
| File | Description |
|---|---|
src/test/java/org/cryptomator/windows/update/InstallerUpdateMechanismTest.java |
Tests helper configuration, command arguments, readiness, and failures. |
src/test/java/org/cryptomator/windows/update/AuthenticodeIT.java |
Removes tests for the deleted Java signature verifier. |
src/main/resources/WinIntegrationsBundle.properties |
Removes the unused restarting message. |
src/main/java/org/cryptomator/windows/update/InstallerUpdateMechanism.java |
Launches the native helper and handles its readiness handshake. |
src/main/java/org/cryptomator/windows/update/Authenticode.java |
Removes Java-side Authenticode verification. |
README.md |
Documents the helper requirement and configuration property. |
CHANGELOG.md |
Records the updater refactor and security change. |
Review effort: Balanced
| public UpdateStep secondStep(Path workDir, Path assetPath, DownloadUpdateInfo updateInfo) { | ||
| return UpdateStep.of(Localization.get().getString("org.cryptomator.windows.update.installer.verifying"), () -> this.verify(workDir, assetPath)); | ||
| // the updater verifies the installer before it reports to be ready, so this step covers starting it and the handshake | ||
| return UpdateStep.of(Localization.get().getString("org.cryptomator.windows.update.installer.verifying"), () -> this.startUpdater(workDir, assetPath, updateInfo.asset().digest())); |
There was a problem hiding this comment.
Not implemented.
After download we wait for the "READY" signal. Once received, we return UpdateStep.EXIT, meaning "terminate and update now". Additionally, our UpdateStep impl is given by UpdateStepAdapter which cancels by interrupt, and we are interruptible during the wait for the READY signal.
|
No actionable comments were generated in the recent review. WalkthroughInstaller updates now require the Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Possibly related PRs
Merge Risk:
|

This PR refactors the implementation of the update API. (see #164 )
The old implementation had a TOCTOU issue: The temporary script did not locked the installer files, but verification was done in this lib. An attacker could have swapped the installer after the verification.
The script approach is replaced by using a native executable to update, see also https://github.com/cryptomator/win-updater. If the exe is not present next to the binary running the app (and this lib), the update fails. The name of the update helper must be specified via the property
cryptomator.integrationsWin.updateHelperName.