electron-squirrel-startup
electron-squirrel-startup copied to clipboard
Created shortcut is targeted to the wrong directory
The created shortcut to my electron app is not working because it's pointing to the wrong directory
Properties of the desktop shortcut: Target: C:\Users\Win10H64\AppData\Local{app_name}}\dist.exe Start in: C:\Users\Win10H64\AppData\Local{app_name}}\app-0.0.1 The dir where the exe resides: C:\Users\Win10H64\AppData\Local{app_name}}\app-0.0.1\dist.exe
I'm using the following: electron: 1.4.15 electron-packager: 8.5.1 electron-winstaller: 2.5.2 electron-squirrel-startup: 1.0.0
I'm guessing that electron-squirrel-startup is the culprit in this issue. I found something similar here: https://github.com/Squirrel/Squirrel.Windows/issues/900
Any help would be appreciated
This also happens to me.
put a pull request together to try and fix this.
https://github.com/mongodb-js/electron-squirrel-startup/pull/34
for now I pull all the functions out into my main.js and set target to something like this:
path.resolve(path.dirname(process.execPath),'..',app-${package.version},path.basename(process.execPath))
this may be different for you though depending but thats why the pull request above will let you pass in your own path.
@jpiepkow You Rock! It' seems odd to me that this issue has not been resolved, the default settings for this package create broken shortcuts.
+1
I fixed it by replacing:
var target = path.basename(process.execPath); (line 18)
with:
var target = process.execPath;
Does this will be fixed ?
I fixed it by replacing:
var target = path.basename(process.execPath);(line 18) with:var target = process.execPath;
This worked for me