Skip to content

add in-app updates for rstudio desktop on macos and windows - #19399

Merged
kevinushey merged 44 commits into
mainfrom
feature/17173-desktop-auto-update
Nov 6, 2026
Merged

kevinushey merged 44 commits into
mainfrom
feature/17173-desktop-auto-update

Conversation

@kevinushey

@kevinushey kevinushey commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Intent

RStudio Desktop can only tell users that a new version exists and send them to the download page. This PR adds an in-app update path for open-source RStudio Desktop on macOS and Windows: the update is downloaded in the background and installed on restart, mirroring what Positron ships today. Linux keeps the notify-only flow pending #4186. Pro desktop builds (a .pro version suffix) are excluded: Workbench has its own distribution and will need its own update infrastructure.

Addresses #17173. Also the mechanism asked for in #19333.

Approach

The desktop (Electron main process) owns the mechanics; GWT keeps every dialog and the usual quit sequence. No new hosting is needed: the builds site's JSON API (https://dailies.rstudio.com/json-api/, OpenAPI at /api/v1/openapi.json) already lists every build with its download link and SHA-256.

  • Check. src/node/desktop/src/main/updater.ts reads the index for this build's channel (from the version's pre-release tag): /api/v1/release/index.json for releases, whose released[0].published[0] is the current release's newest published build; the branch index (/rstudio/<branch>/index.json) for dailies and previews; /rstudio-hourly/<branch>/ for hourlies. It compares versions numerically including the build number (semver would treat two dailies as equal) and answers GWT with the same keys as the session's check_for_updates RPC plus can-install. Anything other than "available" / "up-to-date" (Linux, dev builds, a branch not on the site, the site unreachable) makes GWT fall back to the session check and today's "Quit and Download" dialog. When the API lists the DMG but not yet the zip, macOS also gets that dialog, now linking straight to the DMG.
  • Download. macOS hands Electron's built-in autoUpdater (Squirrel.Mac) a one-entry feed in its own format, served from a loopback listener since the dailies API is a different shape; Squirrel verifies the zip and the new bundle's code signature. The zip is the new RStudio-<version>.zip that make-package produces next to the DMG, which notarize-release.sh now accepts and the macOS pipeline publishes to the builds site as the electron/macos-zip platform. Windows downloads the NSIS installer named by the API and verifies its SHA-256 and its Authenticode signature (Posit Software, PBC). Completion is reported to GWT through desktopHooks.onUpdateDownloaded / onUpdateDownloadFailed.
  • Install. On "Restart Now", GWT runs its normal quit sequence (save prompts, session shutdown) and the desktop applies the update as the main window quits: autoUpdater.quitAndInstall() on macOS, or spawning the installer with /S /<allusers|currentuser> /update on Windows. NsisMultiUser refuses a silent run without the mode, so it is read from the registry InstallLocation; an unpacked-zip install gets can-install: false and the manual flow. The new /update switch in the NSIS template waits up to 60s for rstudio.exe to exit instead of aborting, and relaunches RStudio as the user (not the elevated installer) when done.

Two things learned from the live API shaped the code: a released branch's own index lists unpublished patch candidates (blue-mistflower shows 2026.10.2+241 today), which is why releases go through /api/v1/release/; and a branch index can briefly list artifacts of two builds while the site rebuilds, so the install artifact is only used when it is the same build as the one offered.

Administrator control. The RSTUDIO_DISABLE_IN_APP_UPDATES environment variable keeps the update notification but sends users to the download page instead of offering "Install and Restart" (packaged Desktop builds do not read an rsession.conf, so there is no option for it). The existing RSTUDIO_DISABLE_CHECK_FOR_UPDATES still turns update checks off entirely. Documented in the environment variables reference.

For testing a build against another channel or copy of the API, the desktop honours RSTUDIO_UPDATE_API_URL, RSTUDIO_UPDATE_CHANNEL (also enables updates for -dev builds), RSTUDIO_UPDATE_BRANCH, and the existing RSTUDIO_UPDATE_VERSION.

Rejected alternatives, for the record: a self-hosted releases.json on cdn.posit.co (an earlier revision of this PR; it duplicated what the builds site publishes and needed new infrastructure); electron-updater, which is designed around electron-builder's manifests and installer conventions (we package with CPack, not Forge makers, so the "Forge vs electron-builder" question in the issue is moot); Squirrel.Windows, which would replace the NSIS installer reworked in #18167; Sparkle/WinSparkle, which need native addons.

Automated Tests

  • Desktop unit tests for the pure parts: version parsing (including the .pro suffix) and comparison, channel, branch slug and index URL selection, release-index and build-index parsing and validation, the Squirrel feed document (update-feed.test.ts), and registry parsing / install-mode detection (windows-install-mode.test.ts).
  • The parsers were also run against the live API: the release path resolves 2026.10.1+239 with matching link and SHA for macOS and Windows, and the daily and hourly branch indexes parse.
  • Not covered: the NSIS /update path, the Jenkins changes, and a real Squirrel.Mac install, which all need a signed CI build. See QA notes.

QA Notes

Windows is complete as of this PR: an open-source released or daily build checks the API and, when a newer build is listed, offers "Install and Restart". macOS offers "Install and Restart" once the macos-zip platform is published for a newer build; until then it offers "Quit and Download" with a direct DMG link. On Linux, for Pro desktop, for developer builds, and wherever an administrator sets RSTUDIO_DISABLE_IN_APP_UPDATES, nothing changes.

