Setting RUSTUP_HOME and CARGO_HOME before running rustup installation does not work in Windows

69 Views Asked by At

Defining RUSTUP_HOME and/or CARGO_HOME environment variables to override default installation directory for .cargo and .rustup does not work (in Windows at least).

Steps to reproduce:

  • Define RUSTUP_HOME as an environment variable
  • Define CARGO_HOME as an environment variable
  • Double click on rustup-init.exe to begin the installation

Result:

.rustup and .cargo will be installed at the default directory which is %USERPROFILE%.

1

There are 1 best solutions below

0
Moaaz Assali On

After defining RUSTUP_HOME and CARGO_HOME environment variables, run rustup-init.exe from the terminal like .\Downloads\rustup-init.exe instead of double clicking the .exe file.