Skip to content

Commit 3a4d898

Browse files
committed
Inline addition/removal to programs
1 parent 096a517 commit 3a4d898

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/cli/self_update.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -853,8 +853,6 @@ async fn maybe_install_rust(
853853
unix::do_write_env_files(process)?;
854854

855855
if !opts.no_modify_path {
856-
#[cfg(windows)]
857-
windows::do_add_to_programs(process)?;
858856
do_add_to_path(process)?;
859857
}
860858

@@ -942,8 +940,6 @@ pub(crate) fn uninstall(no_prompt: bool, process: &Process) -> Result<utils::Exi
942940

943941
// Remove CARGO_HOME/bin from PATH
944942
do_remove_from_path(process)?;
945-
#[cfg(windows)]
946-
windows::do_remove_from_programs()?;
947943

948944
// Delete everything in CARGO_HOME *except* the rustup bin
949945

src/cli/self_update/windows.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,8 @@ pub(crate) fn wait_for_parent() -> Result<()> {
456456

457457
pub(crate) fn do_add_to_path(process: &Process) -> Result<()> {
458458
let new_path = _with_path_cargo_home_bin(_add_to_path, process)?;
459-
_apply_new_path(new_path)
459+
_apply_new_path(new_path)?;
460+
do_add_to_programs(process)
460461
}
461462

462463
fn _apply_new_path(new_path: Option<Vec<u16>>) -> Result<()> {
@@ -585,7 +586,8 @@ where
585586

586587
pub(crate) fn do_remove_from_path(process: &Process) -> Result<()> {
587588
let new_path = _with_path_cargo_home_bin(_remove_from_path, process)?;
588-
_apply_new_path(new_path)
589+
_apply_new_path(new_path)?;
590+
do_remove_from_programs()
589591
}
590592

591593
const RUSTUP_UNINSTALL_ENTRY: &str = r"Software\Microsoft\Windows\CurrentVersion\Uninstall\Rustup";

0 commit comments

Comments
 (0)