LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Build Specifications destination directory with actual date

Solved!
Go to solution

Is there a way to have always the actual date or time in the build Specifications destination directory?

0 Kudos
Message 1 of 12
(3,458 Views)

I do not know how to get the date, but you can use [VersionNumber] for an executable or [ProductNumber] for an installer. If you activate "Auto Increment Version Number" in the "Version Information" category, you get a new directory for every Build that runs.

0 Kudos
Message 2 of 12
(3,437 Views)

If you have access to the Application Builder API, you can programmatically set the build directory.

You could add a VI to set this as a Pre-Build action, perhaps, if you wanted to still use the GUI for the main building process.

 

The VI you'd need is probably C:\Program Files (x86)\National Instruments\LabVIEW 2019\vi.lib\AppBuilder\AB_API\Build\Set Primary Destination Path.vi or similar.

There are several for setting destinations - that is the one I use for PPL builds on Windows.

 

Edit: I managed to create a Pre-Build VI that changes the destination as desired, but it only changes it for the next build, not the one that triggered the Pre-Build action... making it less useful. I suppose you could build it twice every time, and delete the first build. But definitely not ideal...


GCentral
0 Kudos
Message 3 of 12
(3,436 Views)

Hello,

 

I found the VI, but would have to adjust it to include the date in the path. Unfortunately I cannot open it because it is password protected. Is there an unprotected version I could edit?

0 Kudos
Message 4 of 12
(3,429 Views)

See the attached zip file for an example. But as I said, it doesn't change the current build, making it a bit useless...

 

Perhaps with further modifications it can be improved to either trigger a second build automatically, or change the path.

 

Thinking some more, I expect a Post-Build VI that moves the folder is much more feasible and requires much less effort!


GCentral
0 Kudos
Message 5 of 12
(3,426 Views)

Here's a much simpler post-build VI that works as intended (this adds a timestamp too for testing, but you can modify the destination as needed).

 

Post-Build Action_BD.png

 

Note that the popup that appears after building will still reference the original (Build Spec) path, so the folder won't exist and clicking Explore will give an error, but the build is placed at the timestamped location.


GCentral
0 Kudos
Message 6 of 12
(3,421 Views)

Sorry, but I need it for LabVIEW 2017.

0 Kudos
Message 7 of 12
(3,407 Views)
Solution
Accepted by topic author HolgerN

Just ignore the zip file and copy the Post-Build VI - it works much better than the Pre-Build option for EXEs (which you can move after creating).


GCentral
0 Kudos
Message 8 of 12
(3,405 Views)

Can you send me the VI it is just a picture.

0 Kudos
Message 9 of 12
(3,401 Views)

If you open your build specification and go to the Pre/Post Build VIs tab, you can click "Generate VI" to create most of the VI for you.

Then just add Strip Path, Build Path, Format into String, Get Date/Time in Seconds and Move and you're basically done.

I don't have the VI on this computer so I can't upload it.


GCentral
0 Kudos
Message 10 of 12
(3,399 Views)