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

オープン
#6,695 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
1〜2日
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
cpp
領域
api, cli

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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
主要言語
C++
スター
26.6k
フォーク
1.8k
平均マージ
2日 18時間
マージ済み PR(30日)
42

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/winget-cli のほかの issue

microsoft/winget-cli の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。