Skip to content

Install script (falsely) claims to modify process environment #413

Closed
@Jaykul

Description

@Jaykul

When running the install script the dnvm setup command outputs text indicating that it has set the process environment variables so I can use DNVM:

Adding C:\Users\Jaykul\.dnx\bin to Process PATH
Adding C:\Users\Jaykul\.dnx\bin to User PATH
Adding C:\Users\Jaykul\.dnx to Process DNX_HOME
Adding C:\Users\Jaykul\.dnx to User DNX_HOME

In fact, after the install finishes, the environment is not set, because the install script is (needlessly) running multiple nested processes.

If you just use the PowerShell portion of the install script (the contents of the &{...} block), it could work, but it still doesn't, because in the dnvminstall.ps1 when you call dnvm setup you are running the CMD version (starting a new process) which then calls the PowerShell version (starting another new process), so when the process environment is set, it's on a process which immediately terminates.

If the dnvminstall.ps1 script just called the dnvm.ps1 script directly instead, my environment would be set, and I wouldn't need to exit PowerShell and start a new process to pick up the changes to my PATH.

My suggestion would be to have the home README specify a PowerShell-friendly version of the install command, and just tell people to run it there -- and also alter the dnvminstall.ps1 script so that you're not calling CMD from PowerShell just to get you back into Powershell...

The alternative might be to put a -quiet switch on the setup command so you're not printing messages that aren't true ;-)

FWIW, the PowerShell 3+ version of the install command could be as simple as:

$Branch='dev'; iex (irm https://github.com/aspnet/Home/raw/dev/dnvminstall.ps1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions