Skip to content

show installer progress during in-app updates on windows - #19630

Merged
kevinushey merged 6 commits into
mainfrom
feature/update-install-progress
Nov 16, 2026
Merged

kevinushey merged 6 commits into
mainfrom
feature/update-install-progress

Conversation

@kevinushey

@kevinushey kevinushey commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Intent

On Windows, an in-app update ran the installer fully silent. After "Restart Now" (and the UAC prompt, for an all-users install) nothing was visible until the new RStudio appeared a minute or more later, which reads as the update having done nothing.

Also, in an interactive all-users install the Welcome page was shown a second time after the UAC prompt.

Addresses #17173. Fixes #19631.

Approach

  • Installer shows its progress page for /update. At the end of .onInit the installer leaves silent mode (SetSilent normal) when /update was given. Pre-callbacks skip the Welcome, Directory and Finish pages, and NsisMultiUser skips its install-mode page itself, because its init ran silently with the mode on the command line. The header reads "Updating RStudio / RStudio will reopen when the update has been installed." The window closes by itself when the install is done, and RStudio is relaunched as before.

  • Everything before that still runs silent. The wait for rstudio.exe, the elevation and NsisMultiUser's checks are unchanged, since they all happen before the switch.

  • Same updater arguments. updater.ts still passes /S /update, so the installer decides, and builds already installed get the progress window the first time they update to a build that has this installer. The updater no longer starts the installer with windowsHide, which only did not hide the progress page because of how Windows applies it to NSIS's dialog.

  • File errors are no longer silent. A file that cannot be replaced now raises NSIS's Abort/Retry/Ignore dialog. Under /S, NSIS chose Ignore without asking, and RStudio was relaunched on a mix of old and new files. Now Ignore also fails the update: the installer checks the error flag after extracting. After Abort or Ignore the page stays on "Installation Aborted" until it is closed, and then the existing failure message is shown.

  • Update-failure messages are topmost. For an all-users install they come from the unelevated outer instance after the elevated one has closed, and they opened behind whichever application was active.

  • Restart prompt text (en, fr) now says that RStudio will close while the update is installed and reopen when it is done.

  • Welcome page after elevation (Windows installer shows the Welcome page again after the UAC prompt #19631). The Welcome page's pre-callback also skips it when NsisMultiUser's $InstallShowPagesBeforeComponents is 0, which is how it marks the elevated instance it starts from the install-mode page.

Plain silent installs (/S without /update) behave as before, and so do interactive installs apart from the Welcome page, which is now skipped wherever NsisMultiUser hides the pages before its own: after the UAC prompt, and before its message for an invalid command line.

Automated Tests

None; this is installer UI. Checked by hand in a Windows 11 ARM64 VM with installers compiled from this template (NSIS 3.08, a small stand-in payload registered under a separate product name, started with the same spawn options as launchInstaller()):

Case Result
Per-user update Progress window shown in front, Cancel and close disabled, closes by itself, RStudio relaunched
All-users update UAC prompt, then the elevated instance shows the same window; RStudio relaunched unelevated
All-users update, UAC declined "could not be installed" message, previous version relaunched with --after-failed-update
All-users update, a file locked Abort/Retry/Ignore; after Abort and closing the window, the repair message is shown above other windows
Per-user update, a file locked, Ignore "Installation Aborted" with "Some files could not be replaced.", then the repair message; RStudio is not relaunched
/S /allusers without /update No window
Interactive all-users install Welcome, Choose Users, UAC, then straight to the location page; Installing and Finish as before. Back on the location page returns to Choose Users

A per-user update was also re-run with windowsHide off, as the updater now starts the installer: progress window shown, RStudio relaunched.

Also run once with this PR's CI installer (rstudio-app-windows-x64, NSIS 3.12) as /S /currentuser /update over an installed RStudio: the progress window was up for about 95 seconds while the files were replaced, then RStudio reopened on the new build.

Not run: an update started from inside RStudio (a PR build is unsigned, so the updater will not launch it), an all-users update with the real payload, and the "still running" message, whose only change is the topmost flag.

QA Notes

From an older hourly build on Windows, accept an update and choose Restart Now. A window titled "RStudio Setup" with the header "Updating RStudio" and a progress bar should be visible until RStudio reopens; for an all-users install it appears after the UAC prompt.

Documentation

None needed.

Checklist

  • If this PR adds a new feature, or fixes a bug in a previously released version, it includes an entry in NEWS.md (for Windows installer shows the Welcome page again after the UAC prompt #19631; in-app updates are unreleased and need none)
  • If this PR adds or changes UI, the updated UI meets accessibility standards
  • A reviewer is assigned to this PR (if unsure who to assign, check Area Owners list)
  • This PR passes all local unit tests (desktop: 784 pass; the one failure, findComponents, needs a built rsession in the worktree and is unrelated)

The updater runs the NSIS installer with /S, so nothing was visible between
RStudio closing and the new version starting, a minute or more later. Given
/update, the installer now leaves silent mode at the end of .onInit and shows
its progress page only; the other pages are skipped. The restart prompt says
that RStudio will close and reopen, and the update-failure messages are
topmost so that they are not hidden behind another application.

Addresses #17173
NsisMultiUser elevates an all-users install by starting a second instance,
which began again at the Welcome page. It sets
$InstallShowPagesBeforeComponents to 0 there for the script to skip the
pages before its own; the Welcome page's pre-callback now does.

Addresses #19631
@kevinushey
kevinushey requested a review from gtritchie November 14, 2026 02:07
@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

RStudio E2E - all platforms

All tests passed!

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

Passed Failed Skipped Flaky
5447 0 235 0
Platform ✅ Passed ❌ Failed ⚠️ Skipped 🔁 Flaky
✅ auth-teardown 4 0 15 0
✅ desktop-linux 1424 0 46 0
✅ desktop-macos 1190 0 33 0
✅ desktop-windows 1419 0 57 0
✅ server-linux 1364 0 54 0
✅ setup 46 0 30 0

View report online


All platforms - commit 38575f801431b972ec9d2005123a6b528442ddf2 - Run #2296

@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.

One functional issue (Ignore on the new file-error dialog), plus a few smaller notes inline. Reviewed by reading the template against NsisMultiUser at the pinned commit; I haven't built or run an installer.

; and would have quit on an error rather than left it for that page.
;
${If} $UpdateMode = 1
SetSilent normal

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 /update no longer silent, a file that can't be written raises NSIS's Abort/Retry/Ignore dialog. AllowSkipFiles is on by default and the template never sets it, so Ignore is offered: it skips that file and the install carries on. The remaining sections run, UAC_AsUser_ExecShell (line 517) relaunches RStudio on a mix of old and new files, and .onInstFailed never runs.

Under /S the dialog's silent default was Abort, which led to the repair message. The manual test in the description covered Abort only.

Suggested fix: AllowSkipFiles off (Retry/Cancel only), or skip the relaunch in the Core section when the error flag is set.

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 that Ignore must not end in a relaunch. Fixed in 9d9e583: given /update, the Core section clears the error flag before the payload and aborts if it is set afterwards, so Ignore ends like Abort ("Installation Aborted", then the repair message). Checked in the VM with a locked payload file: Ignore gives "Some files could not be replaced." and then the repair message, with no relaunch; a normal update still relaunches.

One correction: that dialog's silent default is Ignore, not Abort (script.cpp: mb |= IDIGNORE << 21; // default for silent installers, in 3.08 and 3.12). So the old /S /update skipped a locked file without asking and relaunched on mixed files, and plain /S installs still do. I left AllowSkipFiles alone, since turning it off would also change plain /S (skip becomes fail) and interactive installs.

Comment thread src/node/desktop/src/main/updater.ts Outdated
logger().logErrorMessage(`${file} is gone; not installing`);
return false;
}
// /S asks for no questions, not for no window: given /update, the

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.

"/S asks for no questions" no longer holds: after SetSilent normal a file error asks Abort/Retry/Ignore. Same for "runs unattended" in the header comment (line 92) and in windows-authenticode.ts.

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 78ec197. The header comment, the signature-check comment here and the one in windows-authenticode.ts no longer say silently or unattended, and the launchInstaller comment is rewritten.

Comment thread src/node/desktop/src/main/updater.ts Outdated
return false;
}
// /S asks for no questions, not for no window: given /update, the
// installer still shows its progress page (see NSIS.template.in).

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 spawn below still passes windowsHide: true (STARTF_USESHOWWINDOW + SW_HIDE), which contradicts this comment. Your test shows the window appears anyway, but for a per-user update the spawned installer is the process that shows the window, so this relies on how Windows applies wShowWindow to NSIS's first ShowWindow call. windowsHide only matters for console windows otherwise, so dropping it seems the safer choice.

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.

