Skip to content

Commit 0dbada8

Browse files
authored
EIM-325-fix-python-version-install-on-windows (#238)
1 parent afefff5 commit 0dbada8

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

src-tauri/src/cli/prompts.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,15 +136,15 @@ pub fn check_and_install_python(
136136
if std::env::consts::OS == "windows" {
137137
info!("{}", t!("python.sanitycheck.fail"));
138138
let res = if !install_all_prerequisites && !non_interactive {
139-
generic_confirm("pythhon.install.prompt")
139+
generic_confirm("python.install.prompt")
140140
} else if install_all_prerequisites {
141141
Ok(true)
142142
} else {
143143
Ok(false)
144144
};
145145

146146
if res.map_err(|e| e.to_string())? {
147-
system_dependencies::install_prerequisites(vec!["[email protected]".to_string()])
147+
system_dependencies::install_prerequisites(vec!["python313".to_string()])
148148
.map_err(|e| e.to_string())?;
149149
let scp = system_dependencies::get_scoop_path();
150150
let usable_python = match scp {

src-tauri/src/lib/system_dependencies.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,33 @@ fn install_scoop_package_manager() -> Result<(), String> {
436436
trace!("output: {}", o);
437437
debug!("Successfully installed Scoop package manager. Adding to PATH");
438438
add_to_path(&path_with_scoop).unwrap();
439+
let output = command_executor::execute_command(
440+
"powershell",
441+
&[
442+
"-ExecutionPolicy",
443+
"Bypass",
444+
"-Command",
445+
"scoop",
446+
"bucket",
447+
"add",
448+
"versions"
449+
],
450+
);
451+
match output {
452+
Ok(o) => {
453+
if o.status.success() {
454+
debug!("Successfully added versions bucket to scoop");
455+
} else {
456+
let output = String::from_utf8(o.stdout).unwrap();
457+
let error_message = String::from_utf8(o.stderr).unwrap();
458+
debug!("Failed to add versions bucket to scoop: {}", error_message);
459+
debug!("Output: {}", output);
460+
}
461+
}
462+
Err(e) => {
463+
debug!("Failed to add versions bucket to scoop: {}", e);
464+
}
465+
}
439466
Ok(())
440467
}
441468
Err(e) => Err(e.to_string()),

0 commit comments

Comments
 (0)