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%.
After defining RUSTUP_HOME and CARGO_HOME environment variables, run rustup-init.exe from the terminal like
.\Downloads\rustup-init.exeinstead of double clicking the .exe file.