LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I have the installer for my application check the OS type and then install the correct driver type?

Solved!
Go to solution

I have an application that I wrote and have been using and distributing for some time. The installer I created for this application runs an additional installer to install a driver for the USB connection. The USB connection is actually a Virtual COM Port. The trouble is that the folks who wrote the driver installer changed the installer itself. They used to have one installer that would check for 32 bit or 64 bit OS and then install the correct driver.

 

Now, they have two separate installers: one for 64 bit and one for 32 bit. They leave it up to the user to know their OS and install the correct driver. I would prefer to not have to rely on my users to do this. From what I have seen the installer creater only provides for one executable to be run after the application itself installs.

 

Is there a way to have the application installer check the type of OS and then run the correct executable after installing my application? I suspect I could write an installer "wrapper" that checks the OS type and then runs the correct installer. But I was hoping for a better solution.

 

Thanks,
Joe

0 Kudos
Message 1 of 5
(2,532 Views)

Hi jperch

 

I was checking the options that are selectable from a property node related with the operating system, and unfortunately it seems like none of these show the windows type.

 

PropertyNode

 

It is possible to determine the type of the LabVIEW version, but not for windows.

0 Kudos
Message 2 of 5
(2,514 Views)

Diego,

Thanks for the reply. But I may be onto something. Some searching around on the web gave me a couple of things I can do to verify the SO type. One is a registry key that has the information in it. I would have to parse it out of the complete string. But that is easy to do. The other is to read an environment variable called Processor_Architecture.

 

Either of these will tell me if I have a 32 bit or a 64 bit SO. I can then write a wrapper in LabVIEW to find this information out and then run the correct installer. I can then compile this wrapper into an executable and then call it from the installer I create for my application.

 

So, while I am not done yet, I think I am well on my way to solving this issue.

 

Joe

0 Kudos
Message 3 of 5
(2,511 Views)

Thanks to you for the feedback!,  maybe you can post in the forum how did you achieve it when you get it working!

 

0 Kudos
Message 4 of 5
(2,503 Views)
Solution
Accepted by topic author jperch

So, I did get it working!

 

The trick is to find a way to determine what type of OS you are running in. The method I used was to, in effect, 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 entries there suggested reading the Processor_Architecture environment variable.

 

This seemed like a reasonable idea. So I started looking into how to read environment variables in LV. It turns out, you do it by reading a registry key. There is a LV example on how to read a registry key. But I didn't know where they were located in the registry. So, I searched the registry for Processor_Architecture. I found it in HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment.

 

According to the article in the link, this value will either be x86 for a 32 bit OS, or something with 64 in it. I just check the response string for x86. If it is, then I just run the x86 version of the driver installer. Otherwise, I run the x64 version.

 

It turned out to be as simple as that.

 

I hope this helps someone.

 

Joe

Message 5 of 5
(2,476 Views)