Installer - Windows - UAC elevation #5798

issue PRabahy openend this issue on February 17, 2015
  1. PRabahy commented at 3:57 am on February 17, 2015: contributor

    For me the 0.10.0 installer didn’t request UAC elevation leading to an unexpected behavior. First, I double clicked the installer from a standard user account. It begins the install process, but failed with “Error opening file for writing: C:\Program Files\Bitcoin\bitcoin-qt.exe[…]”. I aborted that install attempt.

    Next, I right clicked on the installer, selected Run as Administrator. That install worked fine, but on the last page, it automatically launches bitcoin-qt for you. I was surprised (I guess I should have expected this) because the instance of bitcoin-qt created its profile under the administrator account (including a new wallet.dat).

    tl;dr - The windows Bitcoin installer should be UAC aware.

  2. theuni commented at 4:25 am on February 17, 2015: member

    I don’t see these issues with the 0.10 binaries on my win7 VM. The install process works as expected, and auto-launched bitcoin-qt runs as the user who ran the installer.

    What win version are you running? Does 0.9.x have the same issues?

  3. PRabahy commented at 12:59 pm on February 17, 2015: contributor

    When you ran it in your win7 VM, did you have UAC enabled and were you using a non-admin account to launch the installer?

    I am running Windows 7 64bit. Yes, 0.9.x has the same issue, but I just started running as a standard user recently.

  4. theuni commented at 6:12 pm on February 17, 2015: member

    Ok, this turns out to be a pain in the ass.

    I created an installer that requests ‘admin’ elevation: https://bitcoincore.org/cfields/bitcoin-0.10.0/bitcoin-0.10.0-win64-uactest-setup.exe

    It appears to work as intended, except that it actually installs for the elevated account rather than the current one. The results are not at all obvious.. “run bitcoin-qt now” from the installer runs as the admin user. After that, running the .exe from program files (no shortcuts are installed for the current user) prompts for a data path. Probably exactly what you saw when running the official setup.exe as Administrator.

    It appears as though non-trivial changes to the installer would be needed.

    It’s been quite a while since I’ve used a Windows environment, do most applications fare well in this scenario?

  5. PRabahy commented at 11:27 pm on February 17, 2015: contributor

    A lot of other installers fall into the same UAC trap(s) as bitcoin.

    I’m not sure if having the installer always request elevation is the right thing for the reasons you mentioned. The easiest “fix” IMO would be to always request elevation and remove the “run bitcoin-qt now screen”.

    Ideally the installer should only request elevation if it actually needs it. For example, if I install to “C:\Program Files\Bitcoin” it will need to elevate, but if I install to “C:\Users\PRabahy\Bitcoin”, it doesn’t. If the installer has admin privileges, it can put shortcuts in the “All Users” folder, but if it doesn’t then just put them in the current user folder. It should also “run bitcoin-qt now” as the user that did the install (not the user that did the elevation).

    The ideal installer would do the following steps:

    1. User runs the installer
    2. User picks the install location
    3. Installer check if it needs to elevate 3a. If so, the installer requests elevation
    4. The install is preformed
    5. Install shortcuts to All Users if possible, if not install shortcuts to Current User.
    6. If elevated, de-elevate.
    7. Show the “run bitcoin-qt now” screen.
  6. PRabahy commented at 5:37 am on February 19, 2015: contributor
    I just ran the Armory installer and noticed that it follows a different option for elevated vs non-elevated. If I run it as a standard user, it defaults the install directory to C:\Users\PRabahy\AppData\Local\Armory, but if I run it as an elevated user, it default to C:\Program Files (x86)\Armory. At least this doesn’t give an error when I double click the installer.
  7. laanwj commented at 10:31 am on May 18, 2015: member

    Right: It should be possible to install Bitcoin Core locally for a user, so without admin elevation. There have been attempts to “fix” this before which made that impossible.

    Agree that this is the wrong behavior though.

  8. laanwj added the label Windows on Feb 16, 2016
  9. laanwj added the label Build system on Feb 16, 2016
  10. sipsorcery commented at 9:06 pm on June 19, 2020: member

    @MarcoFalke maybe another one for closing.

    I just tested the v0.20.0 install on Windows 10 and there are no UAC prompts (and thus no requirement for admin permissions) either during the install or when subsequently executing bitcoin-qt.

    I doubt this issue will warrant looking at the installers for previous versions.

  11. MarcoFalke commented at 9:58 pm on June 19, 2020: member
    Is this still an issue with a recent version of Bitcoin Core? If yes, what are the steps to reproduce?
  12. MarcoFalke closed this on Jun 19, 2020

  13. trianglesis commented at 6:11 pm on March 27, 2021: none
    Win 10 bitcoin-0.21.0-win64-setup.exe Still having this issue. I do not want to crack the security of my PC to only run this. There’re a lot of workarounds playing with policies and accounts. which I don’t want to corrupt.
  14. achow101 commented at 6:36 pm on March 27, 2021: member
    @trianglesis You are likely running into a different issue, see https://github.com/bitcoin-core/gui/issues/252
  15. trianglesis commented at 6:38 pm on March 27, 2021: none
    Looks like the latest win package from the current repo is working fine with a single warning before run.
  16. DrahtBot locked this on Aug 18, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-24 12:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me