microsoft / microsoft/winget-cli
Running into Windows path length limits for installer log files
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 26.4k
- Forks
- 1.8k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 15
Description
Brief description of your issue
This is somewhat related to https://github.com/microsoft/winget-cli/issues/1808 but for installer log files. Because winget sets the log location to an already deep path, the log files that get created by the installer can more easily run into the 260 path length limit of Windows.
In the repro below, the installer attempts to create a log with the path of C:\Users\WDAGUtilityAccount\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir\WinGet-Microsoft.dotnet.6.1.322.12413-2022-03-22-14-16-07.487_013_Microsoft.NET.Sdk.Android.Manifest_6.0.100.31.0.101_preview.9.16_x64.msi.log which is over the path length limit.
Steps to reproduce
git clone https://github.com/microsoft/winget-pkgs.gitcd winget-pkgsgit checkout 5e9640f.\Tools\SandboxTest.ps1 manifests\m\Microsoft\DotNet\6.1.322.12413
Expected behavior
.NET SDK should be successfully installed in Windows Sandbox environment.
Actual behavior
Install fails.
Output:
--> Installing WinGet
Tip: you can type 'Update-EnvironmentVariables' to update your environment variables, such as after installing a new software.
--> Configuring Winget
Admin setting enabled.
--> Installing the Manifest 6.1.322.12413
Found Microsoft .NET SDK [Microsoft.dotnet] Version 6.1.322.12413
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://dotnetcli.azureedge.net/dotnet/Sdk/6.0.103/dotnet-sdk-6.0.103-win-x64.exe
██████████████████████████████ 187 MB / 187 MB
Successfully verified installer hash
Starting package install...
Installer failed with exit code: 87
Installer log is available at: C:\Users\WDAGUtilityAccount\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir\WinGet-Microsoft.dotnet.6.1.322.12413-2022-03-22-14-16-07.487.log
--> Refreshing environment variables
--> Comparing ARP Entries
DisplayName DisplayVersion Publisher ProductCode
----------- -------------- --------- -----------
Microsoft ASP.NET Core 6.0.3 Targeting Pack (x64) 6.0.3.22124 Microsoft Corporation {EA11EC08-4D6C-3AA8-86BB-3FC200EF074C}
Relevant output from the installer log file:
[02B0:02B8][2022-03-22T14:16:39]e000: Error 0x80070057: Failed to enable logging for package: Microsoft.NET.Sdk.Android.Manifest_6.0.100.31.0.101_preview.9.16_x64.msi to: C:\Users\WDAGUtilityAccount\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir\WinGet-Microsoft.dotnet.6.1.322.12413-2022-03-22-14-16-07.487_013_Microsoft.NET.Sdk.Android.Manifest_6.0.100.31.0.101_preview.9.16_x64.msi.log
[02B0:02B8][2022-03-22T14:16:39]e000: Error 0x80070057: Failed to execute MSI package.
[13C0:13C4][2022-03-22T14:16:39]e000: Error 0x80070057: Failed to configure per-machine MSI package.
Environment
Windows Package Manager v1.2.10271
Copyright (c) Microsoft Corporation. All rights reserved.
Windows: Windows.Desktop v10.0.22000.556
Package: Microsoft.DesktopAppInstaller v1.17.10271.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named. Start by running Tools/SandboxTest.ps1 with manifests/m/Microsoft/DotNet/6.1.322.12413 and trace how the installer log path is selected. Done means the reported .NET SDK installation succeeds without exceeding Windows' path-length limit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, powershell
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100