🐛 修复启动应用
This commit is contained in:
@@ -11,12 +11,23 @@ pub async fn check_is_installed(pkgname: String) -> Result<bool, String> {
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn launch_app(pkgname: String) -> Result<(), String> {
|
||||
pub async fn check_launch_app(pkgname: String) -> Result<bool, String> {
|
||||
let output = Command::new("/opt/durapps/spark-store/bin/store-helper/ss-launcher")
|
||||
.arg("check")
|
||||
.arg(&pkgname)
|
||||
.output()
|
||||
.map_err(|e| format!("启动应用失败: {}", e))?;
|
||||
|
||||
Ok(output.status.success())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn launch_launch_app(pkgname: String) -> Result<(), String> {
|
||||
Command::new("/opt/durapps/spark-store/bin/store-helper/ss-launcher")
|
||||
.arg("launch")
|
||||
.arg(&pkgname)
|
||||
.spawn()
|
||||
.map_err(|e| format!("启动应用失败: {}", e))?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
}
|
||||
@@ -31,7 +31,8 @@ pub fn run() {
|
||||
handlers::download::resume_download,
|
||||
handlers::download::cancel_download,
|
||||
handlers::deb::check_is_installed,
|
||||
handlers::deb::launch_app,
|
||||
handlers::deb::check_launch_app,
|
||||
handlers::deb::launch_launch_app,
|
||||
utils::get_user_agent,
|
||||
])
|
||||
.on_window_event(|window, event| match event {
|
||||
|
||||
Reference in New Issue
Block a user