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: 

Include build time in program

Hello,

 

I want to add build time into program. Is there any posibility to make this?

Or is it possible to change a variable (string) in a non-running VI from a VI. If so then I can generate a VI and put it in the setting in build properties, Pre/Post Build Actions. I can run this VI before build and change the text in that VI which will be built.

 

Thanks.

0 Kudos
Message 1 of 5
(2,947 Views)

Hi kahlenberg,

 

I usually put such informations in the "description", found at the "version info" page of the AppBuilder settings.

You can manipulate this information also using a PreBuild action VI!

 

Otherwise use VIScripting in a PreBuild VI to manipulate a string or timestamp constant in your VI containing the build time information…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(2,944 Views)

@GerdW wrote:

Hi kahlenberg,

 

I usually put such informations in the "description", found at the "version info" page of the AppBuilder settings.

You can manipulate this information also using a PreBuild action VI!

 


How do you update the Description found on the Version Info page with a PreBuild Action?  I've posted (somewhere on the Forum) a VI I wrote to manipulate (using the Set Build Specification Version function) the Version numbers using a Pre-Build Action, then displaying them when the program runs using Get Build Specification Version.  I'm not aware of a similar pair of routines for the Description (I confess I haven't looked carefully at Properties or Invoke Nodes).

 

However, I've also documented (and asked for a "fix" on the Idea Exchange) that at least the Version information is cached before the "Pre-Build Action", so updating it with Set Build Specification Version has no effect on the current Build.  You need to Build Twice (Build Twice) for this to take effect.  Don't know if the same "feature" holds for the Version Description.

 

Bob Schor

0 Kudos
Message 3 of 5
(2,893 Views)

Hi,

 

I have to admit I change the version description manually as I put some more information into…

 

But in general you can edit all this information by fiddling with the lvproj XML file. And you can use the AppBuilder API to programmatically build your executable.

So maybe you can't use a PreBuild Action VI "immediately" (have to run it twice as Bob says) - but then you can create the executable by calling a VI not included in your project.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(2,879 Views)

I didn't see it linked to yet so here is the example I made where you can change the version with the PreBuild, which will then abort the build, then invoking it a second time takes the changes you made.

 

http://forums.ni.com/t5/LabVIEW/Pre-Build-EXE-and-Installer-Set-Version/td-p/3149028

 

Similarly you could do this with the description on the build.  Or I've see just a string constant in your VI that is shown as an indicator on the UI, and the pre build just sets the string value before the build.  This can be done with scripting pretty easily using static VI references, and finding GObjects by their label (Hidden Gems).

 

Oh but also can't you just look at the EXE file creation date? If you install the application from an installer I assume that date doesn't change from the original build date of the EXE.

0 Kudos
Message 5 of 5
(2,863 Views)