DiFx for Windows 32/64

We are using DiFx based installer tools for driver installation.

However the DiFx command line tool from the DDK provides separate binaries for 32 and 64 bit.
So based on the OS (Xp or 7) and its architecture (32 or 64 bit), we are calling corresponding DiFx command line binaries.

The script used to identify OS and architecture are working smoothly on XP/7 32/64 untill we came across Win7-64 PC (having i7 processor) here we are not able to detect the architecture (32 or 64), we are using below script commands to detect OS and acrhitecture

  1. OS:
    “wmic OS Get Version”
    if output contains “6.1.7600” it is Win-7 (here we are not sure its a 32 or 64 OS, we will get during 2nd script)
    if output contains “5.2.3790” it is Win Xp-64

  2. Architecture:
    “wmic OS Get OSArchitecture”
    if output contains “64-bit”, it is it is Win 7 64
    else Win 7 32

Appreciate, if there is better way of determining the OS and its architecture from the command line, please share.

Thanks in advance.

You can use PROCESSOR_ARCHITECTURE environment variable. It works on XP64 and above.?
http://support.microsoft.com/kb/888731


From: “xxxxx@gmail.com
To: Windows System Software Devs Interest List
Sent: Tuesday, June 28, 2011 8:03 AM
Subject: [ntdev] DiFx for Windows 32/64

We are using DiFx based installer tools for driver installation.

However the DiFx command line tool from the DDK provides separate binaries for 32 and 64 bit.
So based on the OS (Xp or 7) and its architecture (32 or 64 bit), we are calling corresponding DiFx command line binaries.

The script used to identify OS and architecture are working smoothly on XP/7 32/64 untill we came across Win7-64 PC (having i7 processor) here we are not able to detect the architecture (32 or 64), we are using below script commands to detect OS and acrhitecture

1. OS:
“wmic OS Get Version”
if output contains “6.1.7600” it is Win-7 (here we are not sure its a 32 or 64 OS, we will get during 2nd script)
if output contains “5.2.3790” it is Win Xp-64

2. Architecture:
“wmic OS Get OSArchitecture”
if output contains “64-bit”, it is it is Win 7 64
else Win 7 32

Appreciate, if there is better way of determining the OS and its architecture from the command line, please share.

Thanks in advance.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Thanks,

As the name suggests PROCESSOR_ARCHITECTURE
If we install a 32 bit Windows7 OS on the 64 architecture PC (Ex. AMD Athlon 64), we wanted to know the value of this env variable. Will it be x86 or x64.

I could have tested the same, but I dont have such environment with me know.

On 06/28/2011 08:03 AM, xxxxx@gmail.com wrote:

Appreciate, if there is better way of determining the OS and its architecture from the command line, please share.

Same problem as for DPInst. See here:

http://download.microsoft.com/download/5/d/6/5d6eaf2b-7ddf-476b-93dc-7cf0072878e6/32-64bit_install.docx

See “Launching the Correct Version of DPInst from an Installer”

Hi,

are you restricted to the command line or can you write some little application you can ship with your installers?

best

K.

Thanks Kerem GA, Right now installer calls batch file (command line)

Thanks Hagen Patzke, I will use the script as per the “Launching the Correct Version of DPInst from a Command Script” and update if required.

xxxxx@gmail.com wrote:

As the name suggests PROCESSOR_ARCHITECTURE
If we install a 32 bit Windows7 OS on the 64 architecture PC (Ex. AMD Athlon 64), we wanted to know the value of this env variable. Will it be x86 or x64.

If you install a 32-bit operating system, then it thinks it is running
on a 32-bit processor. The variable will be x86.

I uses an NSIS installer and invoke DPInst from inside it. The NSIS
installer is a 32-bit application, which adds another level of
complication. I use the presence or absence of the SysWOW64 directory
to decide whether I’m running on a 64-bit system or not.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.