[FirstRun > win32] Minor source cleanup
This commit is contained in:
parent
e1330cc6bf
commit
2ed61b67f6
1 changed files with 10 additions and 10 deletions
|
@ -24,27 +24,28 @@ const copyIconToRoot = () => {
|
||||||
|
|
||||||
const updateShortcuts = (updater) => {
|
const updateShortcuts = (updater) => {
|
||||||
const filename = Constants.APP_NAME_FOR_HUMANS + '.lnk';
|
const filename = Constants.APP_NAME_FOR_HUMANS + '.lnk';
|
||||||
const paths = [
|
|
||||||
|
const icon_path = copyIconToRoot();
|
||||||
|
|
||||||
|
for (const shortcut_path of [
|
||||||
join(updater.getKnownFolder('desktop'), filename),
|
join(updater.getKnownFolder('desktop'), filename),
|
||||||
join(updater.getKnownFolder('programs'), Constants.APP_COMPANY, filename)
|
join(updater.getKnownFolder('programs'), Constants.APP_COMPANY, filename)
|
||||||
];
|
]) {
|
||||||
|
|
||||||
const icon = copyIconToRoot();
|
|
||||||
|
|
||||||
for (const path of paths) {
|
|
||||||
if (!fs.existsSync(path)) continue; // Don't update already deleted paths
|
if (!fs.existsSync(path)) continue; // Don't update already deleted paths
|
||||||
|
|
||||||
updater.createShortcut({
|
updater.createShortcut({
|
||||||
target_path: join(rootPath, 'Update.exe'),
|
target_path: join(rootPath, 'Update.exe'),
|
||||||
shortcut_path: path,
|
shortcut_path,
|
||||||
arguments: '--processStart ' + basename(process.execPath),
|
arguments: '--processStart ' + basename(process.execPath),
|
||||||
icon_path: icon,
|
icon_path,
|
||||||
icon_index: 0,
|
icon_index: 0,
|
||||||
description: Constants.APP_DESCRIPTION,
|
description: Constants.APP_DESCRIPTION,
|
||||||
app_user_model_id: Constants.APP_ID,
|
app_user_model_id: Constants.APP_ID,
|
||||||
working_directory: appPath
|
working_directory: appPath
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.performFirstRunTasks = (updater) => {
|
exports.performFirstRunTasks = (updater) => {
|
||||||
|
@ -55,8 +56,7 @@ exports.performFirstRunTasks = (updater) => {
|
||||||
|
|
||||||
let shortcutSuccess = false;
|
let shortcutSuccess = false;
|
||||||
try {
|
try {
|
||||||
updateShortcuts(updater);
|
shortcutSuccess = updateShortcuts(updater);
|
||||||
shortcutSuccess = true;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('FirstRun', 'Error updating shortcuts', e);
|
log('FirstRun', 'Error updating shortcuts', e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue