LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

UpdateResource and Application Builder executables

Hi All,
I want to add version information to executables built by NI builder (7.1). I made some code to test if this is easily done, this code just copies version info from an exe/dll I wrote to any other exe/dll. The code works fine for 'normal' executables, and basically does these steps:

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 ); 



I tried this on severeal targets, it always works, no matter what resources are already available in the target.

However if the target is an executable file built by Application Builder, somehow the majority of the file is removed: all that left is an exe of 48kb.
I have no in depth knowledge of what the builder does, but afaik it packs a small executable part, followed by all VIs the application uses. After trying my program on it, the application still runs, but comes asking which VI to open, so it looks like all VIs that were there are simply stripped off!

Any idea what's going on, or how to get around this? Are there other ways to get version info into a Labview executable?
0 Kudos
Message 1 of 3
(2,717 Views)

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

 

 

Message Edited by Joeri on 07-06-2009 01:57 PM
Best regards,
Joeri

National Instruments
Servicesg
http://www.ni.com/ask

Make our forums great:
If you like the answer, don't forget to "Kudos!".
"Accept the Solution" if your question is answered!
0 Kudos
Message 2 of 3
(2,683 Views)

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.

0 Kudos
Message 3 of 3
(2,622 Views)