How can I get the installer for my application check the operating system type and then install the correct driver type?

I have a request that I wrote and have been use and distribute for awhile. The installer I created for this application is an additional installer to install a driver for the USB connection. The USB connection is actually a virtual COM Port. The problem is that the people who drafted modified driver setup the installation program itself. They used to have an installer that would check for 32-bit or 64-bit OS and then install the appropriate driver.

Now, they have two distinct installation programs: one for the other for 32-bit and 64-bit. They let the user know their OS and install the appropriate driver. I'd rather not have to rely on my users to do. From what I've seen the creater Installer provides that an executable to be run after the application installs.

Is it possible to have the installer of the application, check the type of OS and then run the correct executable file after installing my application? I think that I could write an Installer 'wrapper' that checks the type of operating system then executes the correct Installer. But I expect a better solution.

Thank you
Joe

So, I make it work!

The trick is to find a way to determine what type of OS you are using. The method I used was, indeed, read the environment variable. A buddy of mine sent me this link:

http://StackOverflow.com/questions/2401756/how-to-find-if-the-machine-is-32bit-or-64bit One of the phrases he bibliography the Processor_Architecture environment variable.

It seemed like a reasonable idea. So I started to research how read LV it environment variables turns out, you do it by reading a registry key. There is an example of LV on how to read a registry key. But I did not know where they are in the registry. So, I searched the Processor_Architecture registry. I found it in HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment.

According to the article in the link, this value will already be x 86 for a 32 bit OS, or something with 64 inside. I just check the response for x 86 string. If it is, I just run the x 86 version of the driver Installer. Otherwise, I run the x 64 version.

It turned out to be as simple as that.

I hope this helps someone.

Joe

Tags: NI Software

Similar Questions

Maybe you are looking for