WinGet COM API fails to install dependencies due to a sharing violation

Aberta
#6,695 1 comentário 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 2 dias

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
52/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
cpp
Domínio
api, cli

Direção de pesquisa

Start with the COM API install path used by PackageManager.InstallPackageAsync and compare its dependency installation flow with the WinGet CLI path, since the issue reports that the same packages install through the CLI. Read the related issue #6520 and investigate the sharing violation reported at Filesystem.cpp:1590; done means installing an APPX package and its dependency through the COM API succeeds.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Area-COM-API Issue-Bug
Relevant area(s)

WinGet CLI, COM API

Relevant command(s)

No response

Brief description of your issue

We're using WinGet 1.29.380. We have an appx package with another appx package as a dependency, and WinGet fails to install the dependency. Installing the packages separately works fine, as does installing the package using the WinGet CLI with the same source; only installation via the COM API seems to fail.

Seems to be similar to #6520.

2026-11-19 17:17:02.208 <I> [CLI ] Generated temp download path: C:\Temp\WinGet\TUToolBox\Microsoft.VCLibs.140.00.UWPDesktop.14.0.33728.0\9c17b521f9d690a1f504da5108ed6eec5669eb3a8fd1331eef43e40d84e74283
2026-11-19 17:17:02.208 <I> [CLI ] Created authentication arguments. Mode: silentPreferred, Account: 
2026-11-19 17:17:02.208 <I> [CORE] AuthenticationArguments values. Mode: silentPreferred, Account: 
2026-11-19 17:17:02.208 <I> [CORE] Creating WebAccountManagerAuthenticator for microsoftEntraIdForAzureBlobStorage
2026-11-19 17:17:02.210 <I> [CORE] WebAccountManagerAuthenticator created for MicrosoftEntraId. Resource: https://storage.azure.com/, Scope: 
2026-11-19 17:17:02.210 <I> [CORE] Started WebAccountManagerAuthenticator::AuthenticateForToken.
2026-11-19 17:17:02.210 <I> [CORE] Started GetTokenSilent.
2026-11-19 17:17:02.220 <I> [CORE] Authentication success
2026-11-19 17:17:02.220 <I> [CORE] HandleGetTokenResult Result: 0
2026-11-19 17:17:02.220 <I> [CORE] Finished WebAccountManagerAuthenticator::AuthenticateForToken. Result: 0
2026-11-19 17:17:02.220 <I> [CLI ] Installer download headers: Authorization: <Secret>; x-ms-version: 2020-04-08; 
2026-11-19 17:17:02.220 <I> [CORE] Downloading to path: C:\Temp\WinGet\TUToolBox\Microsoft.VCLibs.140.00.UWPDesktop.14.0.33728.0\9c17b521f9d690a1f504da5108ed6eec5669eb3a8fd1331eef43e40d84e74283
2026-11-19 17:17:02.220 <I> [CORE] DeliveryOptimization downloading from url: https://tuwienwinget.blob.core.windows.net/winget/3ea4ecd2-46c3-481e-97d0-a49f4ec9870e/Microsoft.VCLibs.140.00_14.0.33519.0_x64__8wekyb3d8bbwe-y8oY4pX6SQ.Appx
2026-11-19 17:17:07.571 <I> [CORE] Download completed.
2026-11-19 17:17:07.590 <I> [CORE] Started applying motw to C:\Temp\WinGet\TUToolBox\Microsoft.VCLibs.140.00.UWPDesktop.14.0.33728.0\9c17b521f9d690a1f504da5108ed6eec5669eb3a8fd1331eef43e40d84e74283 with zone: 3
2026-11-19 17:17:07.595 <I> [CORE] Finished applying motw
2026-11-19 17:17:07.596 <I> [CLI ] Installer hash verified
2026-11-19 17:17:07.598 <I> [CLI ] Successfully renamed downloaded installer. Path: C:\Temp\WinGet\TUToolBox\Microsoft.VCLibs.140.00.UWPDesktop.14.0.33728.0\Microsoft.VCLibs.140.00_14.0.33519.0_x64__8wekyb3d8bbwe-y8oY4pX6SQ.msix
2026-11-19 17:17:07.598 <I> [CORE] Started applying motw using IAttachmentExecute to C:\Temp\WinGet\TUToolBox\Microsoft.VCLibs.140.00.UWPDesktop.14.0.33728.0\Microsoft.VCLibs.140.00_14.0.33519.0_x64__8wekyb3d8bbwe-y8oY4pX6SQ.msix
2026-11-19 17:17:07.602 <I> [CORE] Started removing motw to C:\Temp\WinGet\TUToolBox\Microsoft.VCLibs.140.00.UWPDesktop.14.0.33728.0\Microsoft.VCLibs.140.00_14.0.33519.0_x64__8wekyb3d8bbwe-y8oY4pX6SQ.msix
2026-11-19 17:17:07.602 <E> [FAIL] C:\__w\1\s\external\pkg\src\AppInstallerCommonCore\Downloader.cpp(500)\WindowsPackageManager.dll!6AAC86E2: (caller: 6AAC8D0E) Exception(2) tid(7840) 80070003 Das System kann den angegebenen Pfad nicht finden.

