Skip to content

Windows cannot access the folder where the download happens during 'upgrade' #2984

Closed

Description

Brief description of your issue

when i try a winget upgrade 'package' for a package that installs in program files, i get the attached error. I am running in standard user mode. I am sure that admin has access to the folder.
image

Steps to reproduce

type winget upgrade 'package name'
wait for the download
type in the admin password
get the error message

Expected behavior

I expected the program to install properly

Actual behavior

The application errors out and does not install if it requires admin

Environment

Windows Package Manager v1.4.10173
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22621.1265
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.19.10173.0

Logs: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir

User Settings: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json

Links
---------------------------------------------------------------------------
Privacy Statement   https://aka.ms/winget-privacy
License Agreement   https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage            https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale

Activity

  1. coeus89 commented on Feb 18, 2023

    @coeus89
    Author

    This happens for most applications that require admin. something about not being able to access the network or directory. but the directory has full privileges.

  2. coeus89 commented on Feb 18, 2023

    @coeus89
    Author

    image

  3. added
    Issue-Bug
    and removed
    Needs-Triage
    on Feb 20, 2023
  4. PapysGit commented on Feb 26, 2023

    @PapysGit

    Brief description of your issue

    when i try a winget upgrade 'package' for a package that installs in program files, i get the attached error. I am running in standard user mode. I am sure that admin has access to the folder.

    Facing the exact same issue.

  5. jdelker commented on Mar 11, 2023

    @jdelker

    The problem is with the temp directory winget uses for install.
    This is located at %LOCALAPPDATA%\temp\WinGet and simply has insufficient permissions for an elevated permission install.
    So effectively the given admin account is unable to read files from this directory.
    Unfortunately, it doesn't help to adjust the permissions for this directory manually, because winget resets it during upgrade.

    This problem already persists for months now and I've no clue why this hasn't been fixed yet. Actually it should affect many users, if not all uses.

  6. jmeile commented on Mar 17, 2023

    @jmeile

    I saw this too. When trying to install "7zip.7zip":
    Winget install 7zip.7zip

    I got the problem mentioned by the original poster. It seems to be related to the repository and happening with user elevation. If I use this instead:
    winget install "7-zip" --source msstore

    Then it will install. So, I guess other repositories are buggy

  7. Prometheus720 commented on Mar 19, 2023

    @Prometheus720

    This has been a consistent problem for me and a main reason why I must still rely on other package managers.

  8. loooooooooooor commented on Mar 31, 2023

    @loooooooooooor

    I face the exact same issue.

  9. static0verdrive commented on Apr 16, 2023

    @static0verdrive

    I also face this issue for anything requiring admin. I was trying to install Oracle.Virtualbox but I also tried to upgrade existing packages, and it failed with the same network error.

  10. niStee commented on Apr 27, 2023

    @niStee

    The problem is with the temp directory winget uses for install. This is located at %LOCALAPPDATA%\temp\WinGet and simply has insufficient permissions for an elevated permission install. So effectively the given admin account is unable to read files from this directory. Unfortunately, it doesn't help to adjust the permissions for this directory manually, because winget resets it during upgrade.

    This problem already persists for months now and I've no clue why this hasn't been fixed yet. Actually it should affect many users, if not all uses.

    What I can't understand is why it doesn't affect every package that needs admin elevation. Some of the programs I have installed can still be updated via winget, others can't.

  11. jmeile commented on Apr 29, 2023

    @jmeile

    io43
    I tried to do what you said, But from the admin command, I get this:

    Winget uninstall 7zip.7zip
    No installed package found matching input criteria.
    

    I tried with the "Runas" command with different switches: "/profile", "/noprofile", "/env", and no switch at all and I always get that error. I even tried running "cmd" from the start menu as administrator, but still the same result.

    From my normal user, the package will be found, but I will get the error from the original poster.

    That's why I switched to chocolatey. There I have to run the console as admin as well, but at least this works.

  12. thesobercoder commented on Apr 30, 2023

    @thesobercoder

    I moved away from winget to scoop because of this specific bug. My work laptop is configured to use a non-admin account for everyday work and occasionally use a different admin account to run stuff elevated.

  13. ondrejsv commented on May 13, 2023

    @ondrejsv

    This bug is already fixed in the 1.5 version.
    You may download the preview version in the Releases tab and I can confirm that this issue is no longer present.

  14. akaegi commented on May 16, 2023

    @akaegi

    I can confirm it's working with the preview version (v1.5.1081-preview) 👍

  15. adrian-cancio commented on May 18, 2023

    @adrian-cancio

    Yes, working well on current preview

  16. mdanish-kh commented on May 18, 2023

    @mdanish-kh
    Contributor
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-Bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions