Skip to content

UAC prompt when installing application #271

Closed
Closed

Description

It's ugly when you install a package using the command line and after that, a window prompt appears for a mouse click. Instead of this, something like sudo which ask for password before downloading the package will be beautiful and look consistent.

Yeah, you're right we can open the terminal as an administrator but when you working only on CLI it breaks the flow. It doesn't feel nice that you opened another terminal window just for installing a program.

Activity

  1. added
    Issue-Feature
    on May 21, 2020
  2. ghost added
    Needs-Triage
    on May 21, 2020
  3. HeinVG commented on May 21, 2020

    @HeinVG

    In Windows, the closest thing to 'sudo' is Runas: https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/cc771525(v=ws.11)

    But the only problem is that the command input is larger compared to just 'sudo winget install package', using runas you would have to do: 'runas /user:\administrator winget install package' (haven't tested that yet)

  4. byteduck commented on May 21, 2020

    @byteduck

    Could winget elevate itself and then install the packages?

  5. dmex commented on May 21, 2020

    @dmex

    Could winget elevate itself and then install the packages?

    You can run the winget command from an elevated command prompt and won't see any UAC prompts when installing packages.

  6. jessehouwing commented on May 21, 2020

    @jessehouwing

    start the command prompt elevated using:

    winkey, 'cmd', ctl-shift-enter'
    
  7. suhailmalik07 commented on May 21, 2020

    @suhailmalik07
    Author

    Yeah, you're right we can open the terminal as an administrator but when you working only on CLI it breaks the flow. It doesn't feel nice that you opened another terminal window just for installing a program.

  8. suhailmalik07 commented on May 21, 2020

    @suhailmalik07
    Author

    In Windows, the closest thing to 'sudo' is Runas: https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/cc771525(v=ws.11)

    But the only problem is that the command input is larger compared to just 'sudo winget install package', using runas you would have to do: 'runas /user:\administrator winget install package' (haven't tested that yet)

    This can do the work if implemented with windows 10 and winget. Never thought MSFT already had something similar to sudo.

  9. dhenze-dwz commented on May 23, 2020

    @dhenze-dwz

    start the command prompt elevated using:

    winkey, 'cmd', ctl-shift-enter'
    

    For some reason I am getting UAC prompts despite doing this. Any ideas?

    Edit: Nevermind, fixed it. Some weird issue with SmartScreen.

  10. JoBrad commented on May 24, 2020

    @JoBrad

    Opening a separate elevated prompt not only breaks the user workflow, but also introduces other follow-up steps, too. The user potentially needs to refresh the environment in the other terminal instance, or even destroy it and start over, depending on the updates made.

  11. madrian-es commented on May 28, 2020

    @madrian-es

    start the command prompt elevated using:

    winkey, 'cmd', ctl-shift-enter'
    

    For some reason I am getting UAC prompts despite doing this. Any ideas?

    Edit: Nevermind, fixed it. Some weird issue with SmartScreen.

    I'm having the same issue, how did you fix it?

  12. dhenze-dwz commented on May 28, 2020

    @dhenze-dwz

    start the command prompt elevated using:

    winkey, 'cmd', ctl-shift-enter'
    

    For some reason I am getting UAC prompts despite doing this. Any ideas?
    Edit: Nevermind, fixed it. Some weird issue with SmartScreen.

    I'm having the same issue, how did you fix it?

    iirc all I did was change the local group policy via gpedit.msc:
    Local Computer Policy -> Computer Configuration -> Administrative Templates -> Windows Components -> Windows Defender SmartScreen -> Explorer -> Configure Windows Defender SmartScreen

    Either enable and set to warn, or disable.

  13. added this to the milestone on May 28, 2020
  14. ofersadan85 commented on Oct 14, 2021

    @ofersadan85

    I solved it for myself through winget itself using gsudo:

    winget install gerardog.gsudo
    gsudo winget upgrade --all
    

    When it is run from a normal (non admin) user, it will only ask for privileges escalation once (similar to how a normal sudo would work)

  15. masterflitzer commented on May 13, 2022

    @masterflitzer

    gsudo winget upgrade --all

    gsudo is amazing, it even comes with an sudo alias so you can do sudo winget upgrade --all

  16. removed this from the milestone on Nov 14, 2024
  17. denelon commented on Dec 17, 2024

    @denelon
    Collaborator

    I've been going through the backlog checking on older issues. This one seems to be resolved with the release of sudo on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Feature

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions