Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug User PATH environment variable not used

Discussion in 'Unity Hub' started by Wepner-PD, May 25, 2023.

  1. Wepner-PD

    Wepner-PD

    Joined:
    Jul 13, 2018
    Posts:
    32
    Hello everyone,

    Whenever I use Unity Hub to start Unity, and my IDE (VSCode) through Unity, the
    PATH
    environment variable is set to the one active for the entire system, but doesn't include the content from the user specific value. The latter one might be used for installation of software in the users directory as it is e. g. done with Visual Studio Code by default and probably other software as well. Since the
    PATH
    doesn't include paths that are user specific, executing applications that otherwise would be included in the (user specific)
    PATH
    is not possible, which can break scripts or Tasks.

    Steps to reproduce:
    - Make sure that the users
    Path
    environment variable contains at least one path (that ideally isn't contained in the system wide value)
    - Open Unity Hub (restarting Unity Hub doesn't influence this behavior)
    - inspect the environment variables of Unity Hub using e. g. Process Explorer (select process, right click, properties, environment)
    -> the user specific paths should be contained
    - Open a Unity project (and thus a Unity instance) through Unity Hub
    - inspect the environment variables using e. g. Process Explorer (select process, right click, properties, environment)
    -> Result: the user specific paths are not contained
    -> Expected: the
    PATH
    environment variable is the same as the one of Unity Hub

    Optional further steps:
    - Open the IDE through Unity e. g. using "Assets" -> "Open C# Project"
    - inspect the environment variables using e. g. Process Explorer (select process, right click, properties, environment
    -> Result: the user specific paths are not contained
    -> Expected: the
    PATH
    environment variable is the same as the one of Unity Hub

    The
    PATH
    environment variable is set properly when the IDE is started directly e. g. through the start menu.

    The problem occurs with:
    - Windows 10
    - Unity Hub 3.4.2
    - Unity 2021.3.24

    It's rather likely that the Windows and Unity version don't influence this behavior. I didn't test other setups yet.
     
    Last edited: Jun 20, 2023
    Petr777 and unity_MgrCL-Hpx3WY6A like this.
  2. Wepner-PD

    Wepner-PD

    Joined:
    Jul 13, 2018
    Posts:
    32
    Bump since there was no response in almost a month.

    Is this a Bug in Unity Hub or in Unity? Is this a known bug? Will this be fixed? (Of course I'd also be curious to know what leads to this behavior, if anything is known already.)
     
  3. Wepner-PD

    Wepner-PD

    Joined:
    Jul 13, 2018
    Posts:
    32
    I got the hint that Process Explorer could be used in order to inspect the environment variables of a process. I've adjusted the description accordingly.