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

Should App.dataPath always return an absolute path? #1221

Closed
mvanderw opened this issue Oct 21, 2013 · 1 comment
Closed

Should App.dataPath always return an absolute path? #1221

mvanderw opened this issue Oct 21, 2013 · 1 comment

Comments

@mvanderw
Copy link

This is on Windows with 0.7.5, using the inspector console.

Not setting data-path:

> gui.App.dataPath
"C:\Users\mvanderw\AppData\Local\nw-testcase"

Setting --data-path to ./data in chromium-args (same output setting the switch on nw.exe)

> gui.App.dataPath
"./data"

I can resolve this just fine on startup.

> require('path').resolve(gui.App.dataPath)
"C:\Users\mvanderw\Desktop\nw\testcase\data"

I can then just store that absolute path for later use.

But it seems more useful and consistent for App.dataPath to always return an absolute path. In addition, I'm concerned there might be gotcha's here somehow (what if I launch from a shortcut or symlink, will I always safely resolve to the correct path in my app under all circumstances/platforms?).

This is probably mostly an issue for portable apps, ie running from a thumb drive and saving settings alongside the app.

Also, I'm wondering if it could be related to #800.

BTW, it can't be said enough, but many thanks for this awesome project! :)

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@rogerwang
Copy link
Member

This should be working with latest version now.

In 0.13 we changed to an optimized architecture so more features can be supported, see http://nwjs.io/blog/whats-new-in-0.13/ and it's good for keeping up with Chromium upstream -- we released with Node.js v6.0 and new Chromium versions within 1 day after upstream release.

The new version would fixed many issues reported here and we're scrubbing them. This issue is closed as we believe it should be fixed. Please leave a message if it isn't and we'll reopen it.

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

2 participants