microsoft / microsoft/winget-cli

Check whether the executable is running before uninstalling or upgrading portable package

Open
#2,571 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Brief description of your issue

WinGet doesn't check whether the executable is running before uninstalling or upgrading portable package, which would cause unexpected errors while WinGet is removing old executable.

Steps to reproduce
  1. Run winget install Tencent.COSCLI.
  2. Run coscli and leave it in the background.
  3. Run winget uninstall Tencent.COSCLI. WinGet will report errors.
Expected behavior

Report that the portable package to be uninstalled or upgraded is running.

Actual behavior

Errors occured while WinGet is removing old executable.

❯ winget uninstall COSCLI
已找到 COSCLI [Tencent.COSCLI]
正在启动程序包卸载...
执行此命令时发生意外错误:
remove: �ܾ����ʡ�: "C:\Users\SpecterShell\AppData\Local\Microsoft\WinGet\Packages\Tencent.COSCLI_Microsoft.Winget.Source_8wekyb3d8bbwe\coscli-windows.exe"
卸载失败,退出代码为: 0x8a150003 : Executing command failed
Environment
Windows 程序包管理器(预览) v1.4.2161-preview
版权所有 (C) Microsoft Corporation。保留所有权利。

Windows: Windows.Desktop v10.0.22621.608
系统体系结构: X64
程序包: Microsoft.DesktopAppInstaller v1.19.2161.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

Start by reproducing the issue with winget install Tencent.COSCLI, a background coscli process, and winget uninstall Tencent.COSCLI. Trace the portable-package uninstall and upgrade handling from the CLI command entry point. Done means WinGet detects the running executable and reports that condition instead of returning a removal 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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.