|
| 1 | +# 🦀 Rust Development Environment Setup (Windows, Offline) |
| 2 | + |
| 3 | +This guide walks through setting up a complete **Rust development environment** on a **Windows workstation** that does **not have internet access**. |
| 4 | + |
| 5 | +## 📦 Overview |
| 6 | + |
| 7 | +You will prepare the following components **on an internet-connected machine**, then **transfer them via USB drive** to the disconnected workstation: |
| 8 | + |
| 9 | +- Rust toolchain (stable) |
| 10 | +- Cargo packages (pre-downloaded) |
| 11 | +- VSCode + Rust extension (offline VSIX) |
| 12 | +- Build tools (C++ compiler) |
| 13 | +- Optional: `rust-analyzer`, documentation |
| 14 | + |
| 15 | +--- |
| 16 | + |
| 17 | +## ✅ Prerequisites |
| 18 | + |
| 19 | +### 🖥️ On Target Workstation (Disconnected) |
| 20 | + |
| 21 | +- Windows 10 or 11 |
| 22 | +- Administrator privileges (optional but helpful) |
| 23 | +- USB port for transfer |
| 24 | + |
| 25 | +### 💻 On Source Machine (Internet Connected) |
| 26 | + |
| 27 | +- A separate Windows/Linux/Mac machine |
| 28 | +- Internet access |
| 29 | +- USB drive with at least 10 GB free |
| 30 | + |
| 31 | +--- |
| 32 | + |
| 33 | +## 🔁 Step 1: Prepare Rust Toolchain |
| 34 | + |
| 35 | +### On Connected Machine: |
| 36 | + |
| 37 | +1. Download the Windows Rust installer: |
| 38 | + |
| 39 | +```bash |
| 40 | +https://static.rust-lang.org/dist/rust-1.77.2-x86_64-pc-windows-msvc.msi |
| 41 | + |
| 42 | +``` |
| 43 | +> Replace version with latest stable, if needed. |
| 44 | +
|
| 45 | +2. Download associated `cargo`, `rustc`, and `rust-docs` tarballs: |
| 46 | +```bash |
| 47 | +https://static.rust-lang.org/dist/cargo-1.77.2-x86_64-pc-windows-msvc.tar.gz |
| 48 | +https://static.rust-lang.org/dist/rustc-1.77.2-x86_64-pc-windows-msvc.tar.gz |
| 49 | +https://static.rust-lang.org/dist/rust-docs-1.77.2-x86_64-pc-windows-msvc.tar.gz |
| 50 | + |
| 51 | +``` |
| 52 | + |
| 53 | +3. Download `rustup-init.exe` **if you want to use rustup offline:** |
| 54 | +```bash |
| 55 | +https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe |
| 56 | + |
| 57 | +``` |
| 58 | + |
| 59 | +4. Transfer all files to USB. |
| 60 | + |
| 61 | +--- |
| 62 | + |
| 63 | +## 🧰 Step 2: Install Rust Offline |
| 64 | + |
| 65 | +**On Target Workstation:** |
| 66 | + |
| 67 | +1. Run the MSI installer: |
| 68 | +```powershell |
| 69 | +rust-1.77.2-x86_64-pc-windows-msvc.msi |
| 70 | +
|
| 71 | +``` |
| 72 | +> You can also run `rustup-init.exe` with the following: |
| 73 | +
|
| 74 | +```powershell |
| 75 | +.\rustup-init.exe --default-toolchain 1.77.2 --no-update-default |
| 76 | +
|
| 77 | +``` |
| 78 | + |
| 79 | +2. Confirm installation: |
| 80 | + |
| 81 | +```powershell |
| 82 | +rustc --version |
| 83 | +cargo --version |
| 84 | +
|
| 85 | +``` |
| 86 | +--- |
| 87 | + |
| 88 | +## 🧱 Step 3: Install C++ Build Tools (MSVC) |
| 89 | + |
| 90 | +1. On internet-connected machine, download: |
| 91 | + |
| 92 | +* **Build Tools for Visual Studio 2022:** |
| 93 | +```powershell |
| 94 | +https://aka.ms/vs/17/release/vs_BuildTools.exe |
| 95 | +
|
| 96 | +``` |
| 97 | + |
| 98 | +2. On the connected machine, run: |
| 99 | +```powershell |
| 100 | +.\vs_BuildTools.exe --layout .\offline_vs_buildtools --lang en-US --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 |
| 101 | +
|
| 102 | +``` |
| 103 | +> This creates an **offline installer** directory. |
| 104 | +
|
| 105 | +3. Transfer `offline_vs_buildtools` folder to target. |
| 106 | + |
| 107 | +4. On the disconnected workstation: |
| 108 | + |
| 109 | +```powershell |
| 110 | +.\offline_vs_buildtools\vs_BuildTools.exe --noweb --quiet --wait |
| 111 | +
|
| 112 | +``` |
| 113 | +--- |
| 114 | + |
| 115 | +## 🧩 Step 4: Set Up VSCode Offline |
| 116 | + |
0 commit comments