2026-11-19 17:17:07.603 <W> [CORE] RemoveMotwIfApplicable failed before IAttachmentExecute::Save(). Result: -2147024893. Proceeding with Save()
2026-11-19 17:17:07.935 <I> [CORE] Finished applying motw using IAttachmentExecute. Result: 0 IAttachmentExecute::Save() result: 0
2026-11-19 17:17:07.937 <I> [CLI ] Found existing installer file at 'C:\Temp\WinGet\TUToolBox\Cisco.AnyConnect.5.1.7093.0\CiscoSystems.AnyConnect_5.1.7093.0_x64__edjcgkw48dhxt-6HXMyS2PhH.msix'. Verifying file hash.
2026-11-19 17:17:07.941 <I> [CLI ] Existing installer file hash matches. Will use existing installer.
2026-11-19 17:17:07.941 <I> [CLI ] Installer hash verified
2026-11-19 17:17:07.942 <I> [CORE] Started applying motw using IAttachmentExecute to C:\Temp\WinGet\TUToolBox\Cisco.AnyConnect.5.1.7093.0\CiscoSystems.AnyConnect_5.1.7093.0_x64__edjcgkw48dhxt-6HXMyS2PhH.msix
2026-11-19 17:17:07.943 <I> [CORE] Started removing motw to C:\Temp\WinGet\TUToolBox\Cisco.AnyConnect.5.1.7093.0\CiscoSystems.AnyConnect_5.1.7093.0_x64__edjcgkw48dhxt-6HXMyS2PhH.msix
2026-11-19 17:17:07.944 <E> [FAIL] C:\__w\1\s\external\pkg\src\AppInstallerCommonCore\Downloader.cpp(500)\WindowsPackageManager.dll!6AAC86E2: (caller: 6AAC8D0E) Exception(3) tid(b23c) 80070003 Das System kann den angegebenen Pfad nicht finden.

2026-11-19 17:17:07.944 <W> [CORE] RemoveMotwIfApplicable failed before IAttachmentExecute::Save(). Result: -2147024893. Proceeding with Save()
2026-11-19 17:17:08.209 <I> [CORE] Finished applying motw using IAttachmentExecute. Result: 0 IAttachmentExecute::Save() result: 0
2026-11-19 17:17:08.213 <I> [CLI ] Executing command: install
2026-11-19 17:17:08.213 <E> [FAIL] C:\__w\1\s\external\pkg\src\AppInstallerSharedLib\Filesystem.cpp(1590)\WindowsPackageManager.dll!6AC08A52: (caller: 6AC1478C) Exception(4) tid(ea98) 80070020 Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird.

2026-11-19 17:17:08.213 <E> [CLI ] Caught wil::ResultException: C:\__w\1\s\external\pkg\src\AppInstallerSharedLib\Filesystem.cpp(1590)\WindowsPackageManager.dll!6AC08A52: (caller: 6AC1478C) Exception(4) tid(ea98) 80070020 Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird.

2026-11-19 17:17:08.218 <I> [CLI ] Successfully refreshed process PATH environment variable.
2026-11-19 17:17:08.218 <E> [CLI ] Terminating context: 0x8a150110 at C:\__w\1\s\external\pkg\src\AppInstallerCLICore\Workflows\InstallFlow.cpp:356
Steps to reproduce

Have an APPX package depending on an APPX package, and install the package using PackageManager.InstallPackageAsync:

	const auto installOptions{ winrt::create_instance<winget::InstallOptions>(CLSID_InstallOptions) };
	installOptions.PackageVersionId(versionId);
	installOptions.PackageInstallMode(winget::PackageInstallMode::Silent);
	installOptions.PackageInstallScope(InstallScopeToPackageInstallScope(scope));
	installOptions.AuthenticationArguments(m_authenticationArguments);

	const auto result{ WaitForAsync(m_packageManager.InstallPackageAsync(catalogPackage, installOptions), callback)};
	if (result.Status() != winget::InstallResultStatus::Ok)
	{
		winrt::throw_hresult(result.ExtendedErrorCode());
	}
Expected behavior

The packages install successfully.

Actual behavior

The dependency fails to install.

Environment
Microsoft.WindowsPackageManager.InProcCom.1.29.380 from NuGet
Linguagem predominante
C++
Estrelas
26.6k
Forks
1.8k
Merge médio
2d 18h
PRs com merge (30d)
42

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de microsoft/winget-cli

Todas as issues de microsoft/winget-cli

Issues semelhantes

Mais issues de C++

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.