02-11-2010 08:35 AM
I found a few old threads about this with no solution, but nothing recent. Does anyone know if there is a simple method to display the version number of an executable built with the application builder. I have the build set to auto increment this, and would like to be able to see that build number in the installed application.
For clarities sake I mean the build number of the exe, not the build number of the subsiquent installer I create.
At the moment it seems I must manually assign a version/build number and make it visible in the application. For this I use a seperate 'about' vi available from the main routine.
All suggestions welcome.
I'm using LabVIEW 8.6.1 on Win XP
Best Regards,
Bandit.
Solved! Go to Solution.
02-11-2010 08:52 AM
I'm not sure about this, but what if you would try using a Property Node (Programming -> Application Control palette) with a property of Application -> Version Number.
If I put it in a block diagram of an ordinary VI it returns the current version of my LabVIEW program. But if you put it in an EXE and if you would set up the version for that EXE, maybe it would return that value instead.
Have never tried this, maybe you could give it a chance.
02-11-2010 09:12 AM
Hi Giedrus.S, thanks for your reply.
In the development environment that returns the version of LabVIEw I am using (8.6)
As an executable it also returns 8.6
Help file says this property node gives "Version number of the application. In a built application or shared library, this property returns the version of the LabVIEW Run-Time Engine."
This isn't what I'm after, but I appreciate that you took the trouble to post a reply.
Regards,
Bandit.
02-11-2010 09:31 AM
02-11-2010 09:55 AM
There really should be a function for this, I do the lazy way and maintain a constant in my application and use this constant to display in my about screens and main title bar. This requires an update each time you make a new build.
Programatically you should be able to get a path to the exe for the build (if appkind=exe) then there should be a windows function for getting the file attributes, the version attribute is what is displayed in the file properties details tab. Offhand I dont know the dll that this function. Thsi is only if you are avoiding the .net solution.
02-11-2010 10:05 AM
@ smercurio_fc - That looks very promising. We are way out of my comfort zone here though...
Assume I know nothing about .NET, you won't be far wrong.
What class do you need to select in the invoke node, to get access to the FileVersionInfo method?
And does this require specific .NET stuff already installed on the target PC, over which I may have no control?
@ falkpl - your current way is already more sophisticated than mine!
Regards,
Bandit
02-11-2010 10:17 AM
Bandit wrote:@ smercurio_fc - That looks very promising. We are way out of my comfort zone here though...
Assume I know nothing about .NET, you won't be far wrong.
What class do you need to select in the invoke node, to get access to the FileVersionInfo method?
And does this require specific .NET stuff already installed on the target PC, over which I may have no control?
There is an example here: http://digital.ni.com/public.nsf/allkb/D45E3A1E694815AD86257173005CFD36
You will need to have .NET installed, and this solution is Windows-specific.
02-11-2010 10:42 AM
smercurio_fc - Thanks for the further info. I followed the link, and it worked on my development PC, so I must have .NET installed there at least. I'll turn that into a subvi that handles the error neatly if .NET isn't installed when I have time, so I have a drop in solution. Windows specific isn't a problem for me, but I'll bear it in mind if my talents ever need to spread wider.
Slightly concerned about how specific this is to particular versions of .NET, backwards/forwards compatability, but I can live with it for now.
all - thanks for your replies.
Best regards,
Bandit
02-11-2010 11:00 AM
Bandit wrote:Slightly concerned about how specific this is to particular versions of .NET, backwards/forwards compatability, but I can live with it for now.
The FileVersionInfo class has been around since .NET 1.1, and I don't see it leaving anytime soon. It's still there .NET 4.
02-11-2010 01:18 PM