[Poly > Yauzl] Add error dialog on missing unzip
This commit is contained in:
parent
9110fe7bba
commit
4da7c11a04
1 changed files with 6 additions and 1 deletions
|
@ -24,7 +24,7 @@ exports.open = async (zipPath, _options, callback) => {
|
||||||
|
|
||||||
mkdirSync(extractPath, { recursive: true });
|
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');
|
log('Yauzl', 'Spawned');
|
||||||
|
|
||||||
proc.stderr.on('data', (data) => {
|
proc.stderr.on('data', (data) => {
|
||||||
|
@ -32,6 +32,11 @@ exports.open = async (zipPath, _options, callback) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
proc.on('error', (err) => {
|
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);
|
errorOut(err);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue