Determine if the processor is AMD64 or Intel64?

Compiler Visual Studio C ++ provides a command-line compiler /favor:AMD64and /favor:INTEL64for the optimization for AMD64 processors or Intel64 respectively. Now the terms AMD64 and Intel64 are essentially interchangeable for most purposes, but there are some differences that the compiler can optimize for.

In Microsoft Windows 7, there is a reliable way to check the installation time of an application, are we installing an AMD64 or INTEL64 system?

I use InnoSetup and WiX for installers, and I'm thinking about choosing a version to install based on AMD64 or INTEL64 processors.


Edit: some notes in retrospect

In the end, the answers of RRUZ and Andrew Cooper gave good reliable strategies for approaching this, but since none of them is really reliable future proof, I personally will adhere to the standard /favor:blendfor my project.

+3
source share
3 answers

You can use Win32_Processorthe WMi class, from the info setting you can easily execute a WMI request. check this sample

var
  FSWbemLocator : Variant;
  FWMIService   : Variant;
  FWbemObject   : Variant;
begin
FSWbemLocator := CreateOleObject('WBEMScripting.SWBEMLocator');
FWMIService   := FSWbemLocator.ConnectServer('', 'root\CIMV2', '', '');
FWbemObject   := FWMIService.Get('Win32_Processor');
if FWbemObject.Architecture=9 then //is a 64 bits processor
  if  FWbemObject.Family=131 then  //all 64-bit AMD processors are identified by using a Family attribute value of 0x83 (131).

fron here you can use the Architecture, Family, Manufacturer, and tohers properties to determine the type of processor.

+5
source

You can try the environment variable %PROCESSOR_IDENTIFIER%.

On AMD systems, the value ends with "AuthenticAMD".

Intel "GenuineIntel".

( , )

+2

Could you use a combination of if Msix64and IntelProperties of the installation window to define it? Obviously, this suggests that the property Intelis set correctly for AMD64 processors. There is a property Intel64, but it only shows if the processor is an Itanium processor, which I assume doesn't bother you.

+1
source

All Articles