03-26-2020 02:19 AM
Is there a way to have always the actual date or time in the build Specifications destination directory?
Solved! Go to Solution.
03-26-2020 02:47 AM
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.
03-26-2020 02:48 AM - edited 03-26-2020 03:09 AM
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...
03-26-2020 03:05 AM
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?
03-26-2020 03:20 AM
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!
03-26-2020 03:26 AM
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).
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.
03-26-2020 04:35 AM
Sorry, but I need it for LabVIEW 2017.
03-26-2020 04:50 AM
03-26-2020 05:18 AM
Can you send me the VI it is just a picture.
03-26-2020 05:27 AM
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.