@@ -72,13 +72,12 @@ fn spawn_bridge_process(app_handle: &AppHandle) -> Result<Child, String> {
7272 }
7373 }
7474
75- // 3) Try exe directory (where the .exe is located)
75+ // 3) Try exe directory (where the executable is located - works for deb/appimage on Linux )
7676 if let Some ( exe_dir) = get_exe_dir ( ) {
77- if let Some ( child) = try_exe_dir_scripts ( & exe_dir) {
77+ if let Some ( child) = try_exe_dir_binary ( & exe_dir) {
7878 return Ok ( child) ;
7979 }
80- #[ cfg( target_os = "windows" ) ]
81- if let Some ( child) = try_exe_dir_binary ( & exe_dir) {
80+ if let Some ( child) = try_exe_dir_scripts ( & exe_dir) {
8281 return Ok ( child) ;
8382 }
8483 }
@@ -180,14 +179,15 @@ fn try_exe_dir_scripts(exe_dir: &Path) -> Option<Child> {
180179 None
181180}
182181
183- # [ cfg ( target_os = "windows" ) ]
182+ /// Try to find and spawn bridge binary in the exe directory (for Linux deb/appimage and Windows)
184183fn try_exe_dir_binary ( exe_dir : & Path ) -> Option < Child > {
185- let paths = [
186- exe_dir . join ( "bridge.exe" ) ,
187- exe_dir . join ( "_up_" ) . join ( "bridge.exe" ) ,
188- ] ;
184+ # [ cfg ( target_os = "windows" ) ]
185+ let binary_names = [ "bridge.exe" , "_up_/bridge.exe" ] ;
186+ # [ cfg ( not ( target_os = "windows" ) ) ]
187+ let binary_names = [ "bridge" , "_up_/bridge" ] ;
189188
190- for exe_path in & paths {
189+ for name in binary_names {
190+ let exe_path = exe_dir. join ( name) ;
191191 if exe_path. exists ( ) {
192192 if let Some ( exe_str) = exe_path. to_str ( ) {
193193 if let Ok ( c) = try_spawn ( exe_str, & [ ] ) {
0 commit comments