LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Display build number in application.

Solved!
Go to solution

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.

0 Kudos
Message 1 of 14
(11,358 Views)

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.

---

While evaluating my code please have in mind that I am a LV novice. Therefore sometimes my code might violate some coding rules that I have to learn about myself. But how else could I do that... 🙂

Chart zoom with "Mouse Over" effect
0 Kudos
Message 2 of 14
(11,348 Views)

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.

0 Kudos
Message 3 of 14
(11,340 Views)
I don't recall if there's a native way to do this in LabVIEW, and I'm not sure if it's different in LV 8.6 or 2009 for that matter. On 8.2 I use .NET:
0 Kudos
Message 4 of 14
(11,332 Views)

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.

 

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 5 of 14
(11,320 Views)

@ 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.Smiley Happy

 

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

0 Kudos
Message 6 of 14
(11,321 Views)
Solution
Accepted by topic author Bandit

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.Smiley Happy

 

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. 

Message 7 of 14
(11,316 Views)

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

 

 

0 Kudos
Message 8 of 14
(11,304 Views)

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.

0 Kudos
Message 9 of 14
(11,296 Views)
In LabVIEW 2009 (Windows only), you can use the fileVersionInfo.llb located in the labview\vi.lib\Platform directory to retrieve the version information of a stand-alone application or shared library programmatically.
George M
National Instruments
0 Kudos
Message 10 of 14
(11,269 Views)