winget-cli
winget-cli copied to clipboard
“winget install -l” The specified location is different from the installation location
Brief description of your issue
When I use
Tencent.TencentDocs -l "E:\Program Files\TencentDocs"
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".
There is only an empty TencentDocs folder under the E:\Program Files folder
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
I'm wondering if this is related to syntax. The string may need to be quoted as nested to preserve the whitespace.
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?
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.

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