To exercise the flow on a signed build without waiting for a newer build, launch it with RSTUDIO_UPDATE_VERSION=<an older version> (and RSTUDIO_UPDATE_CHANNEL=daily RSTUDIO_UPDATE_BRANCH=parrot-balsam to point a release build at the dailies):

  1. Help > Check for Updates shows "Install and Restart" (macOS once the zip is listed; Windows installs made by the installer) or "Quit and Download..." (Windows zip installs, macOS without a zip, Linux).
  2. "Install and Restart" shows a download progress message and the dock / taskbar progress bar, then "Update Ready to Install" with "Restart Now" / "Later".
  3. "Restart Now" runs the usual save prompts, quits, and relaunches on the new version. On Windows an all-users install shows one UAC prompt.
  4. "Later", then a second Check for Updates, goes straight to the restart prompt without downloading again.
  5. A tampered download (serve a copy of the API with a wrong sha256 via RSTUDIO_UPDATE_API_URL) fails with an error dialog and no changes on disk.

App Transport Security does not block the loopback feed: Electron's base Info.plist sets NSAllowsArbitraryLoads, the shipping app inherits it (checked on 2026.11.0-daily+174 in /Applications), and a probe under the same Electron 44 binary showed Squirrel fetch /releases.json from 127.0.0.1, report update-available, and download the zip from the same listener, failing only at unpack because the probe served garbage.

Companion PR: rstudio/latest-builds#281 adds the electron/macos-zip platform pages for Parrot Balsam (the builds site names platforms in a per-branch _index.md), and should merge first.

Documentation

package/README.md gains an "In-app update feed" section covering which API endpoints are read, the macOS zip, the administrator option, and the test environment variables. The environment variables reference documents RSTUDIO_DISABLE_IN_APP_UPDATES. The user-facing change is in NEWS.md; the User Guide's update section can be revised once the flow is confirmed on a release build.

Checklist

  • If this PR adds a new feature, or fixes a bug in a previously released version, it includes an entry in NEWS.md
  • If this PR adds or changes UI, the updated UI meets accessibility standards (new dialogs reuse the existing generic dialog with element ids and keyboard defaults)
  • A reviewer is assigned to this PR (if unsure who to assign, check Area Owners list)
  • This PR passes all local unit tests

The desktop now checks a per-channel releases.json feed itself and, when
an update is available, downloads it in the background and installs it
on restart ("Install and Restart"). macOS hands the feed to Electron's
autoUpdater (Squirrel.Mac), which installs from a zip of the signed app;
Windows downloads the NSIS installer, verifies its SHA-256, and runs it
silently with the new /update switch once RStudio has quit, after which
the installer relaunches RStudio as the user. GWT keeps every dialog and
the usual quit sequence; the desktop reports download completion through
desktopHooks.

Where no feed is published for a build (Linux, dev builds, or until the
CDN prefix exists), the desktop answers "unsupported" and the session's
existing check and "Quit and Download" dialog run unchanged.

Packaging: make-package now also produces RStudio-<version>.zip, the
notarize script accepts it, package/update-feed.cmake writes the feed
entry, and the macOS/Windows Jenkins pipelines upload the zip and publish
the feed when RSTUDIO_UPDATE_FEED_BUCKET is configured.

Addresses #17173
@kevinushey kevinushey added this to the 2026.12 (Parrot Balsam) milestone Nov 2, 2026
dailies.rstudio.com already publishes every build with its link and
SHA-256: /api/v1/release/index.json resolves the current release's newest
published build, and the branch (daily, preview) and rstudio-hourly
indexes cover the other channels. Use that instead of generating and
hosting a releases.json, which removes package/update-feed.cmake, the
"Publish Update Feed" Jenkins stages, and the CDN prefix and Jenkins
variables they needed.

Squirrel.Mac still wants its own feed shape, so on macOS the updater
serves a one-entry document for the chosen build from a loopback
listener. The zipped .app it installs from is now published to the
builds site as the electron/macos-zip platform; until that entry exists
for a build, macOS offers the DMG through the "Quit and Download" path.
A branch index can briefly list artifacts of two builds while the site
rebuilds, so the install artifact is only used when it is the same build
as the one offered.

Addresses #17173
@kevinushey

Copy link
Copy Markdown
Collaborator Author

Companion PR for the builds site: rstudio/latest-builds#281 adds the macos-zip platform pages for Parrot Balsam (daily and hourly, electron and electron-pro). It should merge first, so the first Jenkins run that publishes the zip lands in a folder that already exists and the entry reaches the JSON API.

Pro desktop builds (a .pro version suffix) never update in-app: Workbench
has its own distribution and will need its own update infrastructure. The
updater answers "unsupported" for them, make-package skips the zip, and
the macOS pipeline skips notarizing, uploading and publishing it.

Administrators can keep the update notification but send users to the
download page instead with allow-in-app-updates=0 in rsession.conf or
the RSTUDIO_DISABLE_IN_APP_UPDATES environment variable, following the
posit-assistant-installation-enabled pattern; the session reports it as
allow_in_app_updates and GWT then uses the session's check only.

Addresses #17173
… safer windows staging

- drop the allow-in-app-updates session option: packaged Desktop passes
  --config-file none and allowOverlay() is true in open-source, so it could
  never turn the feature off; RSTUDIO_DISABLE_IN_APP_UPDATES, now read by
  the desktop itself, is the single switch
- daily and hourly builds follow the branch the release index lists as in
  development instead of the branch they were built from, so a build is not
  stranded on its old branch after a release cut
- "Restart Now" first asks the desktop whether the update can be applied;
  on Windows that means no other rstudio.exe is running, since the installer
  refuses to run beside one and quitting one window would strand the user
- windows staging: reuse an already verified installer (another instance, or
  "Later" followed by a relaunch), download under a private name until
  verified, prune installers no newer than the running build at startup,
  and recheck the installer exists before launching it
- report the artifact actually downloaded on macOS rather than whatever the
  latest check found
- notarize-release.sh requires a clean notarytool exit and an Accepted
  status for both the DMG and the zip
- dismiss a previous download indicator before showing another
…nstall, re-offer the restart

- Electron's renderer, GPU and utility children are also rstudio.exe, so the
  other-instance probe excludes every pid in app.getAppMetrics()
