[Updater > v2] Catch errors in RetainAsar incase it fails for some reason
This commit is contained in:
parent
b089e48bd7
commit
c3b020f0f1
1 changed files with 6 additions and 2 deletions
|
@ -151,8 +151,12 @@ class Updater extends require('events').EventEmitter {
|
||||||
const cAsar = getAsar(cur);
|
const cAsar = getAsar(cur);
|
||||||
const nAsar = getAsar(next);
|
const nAsar = getAsar(next);
|
||||||
|
|
||||||
fs.copyFileSync(nAsar, nAsar + '.backup'); // Copy new app.asar to backup file (<new>/app.asar -> <new>/app.asar.backup)
|
try {
|
||||||
fs.copyFileSync(cAsar, nAsar); // Copy old app.asar to new app.asar (<old>/app.asar -> <new>/app.asar)
|
fs.copyFileSync(nAsar, nAsar + '.backup'); // Copy new app.asar to backup file (<new>/app.asar -> <new>/app.asar.backup)
|
||||||
|
fs.copyFileSync(cAsar, nAsar); // Copy old app.asar to new app.asar (<old>/app.asar -> <new>/app.asar)
|
||||||
|
} catch (e) {
|
||||||
|
log('Updater', 'Failed to retain OpenAsar', e);
|
||||||
|
}
|
||||||
|
|
||||||
app.once('will-quit', () => spawn(next, [], {
|
app.once('will-quit', () => spawn(next, [], {
|
||||||
detached: true,
|
detached: true,
|
||||||
|
|
Loading…
Reference in a new issue