updater: rewrite openasar retaining

This commit is contained in:
Ducko 2022-12-11 12:36:41 +00:00
parent 78b49c092c
commit edb6a5b4fe

View file

@ -147,9 +147,8 @@ class Updater extends require('events').EventEmitter {
// Retain OpenAsar
const fs = require('original-fs');
const getAsar = (p) => join(p, '..', 'resources', 'app.asar');
const cAsar = getAsar(cur);
const nAsar = getAsar(next);
const cAsar = join(require.main.filename, '..');
const nAsar = join(next, '..', 'resources', 'app.asar');
try {
fs.copyFileSync(nAsar, nAsar + '.backup'); // Copy new app.asar to backup file (<new>/app.asar -> <new>/app.asar.backup)