Fixed an issue where the shortcut wouldn't update.

This commit is contained in:
Quentin Decaunes 2019-03-08 09:01:15 +01:00
parent e3a84c0feb
commit 0dcf344c0f
2 changed files with 11 additions and 13 deletions

View File

@ -294,18 +294,16 @@ function recreateShortcut() {
let fs = require('fs');
try {
var shortcut_path = app.getPath('desktop') + "\\Ryzen Controller";
if (!fs.existsSync(shortcut_path)) {
fs.unlink(shortcut_path, console.log);
fs.symlink(app.getPath('exe'), shortcut_path, function (err) {
if (err) {
notification("danger", "Shortcut can't be created, please check log tabs for more info.");
appendLog(`recreateShortcut(): ${err}`);
}
else {
notification('primary', "A shortcut has been created on desktop.");
}
});
}
fs.unlink(shortcut_path, console.log);
fs.symlink(app.getPath('exe'), shortcut_path, function (err) {
if (err) {
notification("danger", "Shortcut can't be created, please check log tabs for more info.");
appendLog(`recreateShortcut(): ${err}`);
}
else {
notification('primary', "A shortcut has been created on desktop.");
}
});
} catch (error) {
appendLog(`recreateShortcut() ${error}`);
}

View File

@ -1,7 +1,7 @@
{
"name": "ryzencontroller",
"productName": "RyzenController",
"version": "1.6.0",
"version": "1.6.1",
"description": "A minimal Electron application to use ryzenAdj through a friendly interface.",
"main": "main.js",
"scripts": {