From 4da7c11a04704e967edecd17455af35b156892e4 Mon Sep 17 00:00:00 2001 From: Oj Date: Tue, 25 Jan 2022 22:38:42 +0000 Subject: [PATCH] [Poly > Yauzl] Add error dialog on missing unzip --- polyfills/yauzl.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/polyfills/yauzl.js b/polyfills/yauzl.js index 657ccbc..82eeada 100644 --- a/polyfills/yauzl.js +++ b/polyfills/yauzl.js @@ -24,7 +24,7 @@ exports.open = async (zipPath, _options, callback) => { mkdirSync(extractPath, { recursive: true }); - const proc = execFile('unzip', ['-o', `${zipPath.replaceAll('"', '')}`, '-d', `${extractPath}`]); + const proc = execFile('unzipp', ['-o', zipPath.replaceAll('"', ''), '-d', extractPath]); log('Yauzl', 'Spawned'); proc.stderr.on('data', (data) => { @@ -32,6 +32,11 @@ exports.open = async (zipPath, _options, callback) => { }); proc.on('error', (err) => { + if (err.code === 'ENOENT') { + require('electron').dialog.showErrorBox('Failed Dependency', 'Please install "unzip", exiting'); + process.exit(1); // Close now + } + errorOut(err); });