05-08-2006 10:58 AM
05-09-2006 02:08 AM
05-09-2006 03:17 AM - edited 05-09-2006 03:17 AM
Message Edited by Dynamik on 05-09-2006 03:21 AM
Message Edited by Dynamik on 05-09-2006 03:33 AM
05-09-2006 03:36 AM
hi there,
please have a look at this post: http://forums.ni.com/ni/board/message?board.id=170&message.id=172830&query.id=5855#M172830
05-09-2006 08:26 AM - edited 05-09-2006 08:26 AM
Thanks for all the help. Dynamik is correct I do want the version # and other things that the application builder puts in. In LV 8.0 the application builder puts the version information into the build and this is what i want not the revision history because when you do this and build an executable it is set to zero. I have found a good way to get this with .NET (figured out what i was doing wrong) and I created a nice little generic about vi that i will share with you all for anyone to use. It is not perfect and probably needs more error checking but it works fairly well.
Here is what i did to create it.
1. make sure you have the .NET framework installed.
2. Place an invoke node on block diagram and right click to select the class.
3. select system diagnostics then under that select fileversioninfo.
4. then place a property node and wire it to the output of the invoke node.
5. then select the file metrics that you want.
Here is a picture for those that do not have 8.0.
Here is the entire VI.
Again thanks for the help.
Message Edited by Jhoskins on 05-09-200609:27 AM
Message Edited by Jhoskins on 05-09-2006 09:29 AM
05-09-2006 01:27 PM
05-09-2006 01:36 PM
05-09-2006 02:59 PM - edited 05-09-2006 02:59 PM
Very nice programming! And since I figured this request will come sooner than later I converted it to 7.0 and attached it here.
@jarrod S. wrote:
Hi everyone,
I also came up with a method that doesn't rely on the .NET Framework. Granted, the .NET Framework makes our lives all much easier, but you might not want to assume that your target computer will have the .NET Framework version 1.1 SP1 or higher. My method uses Win32 API calls directly to access this data. This should also give you an indication of how much time and effort abstraction saves us!
Hope this helps!
Message Edited by rolfk on 05-09-2006 10:00 PM
05-09-2006 03:42 PM
05-09-2006 04:11 PM
Hmm, thinking about it there is possibly one more improvement. If the default english language does not provide any string resources another possibility might be to retrieve the current language codes from the user settings and try with them too. But this sounds quite academical as I can't imagine an installer manipulating the version resource of an executable according to the currently set user language. I will have to investigate a little more what the issue is with files not containing any translation keys.
@jarrod S. wrote:
Hi Rolf,
Thanks for your help with the VarFileInfo\Translation resource. I realized this was a hole in the programs functionality, and I knew a workaround, but I was never sure how valid the workaround was. Defaulting to the English language code does sound like a good idea. It definitely works for LabVIEW.exe. I never bothered implementing this since this was designed for LabVIEW-built exes, not LabVIEW itself. LabVIEW-built exes do contain the VarFileInfo\Translation resource. I also built this in LabVIEW 8, since that was the first version that allowed users to specify executable versions and other info for their applications. But it is nice as a general tool!