Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created shortcut is targeted to the wrong directory #30

Open
Sanderttt opened this issue Apr 18, 2017 · 7 comments
Open

Created shortcut is targeted to the wrong directory #30

Sanderttt opened this issue Apr 18, 2017 · 7 comments

Comments

@Sanderttt
Copy link

Sanderttt commented Apr 18, 2017

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: Squirrel/Squirrel.Windows#900

Any help would be appreciated

@fodra
Copy link

fodra commented Oct 30, 2017

This also happens to me.

@jpiepkow
Copy link

jpiepkow commented Nov 7, 2017

put a pull request together to try and fix this.

#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.

@jdheeter
Copy link

jdheeter commented Apr 9, 2018

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

@Fourie-r
Copy link

Fourie-r commented Nov 4, 2019

+1

@ViciousIXIL
Copy link

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

@jbpin
Copy link

jbpin commented Feb 3, 2020

Does this will be fixed ?

@Take-A-Byte
Copy link

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

This worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants