mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-14 11:51:47 +00:00
check that app is installed / unpacked
This commit is contained in:
5
index.js
5
index.js
@ -255,11 +255,12 @@ app.on("ready", () => {
|
|||||||
}, 20000);
|
}, 20000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const appLocation = process.execPath;
|
||||||
|
|
||||||
// Register shortcut & appID on windows
|
// Register shortcut & appID on windows
|
||||||
if (!is.dev() && is.windows()) {
|
if (is.windows() && !is.dev() && !appLocation.startsWith(path.join(app.getPath("appData"), "..", "Local", "Temp"))) {
|
||||||
const appID = "com.github.th-ch.youtube-music";
|
const appID = "com.github.th-ch.youtube-music";
|
||||||
const shortcutPath = path.join(app.getPath("appData"), "Microsoft", "Windows", "Start Menu", "Programs", "YouTube Music.lnk");
|
const shortcutPath = path.join(app.getPath("appData"), "Microsoft", "Windows", "Start Menu", "Programs", "YouTube Music.lnk");
|
||||||
const appLocation = process.execPath;
|
|
||||||
try { // check if shortcut is registered and valid
|
try { // check if shortcut is registered and valid
|
||||||
const shortcutDetails = electron.shell.readShortcutLink(shortcutPath); // throw error if doesn't exist yet
|
const shortcutDetails = electron.shell.readShortcutLink(shortcutPath); // throw error if doesn't exist yet
|
||||||
if (shortcutDetails.target !== appLocation || shortcutDetails.appUserModelId !== appID) {
|
if (shortcutDetails.target !== appLocation || shortcutDetails.appUserModelId !== appID) {
|
||||||
|
|||||||
Reference in New Issue
Block a user