Dropped in 78ec197. Re-ran a per-user update in the VM without it: progress window shown, RStudio relaunched. Hourly builds since #19399 still pass windowsHide: true when they update to this installer, and that's the case the earlier VM runs covered.

downloadingUpdateMessage=Downloading RStudio {0}...
updateDownloadedCaption=Update Ready to Install
updateDownloadedMessage=RStudio {0} has been downloaded. Restart RStudio now to finish installing it?
updateDownloadedMessage=RStudio {0} has been downloaded. Restart RStudio now to finish installing it? RStudio will close while the update is installed, which can take a few minutes, and reopen when it is done.

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 message is shared with macOS (DesktopApplicationHeader.java:824, no platform branch), where Squirrel swaps the bundle in seconds, so "which can take a few minutes" is Windows-only. The question also no longer ends the message, though the Restart Now / Later buttons answer it. Same for the _fr string.

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 b5e24d0: "RStudio {0} has been downloaded. RStudio will close while the update is installed and reopen when it is done. Restart RStudio now to finish installing it?" (French to match). That's true on macOS as well, since Squirrel quits and relaunches. On Windows the progress window now covers the wait.

${EndIf}
FunctionEnd

; The Welcome page is also skipped where NsisMultiUser asks for the pages

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.

Nit: $InstallShowPagesBeforeComponents = 0 doesn't only mark the elevated instance. MULTIUSER_SET_ERROR (NsisMultiUser.nsh:203) also sets it in the outer instance on a non-silent init error, e.g. /allusers /currentuser together. Skipping Welcome there is what NsisMultiUser intends for the variable, so the behavior is fine; only this comment (and "apart from that repeated Welcome page" in the description) is slightly off.

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.

Right, MULTIUSER_SET_ERROR sets it too, and skipping Welcome there goes straight to the install-mode page's error message. Comment updated in 9d9e583, and I've fixed the description.

Ignore on NSIS's file-error dialog skips a file that cannot be written and
carries on (it is also the silent default, so /S has always done this), and
the update then relaunched RStudio on a mix of old and new files. Given
/update, the installer now checks the error flag after extracting the
payload and aborts, so it ends as it does on Abort: the installation needs
repairing. Also corrects the comment on when NsisMultiUser hides the pages
before its own.

Addresses #17173
Given /update, the installer shows its progress page. windowsHide asks for
SW_HIDE on the first window shown, which only did not hide that page because
of how Windows applies it to NSIS's dialog; the installer is a GUI program,
so there is no console window for it to hide. Comments no longer say that
the installer runs silently or unattended.

Addresses #17173
The message is shared with macOS, where Squirrel replaces the bundle in
seconds, so it no longer says the update can take a few minutes, and it
ends with its question again.

Addresses #17173
@kevinushey
kevinushey requested a review from gtritchie November 15, 2026 23:57

@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, all addressed, and thanks for the correction on the silent default.

@kevinushey
kevinushey merged commit 7fe5aaa into main Nov 16, 2026
1 of 7 checks passed
@kevinushey
kevinushey deleted the feature/update-install-progress branch November 16, 2026 16:56
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.

Windows installer shows the Welcome page again after the UAC prompt

2 participants