02-11-2011 09:52 AM
Is there an easy way to have a version number that the VI code has access to, and that is used as the version number for the executable and installer builds? Right now every time I update my software I have to change the global variable where I store the version number, and then when I build I have to manually open the properties and change the version number for both the executable and the installer. Is there some easy way to make these all match automatically?
Solved! Go to Solution.
02-11-2011 11:23 AM
Did you try a search? This question comes up A LOT. Here's the results from a search: http://forums.ni.com/t5/forums/searchpage/tab/message?location=Node%3A170&q=application+version#mess...
02-11-2011 01:04 PM
Thanks. I did search, but didn't find anything. Not sure what I did wrong.
02-14-2011 10:59 AM
Check out this example:
http://decibel.ni.com/content/docs/DOC-3733
Placing the above functions in your VI should retrieve the version for you. Make sure you read the note:
"Cut and Paste this code into your block diagram just before you build the executable. If you try and run this code section during development, you will get an error"
02-14-2011 11:34 AM
Thanks Aaron. I ended up using FileVersionInfo.VI from vi.lib\Platform\fileVersionInfo.llb instead. (I saw it recommended here as superior to using the .net property nodes.) I enclosed it in a conditional disable structure with condition RUN_TIME_ENGINE==TRUE, which seems like a better way of handling code that only works in the run time engine. It's working fine.
Thanks for the help!
02-14-2011 11:43 AM
Glad you found a solution.
Cheers,
Aaron
02-14-2011 11:43 AM
In case anyone reading this is interested, I ended up writing a subVI, shown in the snippet below. When called, this subVI retrieves the version number from the executable and appends it to the calling VI's window title.
03-01-2011 09:44 AM
LaserEngineer,
Could you provide the VI or an explanation? I am unfamiliar with some of the terminals used in the diagram.
Thanks.
03-01-2011 10:50 AM
You should close the reference that you opened in your subVI. Closing references you opened is generally the recoemended practice.
03-01-2011 01:39 PM
TimTech: the image above is a VI snippet. If you are using LabView 2010 on Windows or Mac you can load the code from the image:
-Save the image to disk (usually you can do this by right clicking on it and selecting "Save image as...").
-Open the folder containing the image file.
-Create a new blank VI in LabView and open the block diagram.
-Drag the image file from the folder on your hard drive to the block diagram.
-Labview magically gets executable code from the image.
-Save the new VI to disk and it is ready to use.