Giter Club home page Giter Club logo

Comments (1)

sergiou87 avatar sergiou87 commented on July 22, 2024 1

Nice catch!

From what I see, there are a few possible workarounds:

  1. Edit that env var in the registry (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment) but that doesn't broadcast WM_SETTINGCHANGE to other processes so they can grab he new value. I see some ideas like using setx right after that to set a variable to its own value.
  2. Write a native Node module that uses System.Environment.SetEnvironmentVariable and use that instead of setx.
  3. Use a PowerShell script to do this job with [Environment]::SetEnvironmentVariable('PATH', "$newPath",'Machine');
  4. Detect when the resulting PATH is longer than 1024 and don't do anything in that case (other than somehow surface that problem to the user).

With registryjs (1) should be pretty simple, although I can't tell how reliable that hacky use of setx right afterwards is. (3) also sounds simple but not sure if there could be other potential issues with the use of external scripts.

from desktop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.