Repository navigation
perf(desktop): windows updates skip six powershell checks, cutting install time from 10s to 3s - #231
Merged
Merged
Conversation
…stall time from 10s to 3s
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
This branch was previously deployed
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.
Restarting to install a Windows update took too long. Timing real upgrades between two nightlies showed that more than half of the ~10s NSIS step went to electron-builder's "is the app running" check. That check starts PowerShell three times (an availability probe, an execution-policy probe, then a
Win32_Processpath scan) even when nothing is running. The previous version's uninstaller then runs the same check again.apps/desktop/resources/installer.nshreplaces it viansis.include. It asks whether a running process still holds the main exe or the resource monitor. Windows refuses write access to a running image, and backend children run as the main exe, so one lock covers them. During an update it waits up to 5s for the quitting app to exit. If a lock is still there after that, it hands over to the stock check, which still finds, kills, and prompts.The first release only gets the installer half. The other ~3s goes away once the old version's uninstaller also has the new check.
scripts/windows-upgrade-timing.ps1is the harness behind these numbers. It installs one build, upgrades with another the wayquitAndInstalldoes (--updated /S), splits the NSIS run into phases, then launches the result against a throwawayCADSENSE_HOME. Each run writesreport.md,report.json, and a per-runtimeline.csv. All channels share one app id, so it replaces the installed Cadsense for the current user.Verification
Proved by building real installers with and without the include on Windows using the CI versions of electron-builder (26.15.6) and NSIS (3.0.4.1), then timing upgrades with the harness and forcing the fallback path.
ELECTRON_RUN_AS_NODE(the backend's shape) reads as locked, an idle exe as free, a missing file is not created, and the exe's timestamp is unchanged.scriptstypecheck, lint, and format are clean.build-desktop-artifact.test.tspasses.Limitations
--updated /Swhile a process held the exe), not clicked through a downloaded update..Countin Windows PowerShell 5.1. The fallback inherits that blind spot. The install still succeeds because the uninstaller can rename a running exe.Reviewed with sol-loop: 1 round with gpt-6.1-sol. Sol verdict: approved
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.