mirror of
https://github.com/dathere/qsv-easy-windows-installer.git
synced 2025-12-19 08:39:24 +00:00
chore: remove version info
This commit is contained in:
parent
f776d7f293
commit
1463a3675b
2 changed files with 2 additions and 7 deletions
|
|
@ -5,7 +5,7 @@ use tempfile::tempfile;
|
||||||
use winreg::{enums::HKEY_CURRENT_USER, RegKey};
|
use winreg::{enums::HKEY_CURRENT_USER, RegKey};
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
async fn run_path_update(app_handle: tauri::AppHandle) -> String {
|
async fn run_path_update(app_handle: tauri::AppHandle) {
|
||||||
// Get app local data dir path
|
// Get app local data dir path
|
||||||
let app_local_data_dir = app_handle.path().app_local_data_dir().unwrap();
|
let app_local_data_dir = app_handle.path().app_local_data_dir().unwrap();
|
||||||
// Download qsv to bin dir if it doesn't exist and overwrite any existing qsv
|
// Download qsv to bin dir if it doesn't exist and overwrite any existing qsv
|
||||||
|
|
@ -40,6 +40,7 @@ async fn run_path_update(app_handle: tauri::AppHandle) -> String {
|
||||||
// Write qsvp.exe to bin/qsv.exe
|
// Write qsvp.exe to bin/qsv.exe
|
||||||
let mut qsv_file = std::fs::File::create(bin_dir.join("qsv.exe")).unwrap();
|
let mut qsv_file = std::fs::File::create(bin_dir.join("qsv.exe")).unwrap();
|
||||||
std::io::copy(&mut qsvp, &mut qsv_file).unwrap();
|
std::io::copy(&mut qsvp, &mut qsv_file).unwrap();
|
||||||
|
drop(qsv_file);
|
||||||
// Add the bin dir to PATH
|
// Add the bin dir to PATH
|
||||||
let bin_dir_str = bin_dir.to_str().unwrap();
|
let bin_dir_str = bin_dir.to_str().unwrap();
|
||||||
// Get the current PATH
|
// Get the current PATH
|
||||||
|
|
@ -51,8 +52,6 @@ async fn run_path_update(app_handle: tauri::AppHandle) -> String {
|
||||||
let updated_path_var = format!("{bin_dir_str};{path_var}");
|
let updated_path_var = format!("{bin_dir_str};{path_var}");
|
||||||
reg_key.set_value("Path", &updated_path_var).unwrap();
|
reg_key.set_value("Path", &updated_path_var).unwrap();
|
||||||
}
|
}
|
||||||
drop(qsv_file);
|
|
||||||
String::from_utf8(std::process::Command::new(bin_dir.join("qsv.exe")).arg("--version").output().unwrap().stdout).unwrap()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||||
|
|
|
||||||
|
|
@ -23,10 +23,6 @@ function App() {
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
invoke("run_path_update")
|
invoke("run_path_update")
|
||||||
.then((message) => {
|
|
||||||
setLoading(false);
|
|
||||||
alert("Successfully installed qsv. Try opening a new terminal and run a qsv command! Version info: " + message);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue