Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/cli/self_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,12 @@ mod windows;
#[cfg(windows)]
pub use windows::complete_windows_uninstall;
#[cfg(all(windows, feature = "test"))]
pub use windows::{RegistryGuard, RegistryValueId, USER_PATH, get_path};
pub use windows::{
RUSTUP_TEST_REGISTRY_UUID, RegistryGuard, RegistryValueId, USER_PATH, get_path,
test_registry_uuid,
};
#[cfg(windows)]
use windows::{do_add_to_path, do_remove_from_path};
use windows::{do_add_to_path, do_add_to_programs, do_remove_from_path, do_remove_from_programs};
#[cfg(windows)]
pub(crate) use windows::{run_update, self_replace};

Expand Down Expand Up @@ -1010,6 +1013,9 @@ async fn maybe_install_rust(opts: InstallOpts<'_>, cfg: &mut Cfg<'_>) -> Result<
do_add_to_path(cfg.process)?;
}

#[cfg(windows)]
do_add_to_programs(cfg.process)?;

// If RUSTUP_HOME is not set, make sure it exists
if cfg.process.var_os("RUSTUP_HOME").is_none() {
let home = cfg
Expand Down Expand Up @@ -1159,6 +1165,9 @@ fn clean_cargo_home(no_modify_path: bool, process: &Process) -> Result<()> {

utils::remove_file("rustup_bin", &rustup_path)?;

#[cfg(windows)]
do_remove_from_programs()?;

let cargo_bin_display = cargo_bin.display();
info!("removing empty cargo bin directory `{cargo_bin_display}`");

Expand Down
Loading
Loading