Node Webkit User/Home Path - drive letter?

Discussion and feedback on Construct 2

Post » Wed Nov 27, 2013 9:09 am

Hello,

I came up with an issue about paths in NodeWebkit infterface, but I'm not sure if this can be considered a bug, or maybe I'm just doing something wrong?

When you query NodeWebkit plugin about the User Folder / Home Directory path, on Windows, your'e getting something like:
(Win8 output)
\Users\UserName

The problem is, it does not contain drive name! So, when I run the application *with unpacked resources* (= with package.nw unpacked and deleted), this is the only case when the app actually runs from within the folder where I call it from. Now, when I call it fro D drive (or any non-sytem drive), any calls to user folder end up referencing the local drive!

This effect is invisible in preview, it is invisible when running the app right after export, but it persists if you use unpacked resources (as I do, having 300Mb+ of audio/graphics). In a "typical" case the NodeWebkit will first unpack package.nw to a temp directory on a system drive, so the problem will not be visible either.

Any suggestions on how to deal with it? The only idea I came up with is checking if 2nd character in path is ":", and if not, add "C:", but that would be hard coding, which is a bad idea anyway :-(

Thanks for all suggestions,
Greg
B
18
S
3
G
3
Posts: 83
Reputation: 3,736

Post » Wed Nov 27, 2013 1:02 pm

Hmm... post a bug report for this and I'll see if I can add the drive letter to the path. I think it's because node-webkit is designed to be multiplatform, and that's what file paths look like on Mac and Linux (no drive letter).
Scirra Founder
B
402
S
238
G
89
Posts: 24,644
Reputation: 196,095

Post » Wed Nov 27, 2013 9:05 pm

Thanks so much, @Ashley !

I have a crazy time this week, so I'll probably do it during the weekend.

All the best,
Greg
B
18
S
3
G
3
Posts: 83
Reputation: 3,736


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 7 guests