fix some ui and trying to fix black window
This commit is contained in:
@@ -5,6 +5,8 @@ use tauri::AppHandle;
|
||||
use anyhow::{Result, anyhow};
|
||||
#[cfg(target_family = "unix")]
|
||||
use std::os::unix::fs::PermissionsExt;
|
||||
#[cfg(target_os = "windows")]
|
||||
use std::os::windows::process::CommandExt;
|
||||
use zip::ZipArchive;
|
||||
use std::io::Cursor;
|
||||
|
||||
@@ -104,9 +106,13 @@ pub async fn update_ytdlp(app: &AppHandle) -> Result<String> {
|
||||
}
|
||||
|
||||
// Use built-in update for yt-dlp
|
||||
let output = std::process::Command::new(&path)
|
||||
.arg("-U")
|
||||
.output()?;
|
||||
let mut cmd = std::process::Command::new(&path);
|
||||
cmd.arg("-U");
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
cmd.creation_flags(0x08000000);
|
||||
|
||||
let output = cmd.output()?;
|
||||
|
||||
if !output.status.success() {
|
||||
let stderr = String::from_utf8_lossy(&output.stderr).to_string();
|
||||
@@ -127,9 +133,13 @@ pub fn get_ytdlp_version(app: &AppHandle) -> Result<String> {
|
||||
return Ok("未安装".to_string());
|
||||
}
|
||||
|
||||
let output = std::process::Command::new(&path)
|
||||
.arg("--version")
|
||||
.output()?;
|
||||
let mut cmd = std::process::Command::new(&path);
|
||||
cmd.arg("--version");
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
cmd.creation_flags(0x08000000);
|
||||
|
||||
let output = cmd.output()?;
|
||||
|
||||
if output.status.success() {
|
||||
Ok(String::from_utf8_lossy(&output.stdout).trim().to_string())
|
||||
|
||||
Reference in New Issue
Block a user