views:

230

answers:

1

I have some Javascript code that will programmatically register an COM interop assembly by writing all the necessary keys and values to the registry. An older version of this COM object was written in VB6 and didn't work correctly on x64 versions of Windows unless the user manually ran the x86 sidebar.exe, so some of our users would have switched to using the x86 sidebar.exe for the COM object to work.

In short, I need to correctly detect the architecture of the operating system currently running. I've tried all of the following which return incorrect values if the x86 version of sidebar.exe is running:

System.Machine.processorArchitecture
navigator.platform
navigator.cpuClass

Is there something I can use to reliably detect if Win64 is running even though it's running x86 sidebar.exe?

+1  A: 

Figured it out:

navigator.userAgent.indexOf("WOW64") > -1

Evaluates to true if Internet Explorer is running in 32 bit emulation mode, and the same is true for sidebar.exe.

http://en.wikipedia.org/wiki/WOW64

Andy E