electron-squirrel-startup icon indicating copy to clipboard operation
electron-squirrel-startup copied to clipboard

Created shortcut is targeted to the wrong directory

Open Sanderttt opened this issue 8 years ago • 7 comments

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

Sanderttt avatar Apr 18 '17 15:04 Sanderttt

This also happens to me.

fodra avatar Oct 30 '17 04:10 fodra

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 avatar Nov 07 '17 23:11 jpiepkow

@jpiepkow You Rock! It' seems odd to me that this issue has not been resolved, the default settings for this package create broken shortcuts.

jdheeter avatar Apr 09 '18 17:04 jdheeter

+1

Fourie-r avatar Nov 04 '19 16:11 Fourie-r

I fixed it by replacing: var target = path.basename(process.execPath); (line 18) with: var target = process.execPath;

ViciousIXIL avatar Dec 18 '19 13:12 ViciousIXIL

Does this will be fixed ?

jbpin avatar Feb 03 '20 10:02 jbpin

I fixed it by replacing: var target = path.basename(process.execPath); (line 18) with: var target = process.execPath;

This worked for me

Take-A-Byte avatar Nov 20 '21 13:11 Take-A-Byte