Rust游戏开发实战
上QQ阅读APP看书,第一时间看更新

1.1.3 完成安装

RustUp安装工具的屏幕输出信息很冗长,它会确切地告诉使用者这个安装程序将要做的事情:

Welcome to Rust!
 
This will download and install the official compiler for the Rust
programming language, and its package manager, Cargo.
 
RustUp metadata and toolchains will be installed into the RustUp
home directory, located at:
 
  C:\Users\herbe\.rustup
This can be modified with the RUSTUP_HOME environment variable.
 
The Cargo home directory located at:
 
  C:\Users\herbe\.cargo
 
This can be modified with the CARGO_HOME environment variable.
 
The cargo, rustc, rustup and other commands will be added to
Cargo's bin directory, located at:
 
  C:\Users\herbe\.cargo\bin
 
This path will then be added to your PATH environment variable by
modifying the HKEY_CURRENT_USER/Environment/PATH registry key.
 
You can uninstall at any time with rustup self uninstall and
these changes will be reverted.

You are then presented with installation options:

Current installation options:
  
  default host triple: x86_64-pc-windows-msvc
      default toolchain: stable (default)
                 profile: default
  modify PATH variable: yes
 
1) Proceed with installation (default)
2) Customize installation
3) Cancel installation

大多数情况下,用户只需要输入1然后按回车键即可。如果用户需要修改Rust的安装位置,则需要输入2,然后按照屏幕上的提示去操作。值得注意的一点是,在自己的操作系统账户下安装Rust并不需要系统管理员权限。

一旦进入真正的安装环节,RustUp会下载若干个Rust包并把它们安装在当前这台计算机上。RustUp会修改path环境变量,如果打算在安装完成后继续使用当前的终端窗口,则最好把它重启一次[2]。恭喜你!Rust已安装完成,并可以使用了。


[2] 重新启动Shell,从而加载最新的环境变量。——译者注

安装完成后,请花一点时间来确保它能够正常运行。