LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Software version

Hi,

 

I am looking for a way to get a list of all the NI drivers/software similar to how NI-MAX displays them.  I am able to use the following, but it gives me a lot more than what I want, and not exactly what I am looking for.  

 

if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall", 0, KEY_READ, &hKey) == ERROR_SUCCESS)
{
  while (RegEnumKeyEx(hKey, index, subKey, &size, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
  {
sprintf(path, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\%s", subKey);
 
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, path, 0, KEY_READ, &subKeyHandle) == ERROR_SUCCESS)
{
 
I didn't include the reset.  Any suggestions?
 
Thanks,
Mike
DWORD dataSize = sizeof(displayName);
if (RegQueryValueEx(subKeyHandle, "DisplayName", NULL, &type, (LPBYTE)displayName, &dataSize) == ERROR_SUCCESS)

 

0 Kudos
Message 1 of 9
(128 Views)

One possible alternative is to use WMI to access information on installed software.

Attached is a modified version of one example of mine that includes the search for software installed on the system.

 

WARNING: it may take *long* to execute: on my i3, 1.2 GHz laptop it takes 45 seconds to list all modules. I have tested initially on an older machine with tons of programs installed resulting in 150 seconds elapsed time 😱 On the other hand, times spent using the equivalent WMIC command is more or less the same.

 

FYI my example can be found here but it seems I cannot update that page anymore... 😕



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 9
(81 Views)

Hi Roberto,

 

Thanks, but this looks like it is getting hardware info not software.

 

Regards,

Mike

0 Kudos
Message 3 of 9
(79 Views)

There is a "Software" tab where you get info on installed modules. That example has grown and grown in the years and includes several information I have looked for from time to time.

 

Screenshot 2025-04-11 193345.png



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 9
(77 Views)

I don't see a software tab.  This is what I have.

 

mjl_0-1744393067106.png

 

0 Kudos
Message 5 of 9
(74 Views)

Did you download the example from the original thread in the knowledgebase or from my post in this discussion? As I said, I couldn't update that example, so the code found there does not include the software tab. Download CallWMI_4 from my first answer to you.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 6 of 9
(67 Views)

Hi Roberto,

 

Thanks, I did get the wrong one.

 

Have a great day.

 

0 Kudos
Message 7 of 9
(65 Views)

Hi Roberto,

 

I appreciate the effort, but it is getting 1300 results.  I wonder if there is a way to make a more direct query.

0 Kudos
Message 8 of 9
(62 Views)

The query can be tailored a bit depending on your requirements: in the example I have added the "NI only" checkbox to limit search to modules installed by NI but the SQL command can be further refined based on the content of Win32_Product class



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 9 of 9
(51 Views)