Repository navigation
Windows installer: add per-user install option (no elevation) - #18167
Merged
Merged
Conversation
Remove the static InstallDir. NsisMultiUser treats a non-empty $INSTDIR at MULTIUSER_INIT time as a /D command-line argument and pins both install modes to it, so the static InstallDir forced per-user installs into C:\Program Files\RStudio (requiring elevation) instead of %LOCALAPPDATA%\Programs\RStudio. The framework now sets $INSTDIR per mode: $PROGRAMFILES64\RStudio for all-users, %LOCALAPPDATA%\Programs\RStudio for per-user.
Downloads Drizin/NsisMultiUser at the pinned commit, verifies the expected Include/ + Plugins/ layout, repackages it into NsisMultiUser.zip (rooted so it extracts straight into dependencies/windows/nsis-multiuser/<version>/), and uploads to the rstudio-buildtools S3 bucket that install-dependencies.cmd fetches from. Follows the existing upload-*.sh pattern; archives via Python for a deterministic, portable build (git-bash lacks zip).
The Windows installer now bundles the NsisMultiUser framework and its UAC and StdUtils plugins. Add a NOTICE entry (mirroring the existing NSIS multi-license entry) covering all three: NsisMultiUser (MIT), the UAC plug-in (zlib/libpng), and the StdUtils plug-in (LGPL-2.1), with full license texts.
The Windows installer bundles the nsProcess plugin (running-instance detection); add its NOTICE entry: Copyright (C) 2006 Shengalts Aleksander aka Instructor, zlib/libpng license.
Member
Author
|
Moving to draft until we've branched for release for 2026.07 (this PR is for 2026.08). |
gtritchie
marked this pull request as draft
July 7, 2026 18:00
RStudio E2E - all platformsAll tests passed!
View / download the full reportView report online -- opens in the browser, no download needed. Available for 14 days. Download playwright-report.zip -- extract and open
All platforms - commit |
Pass the install mode (/allusers or /currentuser) to the previous version's uninstaller during 'remove previous installation'. NsisMultiUser rejects a silent uninstall with no mode, so upgrades otherwise failed to remove the old version. In un.onInit, only de-elevate a current-user uninstall. An all-users uninstall now stays elevated instead of being relaunched as the shell user, so an unattended elevated machine uninstall is not broken.
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
The NsisMultiUser-based installer requires /allusers or /currentuser for a silent (/S) install; without a mode it exits with an invalid-parameters error and installs nothing. The Windows e2e workflows install machine-wide to C:\Program Files\RStudio, so pass /allusers alongside /S.
gtritchie
marked this pull request as ready for review
July 8, 2026 21:29
ExecShellAsUser's result was ignored and the elevated uninstaller quit unconditionally, so a failed relaunch (no shell to impersonate, blocked child launch) exited without uninstalling anything and with no message. Quit only when a child was actually launched (ok/fallback); otherwise fall through to MULTIUSER_UNINIT and continue elevated. Also correct the de-elevation comments: the relaunch exists because an elevated instance resolves $LOCALAPPDATA/HKCU for the wrong user, not to avoid a UAC prompt (that prompt has already happened).
NsisMultiUser rejects silent installs that specify neither /allusers nor /currentuser, so existing 'RStudio-*.exe /S' deployment scripts would exit nonzero having installed nothing. Call out the new required flag in the release notes.
The shared install helper creates the version folder before downloading, so a failed download left an empty folder that later runs skipped as 'already installed'. Remove such remnants before installing (mirroring the existing quarto guard) and exit with an error if the framework header is still missing afterwards.
A missing include directory is not a makensis error; it only surfaced deep inside cpack as '!include: could not find: "UAC.nsh"'. Fail at configure time with a message that names the fix.
This was referenced Jul 9, 2026
This was referenced Nov 2, 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.
Summary
Adds an install-mode choice to the RStudio Windows (NSIS) installer: All users (the default, installed to
C:\Program Files\RStudiowith an elevation prompt) or Just me (the current user, installed to%LOCALAPPDATA%\Programs\RStudiowith no elevation). A current-user install requires no administrator rights, and uninstalling one no longer prompts for elevation or leaves behind its Start Menu shortcut and registry entries.This is built on the NsisMultiUser framework (with the UAC and StdUtils NSIS plugins), which presents the mode page, elevates on demand only for all-users installs, and records the chosen mode so the uninstaller reproduces it.
Closes #14122.
Closes #1634.
Changes
dependencies/tools/upload-nsis-multiuser.shto publish the pinned bundle.HKCUinstead ofHKLM. All-users behavior is unchanged.InstallDir: NsisMultiUser treats a non-empty$INSTDIRat init as a/Dargument, which otherwise pinned both modes to Program Files..Rtexfile-association bug encountered in the same file (a duplicate write, and an uninstall that removed the wrong ProgID value).NEWS.md, andNOTICEfor the bundled plugins (NsisMultiUser MIT, UAC zlib/libpng, StdUtils LGPL-2.1, nsProcess zlib/libpng).Screenshots
Testing
Built the installer on Windows and exercised both modes end to end:
%LOCALAPPDATA%\Programs\RStudiowith no elevation prompt, RStudio launches, uninstalls cleanly.C:\Program Files\RStudiowith one elevation prompt, RStudio launches, uninstalls cleanly.A
makensiscompile-smoke of the installer and uninstaller integration passes. There is no automated installer test suite, so the above was manual. Silent-mode switches (/S /currentuser,/S /allusers), cross-mode coexistence, and upgrade-over-previous were not exercised.