[AutoStart > win32] Minor source cleanup

This commit is contained in:
Ducko 2022-04-05 14:13:31 +01:00
parent 133cf280e4
commit b067853371

View file

@ -3,15 +3,13 @@ const { join, basename, dirname } = require('path');
const registry = require('../utils/registry');
const appName = basename(process.execPath, '.exe');
const fullExeName = basename(process.execPath);
const updatePath = join(dirname(process.execPath), '..', 'Update.exe');
const queuePrefix = [ 'HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run', '/v', appName ];
exports.install = (callback) => {
log('AutoStart', 'Install');
const execPath = `${updatePath} --processStart ${fullExeName}` + (settings.get('START_MINIMIZED', false) ? ' --process-start-args --start-minimized' : ''); // Add Electron args if start minimized on
const execPath = join(dirname(process.execPath), '..', 'Update.exe') + ` --processStart ${basename(process.execPath)}` + (settings.get('START_MINIMIZED', false) ? ' --process-start-args --start-minimized' : ''); // Add Electron args if start minimized on
registry.add([[ ...queuePrefix, '/d', execPath ]], callback); // Make reg
};