Fixed issue where extraction library could not be run from asar.
This commit is contained in:
parent
95afe5c63a
commit
f1cf433ca8
@ -28,6 +28,7 @@ const child_process = require('child_process')
|
||||
const crypto = require('crypto')
|
||||
const EventEmitter = require('events')
|
||||
const fs = require('fs')
|
||||
const isDev = require('electron-is-dev')
|
||||
const mkpath = require('mkdirp');
|
||||
const path = require('path')
|
||||
const Registry = require('winreg')
|
||||
@ -464,7 +465,17 @@ class AssetGuard extends EventEmitter {
|
||||
*/
|
||||
static _extractPackXZ(filePaths, javaExecutable){
|
||||
return new Promise(function(fulfill, reject){
|
||||
const libPath = path.join(__dirname, '..', 'libraries', 'java', 'PackXZExtract.jar')
|
||||
let libPath
|
||||
if(isDev){
|
||||
libPath = path.join(process.cwd(), 'libraries', 'java', 'PackXZExtract.jar')
|
||||
} else {
|
||||
if(process.platform === 'darwin'){
|
||||
libPath = path.join(process.cwd(),'Contents', 'Resources', 'libraries', 'java', 'PackXZExtract.jar')
|
||||
} else {
|
||||
libPath = path.join(process.cwd(), 'resources', 'libraries', 'java', 'PackXZExtract.jar')
|
||||
}
|
||||
}
|
||||
|
||||
const filePath = filePaths.join(',')
|
||||
const child = child_process.spawn(javaExecutable, ['-jar', libPath, '-packxz', filePath])
|
||||
child.stdout.on('data', (data) => {
|
||||
|
@ -50,8 +50,10 @@ if(!isDev){
|
||||
case 'error':
|
||||
console.log('Error during update check..')
|
||||
console.debug('Error Code:', info != null ? info.code : null)
|
||||
if(err.code === 'ERR_UPDATER_INVALID_RELEASE_FEED'){
|
||||
console.log('No suitable releases found.')
|
||||
if(err != null && err.code != null){
|
||||
if(err.code === 'ERR_UPDATER_INVALID_RELEASE_FEED'){
|
||||
console.log('No suitable releases found.')
|
||||
}
|
||||
}
|
||||
break
|
||||
default:
|
||||
|
@ -95,6 +95,9 @@
|
||||
"files": [
|
||||
"!{target,logs,.vscode,docs,dev-app-update.yml}"
|
||||
],
|
||||
"extraResources": [
|
||||
"libraries"
|
||||
],
|
||||
"asar": true
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user