[FirstRun > win32] Clean up source a bit
This commit is contained in:
parent
ec5f9b4449
commit
7d00ef5082
1 changed files with 22 additions and 23 deletions
|
@ -23,6 +23,7 @@ const copyIconToRoot = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateShortcuts = (updater) => {
|
const updateShortcuts = (updater) => {
|
||||||
|
try {
|
||||||
const filename = Constants.APP_NAME_FOR_HUMANS + '.lnk';
|
const filename = Constants.APP_NAME_FOR_HUMANS + '.lnk';
|
||||||
|
|
||||||
const icon_path = copyIconToRoot();
|
const icon_path = copyIconToRoot();
|
||||||
|
@ -46,6 +47,9 @@ const updateShortcuts = (updater) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
} catch (e) {
|
||||||
|
log('FirstRun', 'Shortcuts error', e);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.performFirstRunTasks = (updater) => {
|
exports.performFirstRunTasks = (updater) => {
|
||||||
|
@ -54,12 +58,7 @@ exports.performFirstRunTasks = (updater) => {
|
||||||
const flagPath = join(paths.getUserDataVersioned(), '.first-run');
|
const flagPath = join(paths.getUserDataVersioned(), '.first-run');
|
||||||
if (fs.existsSync(flagPath)) return; // Already done, skip
|
if (fs.existsSync(flagPath)) return; // Already done, skip
|
||||||
|
|
||||||
let shortcutSuccess = false;
|
const shortcutSuccess = updateShortcuts(updater);
|
||||||
try {
|
|
||||||
shortcutSuccess = updateShortcuts(updater);
|
|
||||||
} catch (e) {
|
|
||||||
log('FirstRun', 'Error updating shortcuts', e);
|
|
||||||
}
|
|
||||||
|
|
||||||
registry.installProtocol(Constants.APP_PROTOCOL, () => {
|
registry.installProtocol(Constants.APP_PROTOCOL, () => {
|
||||||
if (!shortcutSuccess) return;
|
if (!shortcutSuccess) return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue