[FirstRun > win32] Minor rewrite
This commit is contained in:
parent
bc49d79d8b
commit
f8c5c3e0cf
|
@ -7,23 +7,15 @@ const Constants = require('../Constants');
|
||||||
const appPath = resolve(process.execPath, '..');
|
const appPath = resolve(process.execPath, '..');
|
||||||
const rootPath = resolve(appPath, '..');
|
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) => {
|
const updateShortcuts = (updater) => {
|
||||||
try {
|
try {
|
||||||
const file = Constants.APP_NAME_FOR_HUMANS + '.lnk';
|
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 [
|
for (const shortcut_path of [
|
||||||
join(updater.getKnownFolder('desktop'), file),
|
join(updater.getKnownFolder('desktop'), file),
|
||||||
|
|
Loading…
Reference in New Issue