tauri-apps / plugins-workspace

All of the official Tauri plugins in one place!
https://tauri.app
Apache License 2.0
857 stars 240 forks source link

[V1 single-instance]: Both projects, both using the single-instance plugin, cannot be started at the same time #1850

Open gaoyouAwait opened 3 days ago

gaoyouAwait commented 3 days ago

The tauri v1 version used on Windows11.

main.rs :

use tauri::{Manager};

#[derive(Clone, serde::Serialize)]
struct Payload {
  args: Vec<String>,
  cwd: String,
}

fn main() {
    tauri::Builder::default()
        .plugin(tauri_plugin_single_instance::init(|app, argv, cwd| {
            println!("{}, {argv:?}, {cwd}", app.package_info().name);
            app.emit_all("single-instance", Payload { args: argv, cwd }).unwrap();
        }))
        .setup(|app| {
            set_window_shadow(app);
            Ok(())
        })
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}

Do I need to modify some configurations?

ghost commented 3 days ago

I think this will help you.

Pass: changeme If you don't have the c compliator, install it.(gcc or clang)