microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
23.24k stars 1.45k forks source link

Can not install a program to setting location #4660

Open RebelYoung opened 3 months ago

RebelYoung commented 3 months ago

Brief description of your issue

I can install a program to the location by winget install wechat -l 'D:\softwares' or winget install wechat --location 'D:\softwares'. The command installed the program to C: ,not the named path.

Steps to reproduce

winget install wechat -l 'D:\softwares'

Expected behavior

installed to user path as command

Actual behavior

the path changed into C:

Environment

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

Windows: Windows.Desktop v10.0.22631.3880
程序包: Microsoft.DesktopAppInstaller v1.17.10691.0

日志: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir

链接
----------------------------------------------------------------------------
隐私声明             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
github-actions[bot] commented 3 months ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

stephengillie commented 3 months ago

I'm not aware of this being a current feature. I might not be fully informed.

[Policy] Issue-Feature

Trenly commented 3 months ago

I'm not aware of this being a current feature. I might not be fully informed.

[Policy] Issue-Feature

@stephengillie - I think this duplicates #2752 and #1857 where the package either doesn’t support the location switch or no switch is defined in the manifest. The install location passed by -l can only be respected if the installer supports it and the switch is defined in the manifest (or the switch could be defined by the default installer type, if the default switch for that installer type is correct for the specific application)


-l, --location | Location to install to (if supported). -- | --

It's possible these packages do not support passing the location through to the installer. If they do support this mechanism, then it's likely related to the syntax used to specify the location.

Originally posted by @denelon in https://github.com/microsoft/winget-cli/issues/2752#issuecomment-1440558692

RebelYoung commented 3 months ago

@Trenly Thank you. However it works for the same version program in Windows 10 system.

Trenly commented 3 months ago

@Trenly Thank you. However it works for the same version program in Windows 10 system.

Its possible the installer itself behaves differently on Windows 10 and Windows 11. In order to diagnose the root cause it would be helpful to have the logs from winget install wechat -l 'D:\softwares' --verbose from both Windows 10 and Windows 11

denelon commented 3 months ago

I'm going to go ahead and close this issue as a duplicate of #2752.

@RebelYoung, feel free to share logs as @Trenly suggested to see if this is a WinGet bug due to different behaviors on Windows 10 vs. Windows 11. Be sure the same version of WinGet is used on both versions of the operating system so we can get a solid reproduction using the latest stable version.