-
Sep 26th, 2012, 03:00 PM
#1
Thread Starter
New Member
Determine OS bit Version not Processor bit
I have a little problem and im stuck with my application since im not sure if it will work correctly on a x64 bit version.
Now im trying to create a VBScript which will check for OS bit and install the msi according to the OS bit.
I have found a lot of trash by googling for this solution which i think im not sure if it will work.
I have found another interesting code which will check if ProgramFilesx86 exist but the problem is only win7 has this option to check for xp and vista this folder seems not to exists. My processor is 32bit and i cant install an OS x64 to check it myself what differences are there to ensure what OS architecture it is.
I ask for help if somebody could tell me which folders or files or system files are different to a 32bit OS so to make a script to make sure which msi i can install(i will embed both assemblies on the main package)
Some scripts try to check from registry which will not work to all win versions.
Please refer me to the right answer, thanks Begi
-
Sep 26th, 2012, 04:00 PM
#2
Re: Determine OS bit Version not Processor bit
I am not sure what your goal is. Is it to prevent installation of 64 bit systems? If you don't have a 64 bit system to test on, how can you be sure the vbscript is even going to work correctly?
Your best bet may be compiling the software for x86 instead of AnyCPU, so that it will run as a 32 bit process regardless of windows being 32bit or 64bit.
-
Sep 27th, 2012, 11:07 AM
#3
Thread Starter
New Member
Re: Determine OS bit Version not Processor bit
I already found some help
checking if HKLM\SOFTWARE\Wow64NODE\ exists then we are on a 64 bit OS else we are on a 32 bit platform!
Now i ask you another question what about API codes will they run as x86 process on a x64 machine because in my x86 app the code is referencing to user32.dll to get the API functions will this also run on x64 os what if user32.dll doesnt exist which i am pretty sure i doesnt?
-
Sep 27th, 2012, 12:40 PM
#4
Re: Determine OS bit Version not Processor bit
User32.Dll should be there otherwise it would break like every windows application on the planet.
-
Sep 27th, 2012, 02:29 PM
#5
Re: Determine OS bit Version not Processor bit
For .NET 4 and later you can use the, Environment.Is64BitOperatingSystem Property
One of the main things about AMD64 (x86-64) was the 32-bit backward compatibility. There were rumors Intel wanted to dump x86-32bit and force us to switch to their x86 incompatible IA-64 (64bit) architecture (now in Itanium), AMD added extensions to the x86 instruction set so the CPUs could run in 64-bit mode while also running code compiled in 32-bit mode at the same time. Intel were also working on x86-64bit but MS said they would only support one x86-64bit architecture and went with AMD's solution, Intel copied AMD64 to be compatible.
So when your on a 64-bit OS and the app is compiled for 64-bit it can do 32-bit and 64-bit, if you compile your app as 32-bit then you you should only make 32-bit calls, AFAIK a 32-bit app can't call 64-bit.
When using API calls also make sure they are supported on the target OS(s), at the bottom of the MSDN docs for the API they usually tell you what the minimum client and server OS are supported.
http://en.wikipedia.org/wiki/X86-64
http://en.wikipedia.org/wiki/Itanium
Last edited by Edgemeal; Sep 29th, 2012 at 01:00 PM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|