Skip to content

Instantly share code, notes, and snippets.

@4tkbytes
Last active October 16, 2025 23:15
Show Gist options
  • Save 4tkbytes/364182fad7f886d99637ee97ec326c85 to your computer and use it in GitHub Desktop.
Save 4tkbytes/364182fad7f886d99637ee97ec326c85 to your computer and use it in GitHub Desktop.
Installing Rust on windows desktops without admin

Installing rust on desktops without admin

Are you on a computer where you cannot get MSVC on a computer because of admin? Well, this guide should help you out!

Note

This guide is only for windows.

  1. Download rustup/rust-init for windows. Download from here: https://www.rust-lang.org/tools/install or download from the web. Don't install it yet
  2. Download msys2. You will not be using MSVC, but instead be compiling using GNU. It does not make any differences (afaik) compared to MSVC. Download it from here: https://www.msys2.org/ and run through the setup. Msys2 should not require admin as it is copying folders. In the case that it does require it,
  3. Update msys2: Open msys2's UCRT or MINGW64 and run these commands:
pacman -Syu         // Updates the system
pacman -S mingw-w64-x86_64-toolchain base-devel     // Installs developer tools
  1. Go through rust setup. If it asks you to install MSVC, just enter in the option for no (or the option for GNU). continue and make everything however you wish but ensure the target is x86_64-pc-windows-gnu
  2. After a successful installation, create a new file under ~/.cargo/config.toml (if it doesnt exist). Enter in these lines:
[target.x86_64-pc-windows-gnu]
linker = "C:\\msys2\\mingw64\\bin\\gcc.exe"
ar = "C:\\msys2\\mingw64\\bin\\ar.exe"

Of course, change the locations to where ever you installed msys2 or keep it as it is.

  1. That should be all. To test if it works, create a new rust file and use rustc to compile.

Hope this helps!

@bryan-hoang
Copy link

This has been a very helpful guide. Thank you!

@4tkbytes
Copy link
Author

This has been a very helpful guide. Thank you!

tysm <3, didn't realise people read this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment