Skip to content

Commit cb5ef1d

Browse files
committed
check that app is installed / unpacked
1 parent 78a7dcb commit cb5ef1d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,12 @@ app.on("ready", () => {
255255
}, 20000);
256256
}
257257

258+
const appLocation = process.execPath;
259+
258260
// Register shortcut & appID on windows
259-
if (!is.dev() && is.windows()) {
261+
if (is.windows() && !is.dev() && !appLocation.startsWith(path.join(app.getPath("appData"), "..", "Local", "Temp"))) {
260262
const appID = "com.github.th-ch.youtube-music";
261263
const shortcutPath = path.join(app.getPath("appData"), "Microsoft", "Windows", "Start Menu", "Programs", "YouTube Music.lnk");
262-
const appLocation = process.execPath;
263264
try { // check if shortcut is registered and valid
264265
const shortcutDetails = electron.shell.readShortcutLink(shortcutPath); // throw error if doesn't exist yet
265266
if (shortcutDetails.target !== appLocation || shortcutDetails.appUserModelId !== appID) {

0 commit comments

Comments
 (0)