- the Windows staging directory is keyed by the install directory, so a
  second copy of RStudio (an unpacked zip, say) never prunes or reuses
  another installation's staged installer; a staged installer is also
  re-verified before being reported ready again
- when the "close other windows" warning is dismissed, the restart dialog is
  shown again rather than requiring another update check
…ancel an abandoned install, reopen the project

- the in-flight download guard is taken before anything is awaited, so two
  overlapping requests can no longer both start
- canInstallUpdate() now answers why not: "missing" when the staged installer
  no longer verifies (GWT downloads it again) or "other-instances"
- a pending install is cancelled when the client abandons its pending quit
  (the session refused it, or the user cancelled), so a later ordinary quit
  does not install; the download stays staged
- the active project is remembered in relaunch-project.json before the quit
  and reopened once by the relaunched RStudio, matching Restart RStudio;
  the marker expires after 15 minutes
…he aliased project path

- forgetRelaunchProject() logs instead of throwing, so a marker that cannot
  be removed never stops startup
- the session reports the active project as ~/..., which existsSync cannot
  see; the desktop resolves it before remembering it (the no-project
  sentinel passes through)
… marker to the installed build, test the staging rules

- the Windows preflight runs again inside onReadyToQuit, since another
  RStudio window may have been opened while the save prompts were up
- relaunch-project.json now names the build and installation it is for;
  only that build, running from that install directory, consumes it, so an
  older build or another installation launched in between leaves it alone
- the Windows staging rules (reuse a verified installer, download beside the
  final name, verify size and checksum, prune obsolete files) move to
  installer-staging.ts with an injected fetch and get behavioural tests
  against real files: checksum mismatch, truncated download, HTTP error,
  reuse without fetching, replacement of a corrupt file, pruning
…ch marker per installation

- otherRStudioProcessCount() answers null when tasklist fails, and the
  preflight (and a failed IPC call) then report "unknown", which keeps
  RStudio running with its own message instead of letting the installer
  give up silently after the quit
- relaunch markers live in relaunch-project/<install key>.json, so two
  installations never overwrite or cancel each other's; a marker is only
  reopened if it could also be removed, so it is consumed at most once
Squirrel.Mac waits for every process of the bundle to exit, so a second
project window blocks the install just as it does on Windows. The probe
moves to running-instances.ts, listing rstudio.exe with tasklist on Windows
and this installation's executable with ps on macOS, and the preflight runs
on both platforms.
Two launches of the updated build can both read the marker before either
removes it; unlink() succeeds for one of them only, so the project is
reopened exactly once. The marker directory is a parameter so the race and
the per-installation rules are unit-tested against a scratch directory.
…nce probe and the marker claim

- installationKey() lower-cases the directory only on Windows; a macOS
  volume may be case-sensitive, so two installations differing by case keep
  distinct keys
- otherInstanceCount() takes the platform and a command runner, and is
  tested for own-process exclusion, foreign instances, a failed listing
  (null, not 0) and platforms without an installer
- the marker claim is its own function, so the test can interleave two
  readers before either claims; the undeletable-marker case is tested with a
  read-only directory
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

RStudio E2E - all platforms

All tests passed!

#################### 100% pass rate

Passed Failed Skipped Flaky
5094 0 236 3
Platform ✅ Passed ❌ Failed ⚠️ Skipped 🔁 Flaky
✅ auth-teardown 4 0 16 0
✅ desktop-linux 1275 0 45 0
✅ desktop-macos 1281 0 40 0
✅ desktop-windows 1272 0 52 2
✅ server-linux 1214 0 51 1
✅ setup 48 0 32 0
View / download the full report

View report online -- opens in the browser, no download needed. Available for 14 days.

Download playwright-report.zip -- extract and open index.html

Includes screenshots, traces, and step-by-step details for every test. Expires in 15 days.


All platforms - commit 712d6205caca87979a56385a1894124232ef3af7 - Run #2027

…aunch marker atomically

- every update offered this session is kept by version, and downloadUpdate()
  takes the version the accepted dialog showed, so a dialog that outlived a
  later check cannot stage the newer build the user may have declined
- the relaunch marker is written to a private name and renamed into place,
  so a launch reading it concurrently never sees (and discards) a partial file
…load for another build

The restart dialog, its preflight and installUpdate() now all carry the
version they are about, so a stale dialog can no longer install whatever
was downloaded last; a request to download another build while one is in
progress is reported instead of dropped; the relaunch marker's cleanup can
no longer throw out of the install request; and the running-instances test
uses a foreign pid that cannot collide with its own.
…the quit handoff, test the updater

installUpdate() now runs the preflight itself and records the install in
the same turn, answering GWT like canInstallUpdate() so the quit follows
only on success; downloads are refused while an install is pending; the
quit handoff checks again and tells the user when it cannot install; and
GWT drops the pending quit when R returns to its prompt after acknowledging
one (.Last() or the workspace save failed). The updater's surroundings are
an injectable host, with tests for these state transitions.
…dow during the install handoff

The session now sends a quit_aborted client event when R refuses a quit
it had acknowledged (.Last() or the workspace save failed), whether quit()
returns or R long-jumps back to its prompt; ApplicationQuit drops the
pending quit on it, replacing the console-prompt heuristic. The main window
refuses to close while applyPendingUpdate() is deciding, so the process
cannot end before the installer is launched. Updater tests cover the
handoff flag and the release channel's chained requests.
…er prompts, one quit at a time

The definition had landed in rstudio::session while callers bind to
http_methods::, which the dynamic-lookup link let through; a browser()
prompt inside .Last() no longer counts as an abandoned quit; and GWT ignores
a quit request while one is in progress, so an abort event can only ever
belong to the current attempt.
…itch's progress on an aborted quit

launchInstaller() resolves once the installer has spawned or refused to,
with the window held open meanwhile; a refusal drops the relaunch marker
and warns the user like the other handoff failures. ApplicationQuit keeps
the quit's progress indicator and dismisses it when the session reports
the quit aborted, which a project switch would otherwise leave up.
…cannot start

