1
- import { join } from 'path' ;
1
+ import { join , dirname } from 'path' ;
2
2
import fs from 'node:fs' ;
3
3
import { spawn } from 'child_process' ;
4
4
import { app , BrowserWindow , ipcMain } from 'electron' ;
@@ -196,6 +196,7 @@ export async function launchExplorer(event: Electron.IpcMainInvokeEvent, version
196
196
analytics . track ( ANALYTICS_EVENT . LAUNCH_CLIENT_START , { version : versionData . version } ) ;
197
197
198
198
const explorerBinPath = getExplorerBinPath ( version ) ;
199
+ const explorerBinDir = dirname ( explorerBinPath ) ;
199
200
200
201
if ( ! fs . existsSync ( explorerBinPath ) ) {
201
202
const errorMessage = version ? `The explorer version specified: ${ version } is not installed.` : 'The explorer is not installed.' ;
@@ -221,7 +222,7 @@ export async function launchExplorer(event: Electron.IpcMainInvokeEvent, version
221
222
analytics . getSessionId ( ) ,
222
223
] . filter ( arg => ! ! arg ) ;
223
224
log . info ( '[Main Window][IPC][LaunchExplorer] Opening the Explorer' , explorerParams ) ;
224
- spawn ( explorerBinPath , explorerParams , { detached : true , stdio : 'ignore' } )
225
+ spawn ( explorerBinPath , explorerParams , { cwd : explorerBinDir , detached : true , stdio : 'ignore' } )
225
226
. on ( 'spawn' , async ( ) => {
226
227
event . sender . send ( IPC_EVENTS . LAUNCH_EXPLORER , { type : IPC_EVENT_DATA_TYPE . LAUNCHED } ) ;
227
228
await analytics . track ( ANALYTICS_EVENT . LAUNCH_CLIENT_SUCCESS , { version : versionData . version } ) ;
0 commit comments