06-20-2019 06:22 AM
I'm having two issues for automating the build of packages using labview 2019.
1) The package build spec can't have a pre/post build action. My use case is to update the version number in the package based on our tagging in GIT - and this is working wonderful for the .exe files - but unfortunately there doesn't seem to be a pre build action for packages in LV.
2) The clear text version number (string) doesn't seem to be possible to change programmatically?7
Anyone having solved this already?
Solved! Go to Solution.
06-20-2019 06:25 AM
Hi Vaaben
are you using a buildsystem like jenkins?
If so, just define a own prestep where you can update the versioning. If you are using jenkins, i can give you a plugin which is able to update the version number
Best regards Matthias
06-20-2019 08:12 AM - edited 06-20-2019 08:16 AM
It's true that package build spec don't have the pre/post build action. But it supports custom actions in the "Advanced" page to run the executable files during installing/un-installing the package.
And I'm not clear about the second question, would you please clarify on this?
06-20-2019 08:13 AM - edited 06-20-2019 08:13 AM
I am moving towards a CI/CD setup using a build system - either on jenkins or Azure Devops based - but right now I need it to function also as a standalone solution.
@kubes_ch wrote:
Hi Vaaben
are you using a buildsystem like jenkins?
If so, just define a own prestep where you can update the versioning. If you are using jenkins, i can give you a plugin which is able to update the version number
Best regards Matthias
06-20-2019 08:19 AM - edited 06-20-2019 08:20 AM
Thank you
The version that i'm trying to change is the version that is set in the controls file inside the package. As it is this version number that triggers that NIPM sees that there are an updated version, it does not work to do it pre-install, as the end user never sees the new version
for 2) - in the packages build spec you can both set the version in 4 boxes - major.minor.revison.build - but below that there is a string field called "display version" - how can this one be modified programatically?
@yanhong wrote:
It's true that package build spec don't have the pre/post build action. But it supports custom actions in the "Advanced" page to run the executable files during installing/un-installing the package.
And I'm not clear about the second question, would you please clarify on this?
06-20-2019 08:27 AM
In this case, you can use the CLI from LabVIEW (https://zone.ni.com/reference/en-XX/help/371361R-01/lvhowto/cli_running_operations/) this is a cmdline tool which you can use to start some actions.
Build a batch file with this two actions:
For RunVI action, create a custom VI which will change the version number in your package build specification and save the project.
In the 2. action LabVIEW will Execute the build spec for this package
Execute the batch file
06-20-2019 09:50 AM
Thanks for your clarification on this.
Does the Get/Set Build Specification Version.vi work for you to update the version?
And programatically modifying the display version is not ready yet.
06-20-2019 10:51 PM
To do it with commandline is actually a good idea. Of course NI should add the pre/post actions to Packages - but in the mean time, your solution could work - and then I can post the pre/post actions on idea exchange (or is it actually a bug taht they are missing?)
06-20-2019 10:54 PM
Yes - the get/set version on packages work fine.
As a note, the property "Type String" on a build spec returns EXE for application, INSTALLER for installers - but a guid string for packages - that I have now reported as a bug