Rust Windows Installer

What specifically does the Rust installer look for on Windows?

I'd like to put Rust on a machine I don't have admin right on.
I am aware of the gnu toolchain option, though I'd rather have it with msvc (Rust docs say that many crates are not compatible with the gnu option).
Since I don't have admin, I have installed vs build tools this way and with the environment set, the compiler and linker are accessible.

Yet, rust-init.exe still says "Rust requires a linker and Windows API libraries but they don't seem to be available."
Any specific env vars it is looking for?

My limited understanding is that it needs to ensure the Visual Studio dependencies are available. The rustup book has some details: MSVC prerequisites - The rustup book

You can skip that step by selecting option 3.

The installer obviously is looking for something and it does not find it. The msvc compiler and linker are accessible in the environment.

What (else) it is looking for and how?

Why would I want to skip the step? Are you saying that the way the installer looks for the vs build tools is different than the way the Rust compiler would?

Here is the relevant code: https://github.com/rust-lang/cc-rs/blob/439b75f33bc42602d29a27150e4389f2c58fe129/src/windows/find_tools.rs#L433

To explain, it checks for the environment variable VCINSTALLDIR and if it exists then it trusts that everything has been setup correctly (e.g. link.exe etc are in PATH).

EDIT: Ah wait, rustup is using an older version of the detection code so to pass its check you have to also add VSINSTALLDIR (note: that's VS and not VC).

1 Like

Exactly what I was looking for.
Thank you!