From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

getting OS version returns different values between LV2013 and LV2017 on same PC

Solved!
Go to solution

Hello all,

 

I have a third-party dll that runs fine in LV2013 but throws an error in LV2017. Upon digging deeper the dll seems to retrieve a different OS Version when called from LV2017 or LV2013. Apparently, when called from LV2017 the dll thinks the OS is not supported and therefore returns an error to LV.

So I tried to replicate this by getting the OS Version directly in LV2013 and LV2017 using a property node and indeed, both the Build number and the Version number differ (on the same PC running Win10Home). LV2013_2017.png

Can anyone clarify whether this is intended behaviour and suggest ways to get the dll to retrieve the right OS version?

 

Thanks in advance, Manu

0 Kudos
Message 1 of 4
(2,486 Views)

The first LabVIEW version officially compatible with Windows 10 is LV 2015 (see here).

This does not mean that programs written in earlier versions don't run well under Win10 (I deployed many programs written in LV2011 with no problems).

However, if the dll makes an internal check of the Windows version and fails, I don't think you can help, unless you can get the source code.

Is the dll written in LabVIEW 2013?

 

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 4
(2,473 Views)
Solution
Accepted by topic author ManuelXRE

Hello Paolo,

 

thanks for the swift reply. The dll is supplied by a third party vendor and built in Visual Studio 2015. This dll calls a hardware-driver-dll which was supposedly built in VS2010.

But in the meantime I came across the following:

https://msdn.microsoft.com/en-us/library/windows/desktop/ms724451(v=vs.85).aspx

This states the following: "With the release of Windows 8.1, the behavior of the GetVersionEx API has changed in the value it will return for the operating system version. The value returned by the GetVersionEx function now depends on how the application is manifested.

Applications not manifested for Windows 8.1 or Windows 10 will return the Windows 8 OS version value (6.2). Once an application is manifested for a given operating system version, GetVersionEx will always return the version that the application is manifested for in future releases. To manifest your applications for Windows 8.1 or Windows 10, refer to Targeting your application for Windows."

 

I assume LV2017 has been manifested for Win10 compatibility hence it returns another version number than LV2013 which is not manifested explicitely. A dll that calls GetVersionEx inherits this behaviour from its caller.

 

BTW, the same behaviour shows when I build my VI into an exe. In the LV2013RTE the dll works fine, in LV2017RTE it return "OS not supported".

When building the standalone exe by embedding a manifest file which was modified to only support older Windows version seems to do the trick.

I am reluctant to modify the manifest of my LabVIEW.exe, but that would probably also solve it for the vi-version.

 

Thanks again, Manu

Message 3 of 4
(2,442 Views)

I found this post because I needed to do something similar.  I also found this post which seemed to offer a more universal solution:

How to get detailed System Information from within LabVIEW 

0 Kudos
Message 4 of 4
(1,450 Views)