Skip to content

Commit

Permalink
fix: check if executable no exists and report that error (#59)
Browse files Browse the repository at this point in the history
* fix: check if executable no exists and report that error

* update version
  • Loading branch information
kuruk-mm authored Apr 26, 2022
1 parent 51d6ca4 commit 634ecb1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
22 changes: 13 additions & 9 deletions electron/updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,19 @@ const registerExecuteProcessEvent = (rendererPath: string, executablePath: strin

console.log(`Execute path: ${path} params: ${params}`)

const { execFile } = require('child_process')
if (getOSName() === 'mac') {
params = ['-W', path, '--args', ...params]
execFile('open', params, onProcessFinish)
if (fs.existsSync(path)) {
const { execFile } = require('child_process')
if (getOSName() === 'mac') {
params = ['-W', path, '--args', ...params]
execFile('open', params, onProcessFinish)
} else {
execFile(path, params, onProcessFinish)
}

ipcMain.emit('on-open-renderer', event)
} else {
execFile(path, params, onProcessFinish)
await reportFatalError(event.sender, `Renderer not found: ${path}`)
}

ipcMain.emit('on-open-renderer', event)
} catch (e) {
console.error('Execute error: ', e)
await reportFatalError(event.sender, JSON.stringify(e))
Expand Down Expand Up @@ -198,13 +202,13 @@ const registerDownloadEvent = (win: BrowserWindow, launcherPaths: LauncherPaths)
const path = branchPath + launcherPaths.versionPath

fs.writeFileSync(path, JSON.stringify(versionData))

event.sender.send('downloadState', { type: 'READY' })
})
}
})
console.log('Res: ', res)
console.log('Done!')

event.sender.send('downloadState', { type: 'READY' })
})
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "explorer-desktop-launcher",
"version": "0.1.36",
"version": "0.1.37",
"author": "decentraland",
"description": "Decentraland Desktop Launcher",
"homepage": ".",
Expand Down

0 comments on commit 634ecb1

Please sign in to comment.