From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

set executable description programmatically

Hello,

 

Is it possible to programmatically set the description of an executable before the build.

I would like to automate the build in order to change the descritpition so that it can be linked to a source code version.

I found a vi to change the build version but not the version description.

 

For info I am using LabVIEW 2014.

 

Best Regards

0 Kudos
Message 1 of 4
(3,043 Views)

Yes, it absolutely is possible.

In your Build Specification you need to turn on a Pre-Build Action. 

Inside the Pre-Build Acton.vi it should look like this:

Set Description.png

 

Edit: On second thought this won't work. It'll set the description of your top-level vi, not the built executable. 

—Ben
Prevent your computer from sleeping programmatically!
Use Power Requests
Download from GitHub

Message 2 of 4
(3,016 Views)

I'll echo Ben to say "Absolutely it is possible", but I'll add "It ain't easy" and "You might break things" and "It would be nice if NI provided the necessary "hooks".

 

First, all of the information is saved and manipulated in the Project File (.lvprog), which is a text file that follows an XML-like format (I'm being vague here because I'm not an XML expert).  Here are the first two lines from one of my Projects:

<?xml version='1.0' encoding='UTF-8'?>

<Project Type = "Project" LVVersion="14008000">

 

Buried somewhere in your Project will be an Item whose Name='Build Specifications".  Inside this will be further Items whose Name matches the Build Spec you want (you can have several -- I didn't mention that you may also have several Targets).  Inside that is a Property with Name="Bld_buildSpecDescription" Type="Str"> that contains the Build Description string.

 

If you are sufficiently daring and sufficiently careful, you can open this file, read the XML, modify it, write it back, and hope that you made no mistakes (otherwise you've messed up your Project File).  Also note that modifying the Project File from within the Project might have its own challenges.

 

An example of "hooks" that NI did supply are the Build Specification Version information, which lets you set the Major, Minor, Patch/Fix, and Build numbers programmatically, including during a Pre-Build Action.  However (and I'm "fighting" with NI about this), it's not really "Pre-Build", because NI has already read and cached the Version before you run the Pre-Build Action.  The Pre-Build Action will change the Version number, but you won't see this change until you build a second time (as it uses the cached, Before-the-Pre-Build-Action value, for the actual Build).  Go Figure.

 

Bob Schor

Message 3 of 4
(2,996 Views)

Thank you to both of you for your reply.

It is the kind of answer I feared I would have, it is possible but not easy...

I will find another field to write the information in.

 

Best Regards

 

0 Kudos
Message 4 of 4
(2,952 Views)