microsoft / microsoft/winget-cli

Portable App installation fails when temp path is on a different disk

Open
#3,144 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue-Bug Portable
Dominant language
C++
Stars
26.4k
Forks
1.8k
Avg merge
1d 11h
Merged PRs (30d)
15

Description

Brief description of your issue

When setting the environment variables TEMP/TMP to a different hard drive such as F:/Temp all portable winget installs will result in the following error:

An unexpected error occurred while executing the command:
copy_file: Access is denied.: "F:\Temp\WinGet\xxx\extracted\xxx", "C:\PortableApps\Winget\xxx\platform-tools"

The directories are created and it isn't an issue of missing privileges, just the contents aren't copied over.
Setting the installation location to F:\PortableApps works as expected.

Steps to reproduce
  1. Set your TEMP and TMP user environment variables to another disk, for example F:/Temp
  2. (Make sure the install location isn't on the same disk as your TEMP directory, by setting "portablePackageUserRoot" or adding the --location option during install)
  3. install a portable package, for example winget install Google.PlatformTools --location 'C:\PortableApps\Winget'
Expected behavior

The package gets extracted and moved into the specified directory.

Actual behavior

Only the directory is created, but without contents and the following error is shown:

An unexpected error occurred while executing the command:
copy_file: Access is denied.: "F:\Temp\WinGet\Google.PlatformTools.34.0.1\extracted\platform-tools", "C:\PortableApps\Winget\platform-tools"
Portable install failed; Cleaning up...
Environment
Windows: Windows.Desktop v10.0.22621.1485
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.19.10173.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin at the portable install path exercised by winget install Google.PlatformTools --location and the portablePackageUserRoot setting; trace how extracted contents are moved when TEMP/TMP is on another drive. Reproduce on Windows with the supplied package case, then verify the package contents appear at the requested location without the access-denied error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.