FIX 3 van de Windows:
1. LOAD CHAM: PyInstaller onefile 723MB giai nen toan bo vao %TEMP% moi lan chay -> chuyen ONEDIR (engine.spec COLLECT) + bundle qua Tauri resources (resource_dir/daw_engine/daw_engine.exe) thay externalBin — khoi dong tuc thi khong giai nen
2. WINDOW PICKER: Tauri v2 khong co window.__TAURI__.dialog — goi invoke('plugin:dialog|open', {options:{directory:true}}) qua __TAURI__.core.invoke
3. ICON exe: bundle.icon chuyen icon.ico -> favicon.ico + thay 3 PNG bang favicon render
- build_windows.ps1 buoc 4: copy onedir dist/daw_engine -> src-tauri/resources/daw_engine
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 1009 B After Width: | Height: | Size: 18 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 49 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 459 B After Width: | Height: | Size: 2.2 KiB |
+15
-7
@@ -12,15 +12,23 @@ pub fn run() {
|
||||
.plugin(tauri_plugin_shell::init())
|
||||
.plugin(tauri_plugin_dialog::init())
|
||||
.setup(|app| {
|
||||
// 1. Spawn sidecar daw_engine.exe (PyInstaller bundle)
|
||||
let sidecar_command = app
|
||||
.shell()
|
||||
.sidecar("daw_engine")
|
||||
.expect("sidecar daw_engine not found — run build_windows.ps1 first");
|
||||
let (_rx, child) = sidecar_command
|
||||
// 1. Spawn daw_engine (PyInstaller ONEDIR bundle — khong giai nen
|
||||
// moi lan chay nhu onefile, khoi dong nhanh). Bundle qua Tauri
|
||||
// resources: resource_dir()/daw_engine/daw_engine(.exe)
|
||||
let res_dir = app
|
||||
.path()
|
||||
.resource_dir()
|
||||
.expect("resource dir not found");
|
||||
let engine_dir = res_dir.join("daw_engine");
|
||||
let engine_exe = if cfg!(windows) {
|
||||
engine_dir.join("daw_engine.exe")
|
||||
} else {
|
||||
engine_dir.join("daw_engine")
|
||||
};
|
||||
let (_rx, child) = tauri_plugin_shell::process::Command::new(engine_exe)
|
||||
.env("SF_PARENT_PID", std::process::id().to_string())
|
||||
.spawn()
|
||||
.expect("Failed to spawn daw_engine sidecar");
|
||||
.expect("Failed to spawn daw_engine (onedir resource) — run build_windows.ps1 first");
|
||||
|
||||
app.manage(EngineProcess(Mutex::new(Some(child))));
|
||||
println!("Python Background Engine started (localhost:8000, auto-fallback 8000-8010)");
|
||||
|
||||
@@ -30,11 +30,12 @@
|
||||
"icons/32x32.png",
|
||||
"icons/128x128.png",
|
||||
"icons/128x128@2x.png",
|
||||
"icons/icon.ico"
|
||||
"icons/favicon.ico"
|
||||
],
|
||||
"externalBin": [
|
||||
"binaries/daw_engine"
|
||||
"resources": [
|
||||
"resources/daw_engine/**"
|
||||
],
|
||||
"externalBin": [],
|
||||
"windows": {
|
||||
"nsis": {
|
||||
"installerHooks": "hooks.nsh"
|
||||
|
||||
Reference in New Issue
Block a user