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

“winget install -l” The specified location is different from the installation location

Open XYZliang opened this issue 2 years ago • 6 comments

Brief description of your issue

When I use Tencent.TencentDocs -l "E:\Program Files\TencentDocs" uTools_1670412866288 When I ordered the installation of TencentDocs, the software was incorrectly installed in the directory "E:\Program" instead of the specified "E:\Program Files\TencentDocs". image There is only an empty TencentDocs folder under the E:\Program Files folder image I've tried uninstalling and reinstalling many times, and that seems to happen when I install this particular program. No abnormalities have been found in other installation programs. I don't know if the problem was on winget or the package, but I decided to raise the issu.

Steps to reproduce

just run Tencent.TencentDocs -l "E:\Program Files\TencentDocs" in cmd

Expected behavior

TencentDocs will be installed to the directory "E:\Program Files\TencentDocs"

Actual behavior

Under E:\Program Files, only a new folder TencentDocs was created, but no program was installed and the folder is empty. The Program is installed to E:\Program

Environment

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

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

XYZliang avatar Dec 07 '22 11:12 XYZliang

I'm wondering if this is related to syntax. The string may need to be quoted as nested to preserve the whitespace.

denelon avatar Dec 07 '22 21:12 denelon

Yes, what's your Terminal character code settings? Also try to use powershell for better terminal support. Clearly you need to escape the empty space somehow. What about using single quotes?

eabase avatar Dec 10 '22 04:12 eabase

Yes, what's your Terminal character code settings? Also try to use powershell for better terminal support. Clearly you need to escape the empty space somehow. What about using single quotes?

Thank you for your suggestion, I tried to install the software with this problem using powershell, but the problem persists. Also, both my cmd and powershell encoding is 936, which is the default Simplified Chinese (GB2312). After I switched to UTF-8 (65001) encoding, the problem existed as well. I also tried using single quotes instead of double quotes, but still no solution. Interestingly, this bug only occurs with some specific software, such as Motrix, Termius, uTools, Tencent Docs. uTools_1677080813519

XYZliang avatar Feb 22 '23 15:02 XYZliang

I'm wondering if this is related to syntax. The string may need to be quoted as nested to preserve the whitespace.

Sorry I don't seem to understand what you mean, can you briefly say how one should try to fix it? I reinstalled my Windows system and tried to install all the software via winget, but there are more and more packages with this problem and it is only those few specific packages that show this exception.

XYZliang avatar Feb 22 '23 15:02 XYZliang

From Microsoft Learn:

-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.

denelon avatar Feb 22 '23 18:02 denelon

From Microsoft Learn:

-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.

Thanks for your reply, I installed the software with the installation path problem into another folder without spaces, for example "D:\ProgramFiles", and everything worked fine, so they should support passing the location to the installer. As you said, it seems that the spaces in the specified installation location are causing some kind of syntax bug.

XYZliang avatar Feb 23 '23 05:02 XYZliang