Skip to content

[BUG] Winget command with --location and subsequent flags is incorrectly parsed – path becomes malformed #4962

@de-served

Description

@de-served

Please confirm these before moving forward

  • I have searched for my issue and have not found a work-in-progress/duplicate/resolved issue.
  • I have tested that this issue has not been fixed in the latest (beta or stable) release.
  • I have checked the FAQ section for solutions.
  • This issue is about a bug (if it is not, please use the correct template).

UniGetUI Version

2026.2.1

Windows version, edition, and architecture

Windows 11 24H2

Describe your issue

When installing a package with a custom installation directory using the "Architecture and location" tab in the "Settings for installation" dialog, the generated winget.exe command appears correctly in the "Run this command" field (e.g., winget.exe install --id "pinokiocomputer.pinokio" --location "F:\ABCD\" --accept-package-agreements --force).
However, the actual installation path becomes F:\ABCD --accept-package-agreements --force – the subsequent flags are appended to the path string instead of being treated as separate command‑line arguments.

This indicates that the command is not being correctly escaped or passed to the underlying process, causing winget to interpret everything after --location as the single value of that parameter.

Steps to reproduce the issue

  1. Launch UniGetUI.
  2. Search for a package, e.g., Pinokio (pinokiocomputer.pinokio).
  3. Open the "Settings for installation" dialog for that package.
  4. Disable the "Follow default settings" toggle.
  5. Go to the "Architecture and location" tab.
  6. Enter a custom installation path, e.g., F:\ABCD\ (or any non‑default path).
  7. Optionally, ensure that extra flags (like --accept-package-agreements and --force) are included – they are automatically added by UniGetUI.
  8. Proceed with the installation.
  9. After installation, check the actual installation location (e.g., by looking at the installed application properties or using winget list).
  10. Observe that the installation path is F:\ABCD --accept-package-agreements --force instead of F:\ABCD\

Expected behavior
The package should be installed in the exact directory specified in the "Location" field (e.g., F:\ABCD). The extra flags (--accept-package-agreements, --force, etc.) should be passed as separate arguments to winget.exe and not become part of the path.

Actual behavior
The installation path includes the additional flags as if they were part of the directory name, resulting in a malformed path (e.g., F:\ABCD --accept-package-agreements --force). This clearly shows that the command‑line arguments are not being properly split or escaped when UniGetUI invokes winget.exe.

Possible cause / Suggested fix
The root cause is likely that UniGetUI constructs a single command string and passes it to a shell (e.g., cmd /c) without correctly quoting or separating the arguments. Even though the command looks correct in the UI, the actual process creation does not preserve the boundaries between --location's value and the following flags.

Recommended solution:
Instead of building a command string, UniGetUI should use an argument array (e.g., ProcessStartInfo.ArgumentList in .NET) when launching winget.exe. This ensures that each argument is passed as a separate element and properly escaped by the operating system, preventing any misinterpretation of spaces or quotes.

As a workaround for the current behaviour, one could reorder the flags so that --location appears after all other flags (e.g., winget.exe install --id ... --accept-package-agreements --force --location "F:\ABCD"), but this does not fix the underlying parsing issue and is not a robust solution.

UniGetUI Log

[2026/06/18 17:40:16] Auto-updater source 'ProductInfo' returned version 2026.2.1.0 (upgradable=False)
[2026/06/18 18:11:30] Found 0 available packages from Pip with the query pinokio
[2026/06/18 18:11:32] Found 2 available packages from Winget with the query pinokio
[2026/06/18 18:13:18] Loaded operation parameters for package id=pinokiocomputer.pinokio on manager Winget and operation Install: install --id "pinokiocomputer.pinokio" --exact --source winget --accept-source-agreements --disable-interactivity --silent --accept-package-agreements --force 
[2026/06/18 18:13:21] Loaded operation parameters for package id=pinokiocomputer.pinokio on manager Winget and operation Install: install --id "pinokiocomputer.pinokio" --exact --source winget --accept-source-agreements --disable-interactivity --silent --accept-package-agreements --force 
[2026/06/18 18:13:51] Loaded operation parameters for package id=pinokiocomputer.pinokio on manager Winget and operation Install: install --id "pinokiocomputer.pinokio" --exact --source winget --accept-source-agreements --disable-interactivity --silent --location "D:\AI\Pinokio\" --accept-package-agreements --force 
[2026/06/18 18:14:34] Version string 25.01 ZS v1.5.7 appears to contain non-numeric characters within a numeric segment and will be treated as unknown
[2026/06/18 18:14:34] Version string 25.01 ZS v1.5.7 appears to contain non-numeric characters within a numeric segment and will be treated as unknown
[2026/06/18 18:14:57] Loaded operation parameters for package id=pinokiocomputer.pinokio on manager Winget and operation Install: install --id "pinokiocomputer.pinokio" --exact --source winget --accept-source-agreements --disable-interactivity --silent --location "D:\AI\Pinokio\" --accept-package-agreements --force 
[2026/06/18 18:15:08] Version string Quail 1 2026.1.1 Patch 1 appears to contain non-numeric characters within a numeric segment and will be treated as unknown
[2026/06/18 18:15:08] Version string Quail 1 2026.1.1 Patch 1 appears to contain non-numeric characters within a numeric segment and will be treated as unknown
[2026/06/18 18:15:08] Version string 1.2.83.461.g4d9c3dae appears to contain non-numeric characters within a numeric segment and will be treated as unknown
[2026/06/18 18:15:08] Version string 1.2.83.461.g4d9c3dae appears to contain non-numeric characters within a numeric segment and will be treated as unknown
[2026/06/18 18:15:09] Found 384 installed packages from Winget
[2026/06/18 18:15:09] Marking the shortcut C:\Users\**hidden**\Desktop\Pinokio.lnk to be asked to be deleted
[2026/06/18 18:19:33] Loaded operation parameters for package id=pinokiocomputer.pinokio on manager Winget and operation Install: install --id "pinokiocomputer.pinokio" --exact --source winget --accept-source-agreements --disable-interactivity --silent --location "D:\AI\Pinokio\" --accept-package-agreements --force 
[2026/06/18 18:19:47] Loaded operation parameters for package id=pinokiocomputer.pinokio on manager Winget and operation Install: install --id "pinokiocomputer.pinokio" --exact --source winget --accept-source-agreements --disable-interactivity --silent --accept-package-agreements --force 
[2026/06/18 18:20:09] Loaded operation parameters for package id=pinokiocomputer.pinokio on manager Winget and operation Install: install --id "pinokiocomputer.pinokio" --exact --source winget --accept-source-agreements --disable-interactivity --silent --location "D:\AI\Pinokio\" --accept-package-agreements --force 
[2026/06/18 18:27:23] Loaded operation parameters for package id=pinokiocomputer.pinokio on manager Winget and operation Install: install --id "pinokiocomputer.pinokio" --exact --source winget --accept-source-agreements --disable-interactivity --silent --location "D:\AI\Pinokio\" --accept-package-agreements --force

Package Managers Logs

-

Relevant information

No response

Screenshots and videos

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwinget

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions