Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows installer complains about not being able to update the PATH variable #2897

Open
totkeks opened this issue Dec 17, 2024 · 0 comments
Open

Comments

@totkeks
Copy link

totkeks commented Dec 17, 2024

Expected Behavior

Installer completes without any issue.

Actual Behavior

Installer completes with error on updating the PATH variable.
image

Steps to Reproduce the Problem

  1. winget update Balena.BalenaCLI

Specifications

  • balena CLI version: 20.1.0
  • Operating system version: Windows 26120.2702 (Win11, 24H2 Dev Insider)
  • 32/64 bit OS and processor: 64-bit
  • Install method: winget (uses installer.exe)

Additional

I don't know if this error relates to updating the current PATH variable of the current console session or to the PATH variable in the system environment, which resides in the registry.

From my quick research the limit doesn't seem to be 1024 and also not 2048. Because I am above those and got no issues.

Manually checking the path results in 1853 characters. And checking the raw value in the registry it is only 796 characters.

The path in registry also contains many vars like %USERPROFILE, which shortens it even more.

From my research the supported length could be 4096 or even more.

API documentation says one should not use more than 2048 characters (https://learn.microsoft.com/en-us/dotnet/api/system.environment.setenvironmentvariable?view=net-8.0#system-environment-setenvironmentvariable(system-string-system-string))

If target is EnvironmentVariableTarget.User or EnvironmentVariableTarget.Machine, we recommend that the length of value be less than 2048 characters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant