[FirstRun > win32] Minor rewrite
This commit is contained in:
parent
bc49d79d8b
commit
f8c5c3e0cf
1 changed files with 5 additions and 13 deletions
|
@ -7,23 +7,15 @@ const Constants = require('../Constants');
|
|||
const appPath = resolve(process.execPath, '..');
|
||||
const rootPath = resolve(appPath, '..');
|
||||
|
||||
const rootIcon = () => {
|
||||
const c = join(appPath, 'app.ico'); // Current
|
||||
const n = join(rootPath, 'app.ico'); // New
|
||||
|
||||
try {
|
||||
fs.copyFileSync(c, n);
|
||||
return n;
|
||||
} catch (e) {
|
||||
log('FirstRun', e);
|
||||
return c;
|
||||
}
|
||||
};
|
||||
|
||||
const updateShortcuts = (updater) => {
|
||||
try {
|
||||
const file = Constants.APP_NAME_FOR_HUMANS + '.lnk';
|
||||
const icon_path = rootIcon();
|
||||
const icon_Path = join(rootPath, 'app.ico');
|
||||
|
||||
try {
|
||||
fs.copyFileSync(join(appPath, 'app.ico'), icon_path);
|
||||
} catch { }
|
||||
|
||||
for (const shortcut_path of [
|
||||
join(updater.getKnownFolder('desktop'), file),
|
||||
|
|
Loading…
Reference in a new issue