[AutoStart > Various] Add logging on export call
This commit is contained in:
parent
9bd97701d5
commit
5a40e4eee8
2 changed files with 12 additions and 0 deletions
|
@ -25,6 +25,8 @@ X-GNOME-Autostart-enabled=true
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports.install = (callback) => {
|
exports.install = (callback) => {
|
||||||
|
log('AutoStart', 'Install');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
fs.mkdirSync(autostartDir);
|
fs.mkdirSync(autostartDir);
|
||||||
} catch (_e) { } // Already exists, ignore
|
} catch (_e) { } // Already exists, ignore
|
||||||
|
@ -38,10 +40,14 @@ exports.install = (callback) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.update = (callback) => { // Discord has stub here
|
exports.update = (callback) => { // Discord has stub here
|
||||||
|
log('AutoStart', 'Update');
|
||||||
|
|
||||||
callback();
|
callback();
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.uninstall = (callback) => {
|
exports.uninstall = (callback) => {
|
||||||
|
log('AutoStart', 'Uninstall');
|
||||||
|
|
||||||
return fs.unlink(desktopPath, callback);
|
return fs.unlink(desktopPath, callback);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,8 @@ const fullExeName = path.basename(process.execPath);
|
||||||
const updatePath = path.join(path.dirname(process.execPath), '..', 'Update.exe');
|
const updatePath = path.join(path.dirname(process.execPath), '..', 'Update.exe');
|
||||||
|
|
||||||
exports.install = (callback) => {
|
exports.install = (callback) => {
|
||||||
|
log('AutoStart', 'Install');
|
||||||
|
|
||||||
let execPath = `${updatePath} --processStart ${fullExeName}`;
|
let execPath = `${updatePath} --processStart ${fullExeName}`;
|
||||||
|
|
||||||
if (settings.get('START_MINIMIZED', false)) { // If start minimized enabled, pass it to Electron via --process-start-args
|
if (settings.get('START_MINIMIZED', false)) { // If start minimized enabled, pass it to Electron via --process-start-args
|
||||||
|
@ -21,12 +23,16 @@ exports.install = (callback) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.update = (callback) => {
|
exports.update = (callback) => {
|
||||||
|
log('AutoStart', 'Update');
|
||||||
|
|
||||||
exports.isInstalled(installed => installed ? exports.install(callback) : callback()); // Reinstall if installed, else leave it (just callback)
|
exports.isInstalled(installed => installed ? exports.install(callback) : callback()); // Reinstall if installed, else leave it (just callback)
|
||||||
|
|
||||||
retainAsar(); // Retain OpenAsar
|
retainAsar(); // Retain OpenAsar
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.uninstall = (callback) => {
|
exports.uninstall = (callback) => {
|
||||||
|
log('AutoStart', 'Uninstall');
|
||||||
|
|
||||||
windowsUtils.spawnReg(['delete', 'HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run', '/v', appName, '/f'], (_error, _stdout) => { // Delete reg
|
windowsUtils.spawnReg(['delete', 'HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run', '/v', appName, '/f'], (_error, _stdout) => { // Delete reg
|
||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue