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

getAppPath and getAppExec return incorrectly on mac #73

Open
brian-mann opened this issue Feb 19, 2015 · 7 comments
Open

getAppPath and getAppExec return incorrectly on mac #73

brian-mann opened this issue Feb 19, 2015 · 7 comments

Comments

@brian-mann
Copy link
Contributor

I'm on mac 64 bit.

When I run upd.getAppPath() and upd.getAppExec() they both return /Users

I don't understand this line of code:

https://github.com/edjafarov/node-webkit-updater/blob/master/app/updater.js#L113

Why the ../../.. ? Why wouldn't process.cwd() be adequate?

The ../../.. is what causes the path to walk up out of my project's directory and all the way down to /Users.

@felicienfrancois
Copy link

I tried several ways of launching nwjs (double clicking, open -a, Contents/MacOs/nwjs, ...) and in all cases process.cwd() returns the app directory, where the package.json.

So in my case, where files are in the myapp.app/Contents/Resources/app.nw directory, it works well with ../../.. because it need to go up three times to get root app directory.

But this may be wrong in the following cases:

  • Launching app from open -a nwjs /path/to/the/app/directory or nwjs/Contents/MacOS/nwjs /path/to/the/app/directory. But this case is mostly used in dev environnement and may not be supported by node-webkit-updater, as node-webkit-updater intends to update both app and nwjs binaries
  • app.nw is a zip file. According to https://github.com/nwjs/nw.js/wiki/How-to-package-and-distribute-your-apps, myapp.app/Contents/Resources/app.nw can be either a directory or a zip file. In case of a zip file, the process.cwd() value could be different (not tested myself)

@hermwong
Copy link

hermwong commented Apr 9, 2015

I'm also experiencing this issue on OSX 10.10.2.

My app is being executed from the /Applications folder while the upd.getAppPath() and upd.getAppExec() are both returning /Users/hermwong/Documents.

@hermwong
Copy link

The node-webkit-updater is copying the Contents folder of my app over instead of the .app wrapper.

@Josema
Copy link

Josema commented Jul 10, 2015

Same Issue here on OSX 10.10.3

@owen-hong
Copy link

Same Issue here on OSX 10.10.5

@adam-lynch
Copy link
Collaborator

I don't understand how this can be happening for some people but I and others use this in production with many users and haven't seen it :/. I'd love if someone could give a simple project to illustrate it.

@adam-lynch
Copy link
Collaborator

Actually, this could be vary based on the NW.js version. Could everyone please tell me what version you've encountered this problem with?

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

6 participants