aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.dev-suite/ticket/closed/ds-install-wipes-user-path-on-windows.toml (renamed from .dev-suite/ticket/open/ds-install-wipes-user-path-on-windows.toml)2
-rw-r--r--src/main.rs7
2 files changed, 5 insertions, 4 deletions
diff --git a/.dev-suite/ticket/open/ds-install-wipes-user-path-on-windows.toml b/.dev-suite/ticket/closed/ds-install-wipes-user-path-on-windows.toml
index 73876b5..eb168e9 100644
--- a/.dev-suite/ticket/open/ds-install-wipes-user-path-on-windows.toml
+++ b/.dev-suite/ticket/closed/ds-install-wipes-user-path-on-windows.toml
@@ -1,5 +1,5 @@
title = 'ds install wipes user PATH on Windows'
-status = 'Open'
+status = 'Closed'
id = 'a2448280-2f41-11ea-b9b7-55d06c658ffe'
assignees = []
description = '''
diff --git a/src/main.rs b/src/main.rs
index a1450dc..8f5557d 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -220,9 +220,10 @@ fn install() -> Result<()> {
#[cfg(target_os = "windows")]
{
println!("Adding {} to your %PATH%", location.display());
- let mut location = location.into_os_string();
- location.push(";%PATH%");
- let _ = Command::new("setx").arg("PATH").arg(&location).output()?;
+ let mut command = std::ffi::OsStr::new("setx PATH ").to_os_string();
+ command.push(location.into_os_string());
+ command.push(";%PATH%");
+ let _ = Command::new("cmd").arg("/C").arg(command).output()?;
println!("You'll need to restart your computer for the %PATH% changes to take effect");
}
println!("Installation complete");