Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install programs which require Admin #2740

Closed
filiphorvat opened this issue Dec 4, 2022 · 10 comments · Fixed by #2945
Closed

Unable to install programs which require Admin #2740

filiphorvat opened this issue Dec 4, 2022 · 10 comments · Fixed by #2945
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.
Milestone

Comments

@filiphorvat
Copy link

Brief description of your issue

Winget is unable to install programs which require Admin.
Winget disables inheritance on the C:\Users\username\AppData\Local\Temp\WinGet folder so the administrator accounts can't access it.
Even after manually enabling inheritance, the next winget install disables it again and fails.

Steps to reproduce

winget install any program that requires an Admin password

Expected behavior

The program installs.

Actual behavior

The program fails installing with the error The network name cannot be found, or similar.

Environment

Windows Package Manager (Preview) v1.4.3132-preview
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.19045.2311
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.19.3132.0
@ghost ghost added the Needs-Triage Issue need to be triaged label Dec 4, 2022
@denelon
Copy link
Contributor

denelon commented Dec 5, 2022

@filiphorvat Can you run an instance of this with winget install <package> --verbose-logs and share the log file? The location is displayed via winget --info.

@denelon denelon added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Author-Feedback Issue needs attention from issue or PR author and removed Needs-Triage Issue need to be triaged labels Dec 5, 2022
@filiphorvat
Copy link
Author

Here it is for winget install wiztree --verbose-logs:
WinGet-2022-12-05-18-22-32.594.log
Looks like this after typing in the admin password:
image

Or like this when installing Steam:
image
Here's the log for Steam:
WinGet-2022-12-05-18-34-06.014.log
Even manually running the installer from the temp directory doesn't work if I don't re-enable inheritance.

@ghost ghost added Needs-Attention Issue needs attention from Microsoft and removed Needs-Author-Feedback Issue needs attention from issue or PR author labels Dec 5, 2022
@jueti
Copy link

jueti commented Dec 20, 2022

same as me, my settings via winget settings

winver: Windows Server 2022 Standard 21H2 20348.1311

{
    "$schema": "https://aka.ms/winget-settings.schema.json",

    // For documentation on these settings, see: https://aka.ms/winget-settings
    // "source": {
    //    "autoUpdateIntervalInMinutes": 5
    // },
    "telemetry": {
        "disable": true
    },
    "network": {
        "downloader": "wininet"
    },
    "source": {
        "autoUpdateIntervalInMinutes": 360
    },
    //"logging": {
    //    "level": "verbose"
    //},
    "installBehavior": {
        "preferences": {
            "scope": "machine"
        }
    }
}

@AlexDe74
Copy link

same as here #2665

MS ignores it.

To install any programs with EXE Installers I do:

  1. Try first time winget update --id....
  2. Go into %TEMP%\Winget\
  3. Give to Administrator the permissions to access the applications's folder in %TEMP%\Winget
  4. Try second time winget upgrade --id...

Really good user experience....

@ghborger
Copy link

ghborger commented Feb 1, 2023

The same behavior for me on Windows 11. Normal user without administrator rights tries to install a program with winget. Winget loads the installation files
to C:\Users\USERNAME\AppData\Local\Temp\WinGet, sets own permissions. Full access for the current account and system and removes inheritance. The local administrator has no rights to the directory. Then WinGet requests the administrator rights. After that winget aborts with an error that it cannot access the installation files. Which was predictable if the local administrator lacks the rights. Apparently the Winget developers always work with administrator rights, otherwise they would have noticed the error immediately.

@rand0muser123
Copy link

Can confirm we are able to replicate it on our tenant with onenote as it uses an exe
As a workaround we are downloading it from the ms website
It happens both on the store or through winget

@boozeman
Copy link

boozeman commented Feb 2, 2023

Hi,

How about the feature where you can set the download directory for winget packages in settings file? Some directory where all the users has rw-rights.

@nk111
Copy link

nk111 commented Apr 18, 2023

I can confirm that this is fixed in 1.5 preview of winget. I really wonder why this bug even made it to a release. Does nobody really work without admin rights?

@denelon denelon linked a pull request Apr 18, 2023 that will close this issue
@denelon denelon removed the Needs-Attention Issue needs attention from Microsoft label Apr 18, 2023
@denelon denelon closed this as completed Apr 18, 2023
@Masamune3210
Copy link

I can confirm that this is fixed in 1.5 preview of winget. I really wonder why this bug even made it to a release. Does nobody really work without admin rights?

Principle of least privilege says you shouldn't

@UnidentifiedTag
Copy link

UnidentifiedTag commented Jun 28, 2023

same error Windows 11 22H2

the administrator account is being removed from the winget folder found in the temp folder every time the store reloads, why is this happening, Microsoft should be keeping the administrator privileges on this folder?

error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants