04-09-2020 01:16 AM
While reading the document on Optimizing Execution Speed for Built Applications, I got to know there is 'Pre/Post Build Actions'.
When is it useful in setting for Pre(Post) VI which the option requires to put?
labmaster.
04-09-2020 01:42 AM
Hi labmaster,
once I used the PostBuildVI action to remind me on some parameters I had to set for creating some setup routines later on.
You can use both actions to do things you usually want to do with your VIs before/after creating the executable. The PreBuild action is a little bit limited because the AppBuilder internally caches all VI before calling the PreBuild VI, so you cannot change them in this step anymore…
04-09-2020 01:49 AM
Thank you, Knight!
Can you describe some typical works before/after creating the executable?
In my working range, I cannot imagine this.
labmaster.
04-09-2020 01:57 AM
Hi labmaster,
@labmaster wrote:
Can you describe some typical works before/after creating the executable?
For certain reasons I used a different "setup creator" tool instead of the NI AppBuilder to create a setup package for other computers. The PostBuild action is a simple way to start this other tool…
The PreBuild action can be used to set version numbers or to collect/prepare some additional data used for creating the executable. (Beware of its limitations as written above.)
04-09-2020 02:19 AM
I use PreBuild.vi to set the symbols for conditional disable structure.
04-09-2020 03:58 AM
@wladimiripg wrote:
I use PreBuild.vi to set the symbols for conditional disable structure.
Me too. 2 symbols, to build 4 applications with the same code base.
I also have pre build VIs that add all classes in my project to a VI diagram that is always included in the build. Some classes are loaded dynamically, and not automatically included in the executable.
04-09-2020 06:35 AM
I hade a project that ran on a VM and it was extremely laggy, so it was easy to move things around that shouldn't be moved. So i locked most of the front panel down while developing and used a pre-build to release stuff at compile time.
In another one i used the tokens for conditional builds, as others have, to include or exclude a component that needed an external license, so the customer could run 2 versions, with and without it and same some licenses (otherwise all stations needed a license all the time, but it was only used in 10% of the cases). 🙂
04-09-2020 06:57 AM
Just remembered - I also have a post build action.
After building my executable, I zip all build content. The customer uses exe zips and installer zips. Sadly, the installer zips can't be created with a post build...
04-09-2020 07:00 AM
I happen to use the post build to create a checksum associated with my executable. It saves me a few minutes of time with my builds.
04-09-2020 07:01 AM
Ah, another afterthought.
My prebuild action switches symbols. But before it does that, I create a warning.
Changing the symbols, changes the source code. That's annoying, because a save all messes up my SCC. Not saving all could mean I loose relevant changes. Changing back the symbols will still mark the VIs as changed.
So I popup a warning stating the symbols will be changed (if they indeed change). If I cancel, I can save all relevant changes, and start the build again and then close without saving.