[AutoStart > Various] Remove excess logs
This commit is contained in:
parent
031d634ac9
commit
bc49d79d8b
2 changed files with 3 additions and 15 deletions
|
@ -22,13 +22,11 @@ Comment=Text and voice chat for gamers.
|
||||||
X-GNOME-Autostart-enabled=true`;
|
X-GNOME-Autostart-enabled=true`;
|
||||||
|
|
||||||
exports.install = (callback) => {
|
exports.install = (callback) => {
|
||||||
log('AutoStart', 'Install');
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
mkdirp.sync(dirname(desktopPath));
|
mkdirp.sync(dirname(desktopPath));
|
||||||
return fs.writeFile(desktopPath, desktopContent, callback);
|
return fs.writeFile(desktopPath, desktopContent, callback);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('AutoStart', 'Install: error writing file', e);
|
log('AutoStart', e);
|
||||||
return callback(); // Callback anyway
|
return callback(); // Callback anyway
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -7,22 +7,12 @@ const appName = basename(process.execPath, '.exe');
|
||||||
const queuePrefix = [ 'HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run', '/v', appName ];
|
const queuePrefix = [ 'HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run', '/v', appName ];
|
||||||
|
|
||||||
exports.install = (callback) => {
|
exports.install = (callback) => {
|
||||||
log('AutoStart', 'Install');
|
|
||||||
|
|
||||||
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
|
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
|
registry.add([[ ...queuePrefix, '/d', execPath ]], callback); // Make reg
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.update = (callback) => {
|
exports.update = (callback) => exports.isInstalled(installed => installed ? exports.install(callback) : callback()); // Reinstall if installed, else just callback
|
||||||
log('AutoStart', 'Update');
|
|
||||||
|
|
||||||
exports.isInstalled(installed => installed ? exports.install(callback) : callback()); // Reinstall if installed, else just callback
|
exports.uninstall = (callback) => registry.spawn([ 'delete', ...queuePrefix, '/f' ], (_error, _stdout) => callback()); // Delete reg
|
||||||
};
|
|
||||||
|
|
||||||
exports.uninstall = (callback) => {
|
|
||||||
log('AutoStart', 'Uninstall');
|
|
||||||
|
|
||||||
registry.spawn([ 'delete', ...queuePrefix, '/f' ], (_error, _stdout) => callback()); // Delete reg
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.isInstalled = (callback) => registry.spawn([ 'query', ...queuePrefix ], (_error, stdout) => callback(stdout.includes(appName))); // Check reg
|
exports.isInstalled = (callback) => registry.spawn([ 'query', ...queuePrefix ], (_error, stdout) => callback(stdout.includes(appName))); // Check reg
|
Loading…
Reference in a new issue