M
McHansy
Is there anway to differ the 32bit version of XP from the 64bit version?
Mark Rae said:Er, no... This tells you what processor the machine has, not what OS is
installed - it's perfectly possible to install 32-bit Windows on a machine
with a 64-bit processor...
Also, reading the HKLM Registry hive is not recommended on machines running
Vista because of UAC considerations...
Mark Rae said:if (Directory.Exists(Environment.GetEnvironmentVariable("SystemDrive") +
"\\Program Files (x86)"))
{
// 64-bit Windows
}
Which part of the above code is not clear...?
The machine on which I'm writing this post has a 64-bit processor and is
running 64-bit Windows. The Registry entry for the key that you are using
says "Intel64 Family 6 Model 15 Stepping 6" - no mention of of EM64T. You
have absolutely no guarantee that a 32-bit OS will always show an Identifier
value beginning "x86"...
Of course you don't. You're a developer, so you're running Visual Studio.NET
with elevated permissions, your account is local admin on your machine etc.
This may not be the case for your users...
http://www.vistaheads.com/forums/mi...gistry-keys-under-hklm-uac-enabled-vista.html
http://www.eggheadcafe.com/community/aspnet/2/10042159/registry-permission-class.aspx
You can, but not to determine whether the underlying OS is 32-bit or
64-bit...
That has nothing whatsoever to do with your OS.
In Project Explorer, right-click on your project, click Properties, select
the Build tab and change the Platform target dropdown to "x86" - now what
does the above code give...?
Mark said:This is incorrect, for the same reason as the previous suggestion.
Specifically, this will tell you whether the current *process* is
32-bit or 64-bit, not whether the underlying operating system is
32-bit or 64-bit:
http://social.msdn.microsoft.com/Fo.../thread/24792cdc-2d8e-454b-9c68-31a19892ca53/