-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrustup.ps1
More file actions
23 lines (17 loc) · 726 Bytes
/
rustup.ps1
File metadata and controls
23 lines (17 loc) · 726 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
$ErrorActionPreference = "Stop"
if ([environment]::Is64BitOperatingSystem) {
$arch = "x86_64"
$install_dir = "C:\Program Files\Rust"
} else {
$arch = "i686"
$install_dir = "C:\Program Files (x86)\Rust"
}
$package = "rust-nightly-$($arch)-pc-windows-gnu.exe"
$url = "https://static.rust-lang.org/dist/$($package)"
echo "Downloading Rust and Cargo from $($url)"
Start-FileDownload $url
echo "Installing Rust"
Start-Process ".\$($package)" -ArgumentList "/VERYSILENT /NORESTART" -NoNewWindow -Wait
echo "Refreshing Path"
$env:Path = [System.Environment]::GetEnvironmentVariable("Path", "User") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "Machine")
echo "Rust and Cargo are ready to roll!"