performQuit() now answers whether it started the quit, with the one-at-a-time
guard moved there from QuitCommand; the restart dialog cancels the install
it had just recorded when a quit (a project switch, say) is already under
way, so that quit's exit neither installs nor reopens the old project.
ApplicationQuit.claimQuit() reserves the one quit in progress for a caller
that must arm something first; the update restart and the renv R switch
claim it before the desktop frame records the install or holds the R, and
release it when that fails, so a quit already under way can neither
consume what they armed nor be cancelled by them. cancelPendingInstall()
drops only the named version's record, and the quit handoff installs
nothing when the record was cancelled while its checks ran.
…ct out of the installer, test the quit gate

setPendingRVersion() now gives the chosen R thirty seconds to describe
itself (detectREnvironmentAsync kills it after a timeout) so a hung R
cannot hold the quit claim forever; the Windows installer runs without
RS_INITIAL_PROJECT and RS_INITIAL_WD so its relaunch consumes the relaunch
marker; and the one-quit-at-a-time logic is a plain QuitGate with GWT unit
tests for overlapping claims, release, reuse and reopening.
…irst

detectREnvironmentAsync() answers a timeout with its error before parsing
or caching the output, so an R that describes itself and then hangs is
not restarted into; tested with a stand-in R that answers and sleeps.
A restart accepted while an acknowledged quit waits in .Last() would
replace the desktop frame's pending quit, so the session's exit would
restart it instead, leaving the quit gate closed for good.
…-auto-update

# Conflicts:
#	src/gwt/src/org/rstudio/studio/client/renv/RenvRVersionManager.java
@kevinushey
kevinushey requested a review from gtritchie November 4, 2026 21:47
…g, mark at handoff

- quit_session: an aborted quit (an error in .Last()) now puts back the
  project, working dir, project id, next session url / switch-to-project
  path and R version it had written down, so a later ordinary quit is an
  ordinary quit; covered by a server e2e test
- the automation bridge reports the session ready again on quit_aborted
- running-instances: the tasklist / ps call times out (30s) and answers
  null, so a stalled listing cannot hold the quit claim forever
- updater: the relaunch marker is written at the handoff to the installer
  rather than when the restart is accepted, so its 15-minute lifetime no
  longer runs during the session's shutdown
…dows' switch

- an aborted R version switch also puts back the project's last R version
  (and its .Rproj.user hint), which setProjectLastRVersion() had overwritten
- the switch-to-project setting is shared by a desktop installation's
  windows: restore it only while it still holds this session's own entry

@gtritchie gtritchie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes on the in-app update flow. The inline comments cover the details; in rough order of severity:

  • On Windows, a silent update that fails or is refused (UAC cancelled, the 60s wait, install errors) leaves RStudio closed and never relaunches it.
  • The new quit gate never reopens if a quit stalls before the session answers, so later quits, including closing the window, are ignored.
  • An accepted install can be applied by a later, unrelated quit.
  • Preview builds are offered unpublished patch candidates (confirmed against the live API).
  • The Windows installer runs silently with no Authenticode check.
  • The desktop check drops the session check's urgency and its server-side "no update" answer.

The rollback of an aborted project or R-version switch in 80dc196 and 0df2d68 resolves what I would have raised about notifyQuitAborted leaving the switch state behind.

The PR description still documents allow-in-app-updates=0 in rsession.conf and an allow_in_app_updates session flag. Neither exists any more; only RSTUDIO_DISABLE_IN_APP_UPDATES remains (as package/README.md says).

; RSTUDIO CHANGE - an in-app update ends by bringing RStudio back. Run it as
; the user who launched the updater, never as the elevated installer.
;
${If} $UpdateMode = 1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The relaunch only happens on the success path. Every other way the silent installer can exit leaves RStudio closed, with nothing telling the user why:

  • UAC cancelled, or a user with no admin credentials on an all-users install. In silent mode, NsisMultiUser's MultiUser.Elevate (pinned a33d494c62ad) handles error 1223 with SetErrorLevel + Quit in the outer instance, so this section never runs.
  • rstudio.exe still running after the 60s wait, which hits the Abort at line 712.
  • Any install error.

The result is neither RStudio nor the update, which the preflight checks were written to prevent. Suggestions: have the outer instance relaunch RStudio whenever the inner one fails or is refused, and/or have canInstall() decline all-users installs when the user can't elevate.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 5c7a902, both suggestions. In update mode .onInit now elevates an all-users install itself with UAC_RunElevated before MULTIUSER_INIT (NsisMultiUser's Elevate quits the outer instance right after the inner one returns, and .onGUIEnd is not called in silent mode, so there was no later hook): a declined prompt, a failed elevated instance, or a non-zero inner exit code shows a message and relaunches the registered rstudio.exe as the user. .onInstFailed does the same for an install that fails in the instance talking to the user, and the 60s timeout now shows its message instead of auto-answering it. On the desktop side (02697a6) canInstall() declines an all-users install unless the user is in the Administrators group (whoami /groups), so a credentials prompt is never raised. I have no way to run NSIS here, so this part is unverified.

RVersionSpec switchToRVersion,
Command onQuitAcknowledged)
{
if (!quitGate_.start())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The gate closes here and reopens only in onFailedToQuit / onQuitAborted. A quit that stalls before the session answers therefore makes every later quit a no-op, including the one that closing the main window sends through desktopHooks.quitR().

Ways it can stall:

  • The setPendingQuit IPC rejects. desktop-bridge.ts:469 logs the error and never calls the callback.
  • A LastChanceSaveEvent token is never released.
  • quit_session never answers.

Before this change, closing again re-ran the sequence (the closeEvent comment in main-window.ts, #18818). Now the window can't be closed short of killing the process. The new 30s process-listing timeout doesn't cover these cases. Possible fixes: a timeout on the gate, or reopening it when quit is requested again after some time has passed.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in c49af2f. QuitGate now admits the next quit once the one in progress is 30s old (kStaleQuitMs), which restores the close-again-re-runs-the-sequence behaviour for a stalled quit; the abort race the gate exists for is accepted only for a quit that old, documented in the class comment. The bridge's setPendingQuit also calls back on an IPC error now, which was the first of the three stall routes.

String switchToProject,
RVersionSpec switchToRVersion,
Command onQuitAcknowledged)
public boolean performQuit(TutorialApiCallContext callContext,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All callers ignore the new false return, so a refused quit is silently dropped:

  • Projects.java:1066 passes a TutorialApiCallContext that never receives API_SUCCESS or API_ERROR, so the tutorial call never completes.
  • Projects.java:779 (create project) carries on as though the quit happened.
  • DesktopApplicationHeader.java:562 (Quit and Download) has already opened the browser by the time the quit is refused.

At minimum, the tutorial path should fire API_ERROR on refusal.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in c49af2f. A refused performQuit shows "RStudio is already quitting or switching projects" and fires API_ERROR for a tutorial caller; the Quit and Download path now opens the browser only when performQuit returns true. The create-project path gets the same dialog, which is the only sensible outcome there (the project exists, the switch did not happen).

// an accepted update is applied now that the session has exited; on
// macOS Squirrel closes the window and relaunches the app itself
const updater = appState().gwtCallback?.updater;
if (updater?.hasPendingInstall()) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

applyPendingUpdate() runs on any quit(), while the armed install is only cancelled by setPendingQuit(NONE). A quit that turns into something else therefore leaves the install armed:

  • Terminate R: a quit hangs on busy R and the user chooses Terminate R. ApplicationInterrupt.java:242 sets PENDING_QUIT_RESTART_AND_RELOAD, not NONE. The session restarts and the page reloads with a fresh gate, but pendingInstall stays set, so a later ordinary quit runs the installer.
  • Renderer crash: closeEvent's renderer-crash fallback calls quit() while rsession is still alive, which launches the installer beside a live session.

onSuspendAndRestart guards one restart path; ApplicationInterrupt and session-launcher's collectPendingQuitRequest / launchNextSession don't. Tying the install to the PendingQuitAndExit exit it was recorded for, or cancelling it whenever the pending quit is collected as anything else, would cover all of them.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 02697a6. collectPendingQuitRequest() cancels the pending install unless the exit was collected as PendingQuitAndExit, which covers Terminate R, suspend/restart and crashes in one place, and MainWindow.quit() applies the update only once the session process has exited, so the renderer-crash close cancels it rather than launching the installer beside a live session. Covered by a gwt-callback unit test.

'update-version': update.download.version,
'update-url': update.download.url,
'update-message': `RStudio ${update.download.version} is now available (you're using ${this.currentVersion})`,
'update-urgent': '0',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On macOS and Windows this answer replaces the session's rstudio.org check_for_update result. That drops two things:

  • Urgency. It is hard-coded to '0', so an urgent update now gets "Ignore Update" (DesktopApplicationHeader hides it only when urgency != 0), and once ignored it stops prompting in automatic checks.
  • Posit's server-side switch. An up-to-date answer skips the session check entirely, so a release pulled from check_for_update but still listed as published on the builds site keeps being offered with one-click install.

Could the desktop result be merged with the session's answer, or at least respect its urgency and its "no update" answer?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 02697a6 for release builds: the desktop's answer carries confirm-with-session, GWT then runs the session check too, and UpdateCheckResult.reconcile lets it have the final say: an empty session answer means no update, a session-only update is offered as before (Quit and Download), and otherwise the installable update takes the session's urgency. Daily and preview builds stay builds-site-only: I checked and rstudio.org's check_for_update answers an empty result for daily versions, so gating them on it would suppress every daily update. Covered by a GWT unit test.

this.pendingInstall = null;
const staged = this.staged;
const mode = this.windowsInstallMode;
if (blocker || (this.host.platform === 'win32' && (!staged || !mode))) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The !mode case is first caught here, after the session has shut down. preflight() doesn't check windowsInstallMode, so canInstallUpdate and installUpdate both return '' when it is null.

Scenario: a later check overwrites the mode with null (canInstall() reassigns it on every check that finds an update, and a transient reg.exe failure returns null). Restart Now then passes, the session quits, and RStudio exits without updating, with the message "The downloaded update is no longer available". Checking the mode in preflight(), or keeping the last good mode, would surface this before the quit.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 02697a6: canInstall() keeps the mode from the last check that could read it, so a transient reg.exe failure after a download no longer clears it. Unit test added.

Comment thread src/node/desktop/src/main/updater.ts Outdated
autoUpdater.on('update-downloaded', onDownloaded);
autoUpdater.on('update-not-available', onNotAvailable);
autoUpdater.on('error', onError);
autoUpdater.setFeedURL({ url: feedUrl, serverType: 'default' });

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If setFeedURL() or checkForUpdates() throws synchronously here (for example "Could not get code signature" on an unsigned build), the error goes to .catch(reject) without settle():

  • The three autoUpdater listeners stay attached.
  • The loopback server keeps listening.
  • On the next attempt, a stale handler's settle() closes the new attempt's server.

Wrapping this block in try { … } catch (e) { settle(() => reject(e)); } would cover it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 02697a6: the two calls are wrapped and a throw goes through settle(() => reject(...)), so the listeners and the loopback server are released.

*/
export function installerEnvironment(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv {
const clean = { ...env };
delete clean[kRStudioInitialProject];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only these two variables are stripped. The installer, and the RStudio it relaunches, inherit everything else the running desktop has mutated in process.env:

  • R_HOME and the other R variables, via setVars in detect-r.ts
  • a PATH with R's bin directory prepended (detect-r.ts:327)
  • RSTUDIO_WHICH_R from the R chooser
  • test overrides such as RSTUDIO_UPDATE_VERSION, which makes the new build offer the update again

Snapshotting the environment at startup and spawning the installer with that copy would cover all of these.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 02697a6. process.env is snapshotted when the module loads (before any R is detected) and the installer is spawned with that copy, still minus the two project variables and now also minus RSTUDIO_UPDATE_VERSION, so the relaunched build does not keep offering the same update.

Comment thread src/node/desktop/src/main/updater.ts Outdated
}

private async stagedInstallerVerifies(): Promise<boolean> {
return this.staged !== null && (await this.host.verifyInstaller(this.staged.file, this.staged.entry));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This re-reads and hashes the whole ~300 MB installer on every call. One Restart Now runs it at least three times (canInstallUpdate, installUpdate, applyPendingUpdate), and the last pass runs while handingOff holds the window open after the session has exited.

Caching the verified result keyed on size + mtime (or keeping the file open after verifying it) would avoid the repeated passes.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 02697a6: the staged installer's size and mtime are recorded when it last hashed correctly, and an unchanged file is trusted without re-reading it (the stamp is taken before hashing, so a change after the stat forces a re-hash next time). Unit test covers the three-call sequence.

// twice): nothing is recorded for it, and the update
// stays downloaded for the next check
ApplicationQuit.QuitClaim claim = appQuit_.claimQuit();
if (claim == null)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the claim fails, the user has just answered the save prompts and then nothing visible happens. The only trace is a console log, so they can't tell the update wasn't applied. RenvRVersionManager shows quitAlreadyInProgress in the same situation; the same message (or a reworded one) would work here.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in c49af2f: a failed claim shows the same "already quitting or switching projects" message the renv path uses.

The quit gate reopened only when the session failed or aborted the quit, so a
quit that stalled before the session answered (a setPendingQuit IPC that
rejected and never called back, a last-chance save that never completed, a
busy session) left every later quit, including closing the window, ignored.
A quit older than 30s now admits the next one, which re-runs the sequence as
closing the window again always did; the bridge calls back on an IPC error
instead of dropping the quit.

A refused quit also tells the user (the save prompts have usually just been
answered) and fails a tutorial API caller instead of leaving it waiting.
- an accepted install is applied only by the quit-and-exit it was recorded
  for: a session exit collected as a restart or a crash, or a quit with the
  session still alive, forgets it rather than leaving it armed for a later
  quit
- preview builds, and dailies left on a released branch, read the release
  API once their branch is released, and a branch index whose newest build
  is on another channel (release candidates) offers nothing, so unpublished
  patch candidates are never offered
- release builds are marked confirm-with-session: GWT runs the session's
  check_for_update too and takes its urgency and its "no update" answer
- the staged Windows installer must carry a valid Authenticode signature
  from Posit's certificate (Get-AuthenticodeSignature), checked once per
  download; an all-users install is only updated in-app for an
  administrator, who can consent to the UAC prompt
- the installer download gives up after a minute without data
- a persistent Squirrel 'error' listener covers quitAndInstall() failures
  after the download's listener is gone, and a synchronous throw from
  setFeedURL/checkForUpdates settles the download
- the Windows install mode is kept from the last check that could read it
- the installer runs with the environment RStudio was launched with, minus
  RSTUDIO_UPDATE_VERSION, rather than the one detect-r rewrote
- the staged installer is hashed once while its size and mtime are unchanged
The /update installer relaunched RStudio only on success; a declined UAC
prompt, a failed elevated install, an install error or RStudio still running
after the wait left the user with neither RStudio nor the update, silently.
An all-users update now elevates from .onInit itself (NsisMultiUser would
quit the outer instance as soon as the elevated one is done, whatever the
outcome) and relaunches the registered RStudio with a message when the
elevated instance fails or is refused; .onInstFailed does the same for an
install that fails in the instance talking to the user; and the wait timeout
tells the user instead of aborting silently.
@kevinushey

Copy link
Copy Markdown
Collaborator Author

Thanks for the thorough review. All fourteen points are addressed in c49af2f, 02697a6 and 5c7a902 (see the inline replies). Two notes: the session-check gate applies to release builds only, since rstudio.org's check_for_update answers nothing for daily versions; and the NSIS commit pre-empts NsisMultiUser's elevation in .onInit because .onGUIEnd is not called in silent mode, so there is no later hook in the outer instance. I have not been able to exercise the NSIS path here. The PR description is updated to drop the rsession.conf option.

…elaunch

- reconcile(): the desktop's installable update is used only when the
  session names the same version; a differing session answer wins
- an install request still in its checks learns of a cancellation (the
  session replaced meanwhile) and records nothing
- a superseded renv R-version claim clears the pending R instead of leaving
  it for the next quit
- setPendingQuit reports an IPC failure to the quit sequence, which then
  does not quit (the exit would be taken for a crash) rather than quitting
  without the frame's record; Command callers run only on success as before
- the relaunch marker also names the build the update was attempted from,
  so the installer's relaunch after a failed update reopens the project
- the NSIS relaunch only reopens an RStudio that is still intact and says
  to run the installer otherwise
- a retried quit dismisses the stalled attempt's progress indicator
…elaunch flag

- the desktop frame publishes a prepared R only when the quit that names it
  is recorded (setPendingQuit now takes the executable), so a superseded or
  late R-switch claim leaves nothing for another quit; the clear IPC goes
- a quit the frame could not record also leaves nothing armed: quitNotStarted
  sends PENDING_QUIT_NONE in every not-started path
- the previous build takes the relaunch marker only when launched with
  --after-failed-update, which the installer passes; an ordinary launch
  while the installer waits leaves it for the updated build
- the installer tracks whether the sections began changing the installation
  (the elevated instance reports it through its exit code) and offers a
  repair message instead of relaunching after that point, or when the
  relaunch itself fails
… abort test

- setPendingQuit() normalizes the R the client names the same way
  setPendingRVersion() did (bin\R.exe -> bin\x64\Rterm.exe on Windows), so
  the prepared R is found and published
- the aborted-switch e2e test no longer relies on R reissuing its prompt
  after the refused quit: it waits for the bridge to report the session
  usable and runs a command to completion instead
@kevinushey
kevinushey requested a review from gtritchie November 5, 2026 17:44

@gtritchie gtritchie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick and thorough turnaround. I checked all fourteen fixes in the code. Where a fix depends on outside data I checked it against live services: the session-check reconcile (rstudio.org returns update-version in the same 2026.10.1+239 form as the builds site) and the released-branch path for preview builds (blue-mistflower resolves to 2026.10.1+239). They all look right. I followed the NSIS failure paths in the template but, like you, couldn't run them on Windows.

Requesting changes again for four new issues in the follow-up code (inline):

  • PowerShell injection in the Authenticode check (security). The API-supplied filename reaches the PowerShell script with only ASCII ' escaped, so a compromised API can run code inside the very check meant to stop it.
  • A stalled quit's late failure can undo the newer quit it let in.
  • Blocked PowerShell makes every Windows download fail. Each attempt downloads ~300 MB and then fails the signature check.
  • The signature is checked once, then the file is trusted on size and mtime alone at the handoff.

The failing desktop e2e test (git_diff_gutter.test.ts:3912, "keeps the action bar of a folded change when wrapping pads at the fold") is unrelated to this PR. It is tracked in #19436 and fails the same way on other PRs.

export function signatureScript(file: string): string {
// a single-quoted PowerShell string takes everything literally except the
// quote itself, which is doubled
const literal = `'${file.replace(/'/g, "''")}'`;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This escapes only the ASCII '. PowerShell also ends a single-quoted string at U+2018, U+2019, U+201A and U+201B. The path comes from entry.filename, which the builds API supplies and nothing validates (update-feed.ts:349, then path.basename in installer-staging.ts:98).

That opens the signature check to the attack it exists to stop. A compromised API publishes a filename such as RStudio’; Start-Process calc; ’.exe, the download lands under that name, and this script runs the injected command as the user before any signature is checked.

It also breaks honest updates: a profile path containing ’ (for example C:\Users\D’Arcy\AppData\Local\Temp\...) makes every check fail.

Suggested fix: keep the path out of the script text. Run a fixed script that reads -LiteralPath $env:RSTUDIO_AUTHENTICODE_FILE, and set that variable when spawning. Separately, reject API filenames that don't match a strict pattern (e.g. /^RStudio-[A-Za-z0-9.+-]+\.exe$/) before downloading.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed: PowerShell also ends a single-quoted string at U+2018..U+201B. Fixed in be640a7. The script is now fixed text that reads -LiteralPath $env:RSTUDIO_AUTHENTICODE_FILE, and the runner sets that variable when it spawns PowerShell (CommandRunner takes an optional env). The test passes a path containing ', ‘ and ’ plus an injected Start-Process, and checks that none of it reaches the arguments.

1b9503f also refuses, before fetching anything, any filename other than the builds site's own installer name for the version being offered (installerVersion(filename) === entry.version, .exe). That's the same parse pruneStagedInstallers() uses, so a staged file is always one the pruner can clean up. All Windows names in the live API pass it.

* and leave nothing armed in the desktop frame (an update install
* recorded for this quit, the R it named) for a later, unrelated quit.
*/
private void quitNotStarted(String message, GlobalProgressDelayer progress)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once QuitGate admits a second quit after 30s, the first (stalled) QuitCommand still holds live callbacks. If it fails later, its quitNotStarted() reopens the gate, clears isQuitting_ and sends setPendingQuit(NONE), all while the second quit is in flight.

Scenario:

  1. Quit 1 is queued behind busy R.
  2. After 30s the user closes the window; quit 2 records PENDING_QUIT_AND_EXIT and sends its own quit_session.
  3. When the session exits, the stale attempt's RPC errors and sends PENDING_QUIT_NONE.
  4. If that IPC reaches the main process before collectPendingQuitRequest(), the exit is taken for a crash and an accepted update install is cancelled.

Even when it arrives too late to do that, it still reopens the gate mid-quit. A generation counter on QuitCommand, letting only the current attempt reopen the gate or clear the frame, would close this. I haven't reproduced it; it follows from the callback lifetimes.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, and it's a little wider: quit_session answers before it quits (SessionHttpMethods.cpp:1370), so whichever request the session reads first wins and the other fails when the process exits. If quit 1 stalled in its saves or in the desktop callback, quit 2's request goes first and quit 1 fails late, which is your case. If quit 1 stalled behind a busy session, its request is queued ahead, and the current attempt's RPC is the one that fails. A generation counter alone would still send PENDING_QUIT_NONE there.

Fixed in e5f2ba0. QuitGate.start() and Claim.start() now return an Attempt. Only the latest attempt's fail() reopens the gate, clears isQuitting_ and sends PENDING_QUIT_NONE, and none does once the session has accepted any attempt (acknowledged() on a true answer). An accepted quit ends with the page or with quit_aborted; an acceptance that arrives after the abort is ignored. A replaced attempt also stops before arming the frame or sending its own quit_session, and a claim replaces a stalled attempt too. The cases are in QuitGateTests. Not reproduced end to end.

// installer runs silently (no UAC prompt for a per-user install), so
// it must also be what Posit signed. Checked once per download: later
// checks compare the file against this very checksum.
const signature = await installerSignature(file, execFileRunner(kSignatureCheckTimeoutMs));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The signature check only happens after the full download, and a null answer (PowerShell missing, blocked by AppLocker, or in Constrained Language Mode) deletes a genuine installer and fails the download.

On such a machine can-install is still true, so every Install and Restart downloads ~300 MB and then fails with "not signed by Posit Software, PBC (unknown)", the same way each time. Probing the check once in canInstall() (for example against process.execPath, which is signed by the same certificate), and treating failure as "cannot install", would send these users to the manual download instead.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Fixed in 9c5d75b: canInstall() probes once per process, and a failure answers can-install: false, so these users get the manual download.

One change from your suggestion: the probe accepts any answer about process.execPath, not a valid Posit signature. Hourly builds sign only the installer (Jenkinsfile.windows signs executables only for DAILY builds), so an hourly rstudio.exe reports NotSigned, and requiring Posit's signature would turn in-app updates off for hourly. The probe only needs to show that the check runs; the installer still has to be signed by Posit.

Comment thread src/node/desktop/src/main/updater.ts Outdated
staged.stamp = null;
return false;
}
if (staged.stamp && staged.stamp.size === stamp.size && staged.stamp.mtimeMs === stamp.mtimeMs) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the stamp cache (which I suggested), the Authenticode check runs once at download time. Every later check, including the one at the handoff to the installer, then trusts the file on size + mtime alone.

A process running as the user can swap in a same-size executable and restore the mtime, and it is launched without re-verification. For a per-user install that adds little to what such a process can already do. For an all-users install, though, it then runs elevated on the admin's UAC consent.

Keeping the cache for the two earlier checks, but forcing a full hash (or the signature check) once in applyPendingUpdate() just before launchInstaller, would close this at the cost of one read.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Fixed in 9c5d75b: applyPendingUpdate() hashes the staged installer in full just before launchInstaller, whatever its stamp says. The two earlier checks keep using the stamp. On a mismatch it doesn't launch, shows the "no longer available" warning, and clears the stamp so the next check hashes again. Tests cover a clean handoff and a swapped file with the same stamp.

PowerShell ends a single-quoted string at U+2018..U+201B as well as the
ASCII quote, so quoting the API-named path into the script was injectable.

Addresses #17173.
…andoff

Where PowerShell cannot answer, every download fetched the whole installer
and then failed its signature check; such users now get the manual
download. The probe accepts any answer, since hourly builds sign only the
installer. The handoff no longer trusts the size+mtime stamp.

Addresses #17173.
…cepted

A replaced attempt's late failure reopened the gate and sent
PENDING_QUIT_NONE under the quit that replaced it. The session answers
whichever quit_session it reads first and exits, so either request can be
the one that fails; once any attempt is accepted, only quit_aborted
reopens the gate.

Addresses #17173.
@kevinushey

Copy link
Copy Markdown
Collaborator Author

Thanks for another careful pass. All four are addressed in be640a7..e5f2ba0 (see the inline replies). The one departure from your suggestions: the PowerShell probe accepts any answer rather than a Posit signature on rstudio.exe, because hourly builds don't sign it.

A replacement attempt that failed first undid the quit even though the
session could still accept the older request, and releasing a claim
reopened the gate past an accepted quit. Both now go through
Attempt.fail(), which waits for every sent request to settle.

Addresses #17173.
An install whose checks outlasted the quit claim could be replaced by a
second restart into the same version; its late answer then cancelled the
newer request's record by version. Requests now carry an id, cancels match
it, and an older request finishing after a newer one started answers
'superseded' without recording.

Addresses #17173.
Releasing an R-switch claim that replaced nothing sent PENDING_QUIT_NONE,
clearing the pending exit a console q() records without the gate.

Addresses #17173.
A restart whose saves stalled could be replaced by an R-switch claim
before its quit reached the frame; releasing that claim then left the
install recorded for a later ordinary quit.

Addresses #17173.
@kevinushey

Copy link
Copy Markdown
Collaborator Author

A follow-up review pass turned up a few more races around overlapping quits and update installs; pushed as e5f2ba0..712d620:

  • a256f4d -- QuitGate counts quit_session requests still unanswered, and a failed attempt's undo waits for them, since the session may still accept an older request after the newer one fails.
  • 8705d2e -- each installUpdate call carries a request id. A late, older request answers superseded instead of replacing the newer record, and cancelUpdateInstall(requestId) cancels only its own record.
  • 38671ec -- the undo sends PENDING_QUIT_NONE only when a gated attempt armed the desktop frame, so it can no longer clear a pending exit armed by a console q().
  • 7e67d98 -- a request cancelling its own record no longer invalidates a newer install that is still in its preflight checks.
  • 712d620 -- a recorded update install counts as arming its quit, so a quit given up (e.g. replaced after stalling past 30s, then released) cancels the update rather than leaving it for the next ordinary quit.

New QuitGateTests and updater tests cover each case. One known gap: quit_aborted still reopens the gate fully even when another quit_session is queued behind the aborted one; that seemed too rare to justify more machinery in the gate.

@kevinushey
kevinushey requested a review from gtritchie November 6, 2026 03:27

@gtritchie gtritchie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. All four points from the last round are addressed, along with the extra races your own pass found. I checked each fix in the code, and the stricter installer-name check against the builds site's live release, daily and hourly Windows filenames (all three pass). CI is green on 712d620.

One small, non-blocking note is inline: the startup probe of the signature check. Fine as a follow-up.

async canCheckSignatures(): Promise<boolean> {
// any answer will do, as it only shows the check runs: hourly builds
// sign only their installer, so rstudio.exe may well be NotSigned
return (await installerSignature(process.execPath, execFileRunner())) !== null;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: this probe runs under execFileRunner()'s default 30s timeout (kProcessListTimeoutMs), not kSignatureCheckTimeoutMs. canInstall() also keeps the promise for the life of the process, so a single failure is remembered for the rest of the session.

The first check usually happens at startup, when PowerShell's cold start and Defender scanning of rstudio.exe are slowest. If that probe times out, Install and Restart stays off until RStudio restarts.

Passing execFileRunner(kSignatureCheckTimeoutMs) here, and caching only a successful probe, would avoid that.

@kevinushey
kevinushey merged commit d6ecd7b into main Nov 6, 2026
47 checks passed
@kevinushey
kevinushey deleted the feature/17173-desktop-auto-update branch November 6, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants