process.platform returns 'win32' on 64bit system

1,382 views
Skip to first unread message

Murray Hopkins

unread,
Feb 25, 2015, 11:57:11 PM2/25/15
to nwjs-g...@googlegroups.com
Hi.

I am using the 0.12.0-alpha3 nightly release. On my 64bit Win7 machine process.platform = 'win32' and arch = 'x64'.

Shouldn't process.platform='win64' on a 64bit OS ?

Thanks,
Murray

Anatoly Pashin

unread,
Feb 26, 2015, 1:48:58 AM2/26/15
to nwjs-g...@googlegroups.com
No, it's win32 for all Windowses and 32/64 bits are in arch attr.


--
You received this message because you are subscribed to the Google Groups "nw.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nwjs-general...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Пашин Анатолий,
эникейщик.

Murray Hopkins

unread,
Feb 26, 2015, 7:03:23 AM2/26/15
to nwjs-g...@googlegroups.com
Cool. Thanks. Got it. I was looking at the os api rather than the process api. Thank you.

I also noticed that if I build using the 32bit nw.js and run it on a 64bit machine, the arch = 'ia32'. It seems to relate to the version of nw.js rather than the os itself:
ie:

nwk: 0.12.0-alpha3

64bit nw.js running on 64 bit pc: type=Windows_NT, release=6.1.7601, platform=win32, arch=x64

32bit nw.js running on same pc: type=Windows_NT, release=6.1.7601, platform=win32, arch=ia32

For my auto updater I wanted to detect whether the app should download the 32bit or 64bit update. Given that a user might want to run the 32bit version on their 64bit machine for some reason, it seems logical to use arch to determine which version to auto update from. So, the fact that the arch seems to reflect the version of nw.js rather than the OS itself is a good thing in this case. 

However, what if I did want to work out what the OS actually was (32 || 64)? Am I missing something?

Thanks again,
Murray
Reply all
Reply to author
Forward
0 new messages