07-02-2009 01:55 AM
hExe = LoadLibrary( sSource );hRes = FindResourceA( hExe, MAKEINTRESOURCE( VS_VERSION_INFO ), RT_VERSION ); hResLoad = LoadResource( hExe, hRes ); lpResLock = LockResource( hResLoad ); hUpdateRes = BeginUpdateResourceA( sDest, FALSE ); result = UpdateResource( hUpdateRes, RT_VERSION, MAKEINTRESOURCE( VS_VERSION_INFO ), MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), lpResLock, SizeofResource( hExe, hRes ) ); EndUpdateResource( hUpdateRes, FALSE );
07-06-2009 06:56 AM - edited 07-06-2009 06:57 AM
Hello,
In versions of LabVIEW up to and including 7.1, there is no supported method to add version information to LabVIEW executables.
There is a possibility to edit <LabVIEW_Install_DIR>\applibs\lvapp.lib in Visual C's resource editor and modify the version before you build the application.
However, this method is not supported by NI and you will have to repeat this step every time you want to change the version.
For your reference some articles about how to get this info as of LabVIEW 8.0.
Determining the Version of an Executable Built with LabVIEW
http://digital.ni.com/public.nsf/allkb/935BA7FB426305398625711E0055F1FA?OpenDocument
Determining the Version Number of LabVIEW Executables
http://digital.ni.com/public.nsf/allkb/D45E3A1E694815AD86257173005CFD36?OpenDocument
NI LabVIEW Life Cycle Policy
http://www.ni.com/labview/product_lifecycle.htm
08-05-2009 06:01 AM
tanks for your reply.
In the meantime we switched to Labview v8.6, and the problem disappeared: using the code above does what I want, ie it replaces the VERSION_INFO resource in the built executable as expected.