Enumerate and display blocking processes when installer exits with packageInUse / packageInUseByApplication

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

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
cpp

調査の方向性

Start by reading InstallFlow.cpp and ShellExecuteInstallerHandler.cpp in AppInstallerCLICore, then review the Windows Restart Manager APIs in rstrtmgr.h. Implement the detection flow only for packageInUse and packageInUseByApplication responses, and verify that the error block displays each blocking application's name and PID while retaining the installer exit code.

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

説明

Issue-Feature
Relevant area(s)

WinGet CLI

Description of the new feature / enhancement
Problem Statement

When an installer exits due to locked files (e.g. exit code 6 mapped to packageInUse or packageInUseByApplication in the manifest schema), WinGet outputs a localized message:

"The files modified by the installer are currently being used by another application. Please close the applications, then try again."
However, WinGet provides no visibility into which specific application or process is holding the lock.
In automated workflows, silent upgrades (-h / --silent), or scenarios involving shared DLLs/drivers, users are left completely in the dark.

Real-World Example

Upgrading OBSProject.OBSStudio from 32.2.1 to 32.2.2 silently fails with exit code 6 when an Electron/Chromium app (such as VS Code, Discord, Slack, or Antigravity) has loaded obs-virtualcam-module64.dll via DirectShow camera device enumeration. Even if the user closes OBS Studio itself, the lock remains held by an unrelated background process. Identifying the culprit currently requires manual inspection of process modules or handles.

User Value

Displaying the locking process names and PIDs allows users to immediately identify and close the conflicting application without guesswork, without running interactive installers, and without opening external tools like Process Explorer.

Proposed technical implementation details
Proposed Architecture
  1. Trigger Condition:
    In AppInstallerCLICore (InstallFlow.cpp / ShellExecuteInstallerHandler.cpp), execute the detection flow only when an installer returns an exit code mapped to ReturnResponse::packageInUse or ReturnResponse::packageInUseByApplication (e.g. exit code 6).
  2. Process Enumeration via Windows Restart Manager:
    Utilize the native Win32 Restart Manager API (rstrtmgr.h / rstrtmgr.dll):
    • Call RmStartSession to obtain a session handle.
    • Register the target package install path or modified files via RmRegisterResources.
    • Call RmGetList to obtain the array of RM_PROCESS_INFO structures (retrieving strAppName and Process.dwProcessId).
    • Clean up with RmEndSession.
  3. CLI Output Format:
    Render the list of blocking processes directly in the error block:
    The files modified by the installer are currently being used by another application:
      - Antigravity (PID: 9468)
    Please close these applications and try again.
    Installer failed with exit code: '6'
主要言語
C++
スター
26.6k
フォーク
1.8k
平均マージ
3日 10時間
マージ済み PR(30日)
41

環境構築

はじめの一歩

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

microsoft/winget-cli のほかの issue

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

似ている issue

C++ の issue をもっと見る

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

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