winget-cli icon indicating copy to clipboard operation
winget-cli copied to clipboard

WinGet adds the relative path directly to the PATH.

Open DuckDuckStudio opened this issue 7 months ago • 0 comments

Brief description of your issue

I was trying to install a zip+portable package when I encountered an undefined command line alias, and when I checked the user PATH, I found that WinGet added a relative path directly to the user PATH.

Steps to reproduce

git clone https://github.com/DuckDuckStudio/winget-pkgs.git
cd winget-pkgs
gh pr checkout https://github.com/microsoft/winget-pkgs/pull/254394
winget install --skip-dependencies --manifest manifests/d/denglihong2007/CRSim/2.2.0.0/ -l ../Test

Expected behavior

The package can be started using a command line alias.

Actual behavior

> winget install --skip-dependencies --manifest . -l ../Test
已找到 CRSim [denglihong2007.CRSim] 版本 2.2.0.0
此应用程序由其所有者授权给你。
Microsoft 对第三方程序包概不负责,也不向第三方程序包授予任何许可证。
已跳过依赖项。
正在下载 https://github.com/denglihong2007/CRSim/releases/download/v2.2.0.0/CRSim-release-2.2.0.0.zip
  ██████████████████████████████  33.3 MB / 33.3 MB
已成功验证安装程序哈希
正在提取存档...
已成功提取存档
正在启动程序包安装...
已修改路径环境变量;重启 shell 以使用新值。
添加了命令行别名: "CRSim"
已成功安装
> winget list CRSim
名称  ID                                               版本
--------------------------------------------------------------
CRSim ARP\User\X64\denglihong2007.CRSim__DefaultSource 2.2.0.0
> CRSim
CRSim: The term 'CRSim' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Image

Environment

Windows 程序包管理器 v1.10.390
版权所有 (C) Microsoft Corporation。保留所有权利。

Windows: Windows.Desktop v10.0.22631.5189
系统体系结构: X64
软件包: Microsoft.DesktopAppInstaller v1.25.390.0

Winget 目录
-------------------------------------------------------------------------------------------------------------------
日志                   %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
用户设置               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json
可移植链接目录(用户)   %LOCALAPPDATA%\Microsoft\WinGet\Links
可移植链接目录(计算机) C:\Program Files\WinGet\Links
可移植包根目录(用户)   %LOCALAPPDATA%\Microsoft\WinGet\Packages
可移植包根目录         C:\Program Files\WinGet\Packages
可移植包根目录 (x86)   C:\Program Files (x86)\WinGet\Packages
安装程序下载           %USERPROFILE%\Downloads
配置模块               %LOCALAPPDATA%\Microsoft\WinGet\Configuration\Modules

链接
----------------------------------------------------------------------------
隐私声明             https://aka.ms/winget-privacy
许可协议             https://aka.ms/winget-license
第三方声明           https://aka.ms/winget-3rdPartyNotice
主页                 https://aka.ms/winget
Windows 应用商店条款 https://www.microsoft.com/en-us/storedocs/terms-of-sale

管理员设置                                状态
------------------------------------------------
LocalManifestFiles                        已启用
BypassCertificatePinningForMicrosoftStore 已禁用
InstallerHashOverride                     已禁用
LocalArchiveMalwareScanOverride           已禁用
ProxyCommandLineOptions                   已禁用
DefaultProxy                              已禁用

Additional Information

If a full path is used the PATH length limit is exceeded.

Image

WinGet-2025-05-07-11-12-22.928.log

DuckDuckStudio avatar May 07 '25 03:05 DuckDuckStudio