64-bit or 32-bit

I will be distributing the .net framework 2.0 into my environment.  I have two different .exe's (one for 32-bit, one for 64-bit).  I was wondering if anyone knew of a process or registry entry or something like that I could use in my install script to determine if the machine is 32 or 64 bit.  I don't need any code (as of yet), just a way to determine if the machine is one or the other, thanks.
mpenuelAsked:
Who is Participating?
 
FocusynCommented:
Reg key should be HKLM/Software/Microsoft/Windows/CurrentVersion/ProductID - I just checked a couple versions and found it there as GUID.
0
 
FocusynCommented:
Check the Windows OS build/version number in the registry.  It will be different for 64-bit version.  If a 64-bit machine is running a 32-bit OS, you'll probably need to use the 32 bit framework anyway (which is why I recommend this check as opposed to looking at actual cpu info; I think the different versions of the framework are adjusted for the 32/64 bit API calls to the OS and not actual hardware dependencies, which makes the most sense considering that most 64 bit cpu's are backward compatible and capable of running 32 bit OS).  I don't remember the exact reg key for windows build number, but it's somewhere under HKLM/Software/Microsoft/Windows.  
0
 
mpenuelAuthor Commented:
Thanks for the repsonse, I was kind of in a hurry when try to find this, so I posted and continued research.  The key above is a good one, and I think I will use that one and HKLM\Software\WOW3264node which should also tell me if it's a 64-bit machine.

thanks again.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.