diff --git a/plugins/single-instance/src/platform_impl/windows.rs b/plugins/single-instance/src/platform_impl/windows.rs index 9ec50edbe..ae894b41d 100644 --- a/plugins/single-instance/src/platform_impl/windows.rs +++ b/plugins/single-instance/src/platform_impl/windows.rs @@ -64,8 +64,12 @@ pub fn init(f: Box>) -> TauriPlugin { cbData: bytes.len() as _, lpData: bytes.as_ptr() as _, }; - SendMessageW(hwnd, WM_COPYDATA, 0, &cds as *const _ as _); - app.exit(0); + let contains_restart = data.split('|').any(|part| part.trim() == "restart_from_tauri_api\0"); + // Single instance mode should not cause restarted applications to exit + if !contains_restart { + SendMessageW(hwnd, WM_COPYDATA, 0, &cds as *const _ as _); + app.exit(0); + } } } } else {