NI Package Manager (NIPM)

cancel
Showing results for 
Search instead for 
Did you mean: 

Package build spec in labview 2019 problem, missing function

Solved!
Go to solution

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?

CLA, Teststand and advanced SQL
0 Kudos
Message 1 of 9
(6,621 Views)

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

_______________
Automate LabVIEW builds easy with Jenkins Plugin www.kubes.ch/Jenkins
0 Kudos
Message 2 of 9
(6,613 Views)

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. 

pastedImage_1.png

 

And I'm not clear about the second question, would you please clarify on this?

0 Kudos
Message 3 of 9
(6,591 Views)

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


 

CLA, Teststand and advanced SQL
0 Kudos
Message 4 of 9
(6,589 Views)

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. 

pastedImage_1.png

 

And I'm not clear about the second question, would you please clarify on this?


 

CLA, Teststand and advanced SQL
0 Kudos
Message 5 of 9
(6,583 Views)
Solution
Accepted by Vaaben

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:

  • LabVIEWCLI -OperationName RunVI -VIPath <VI path>
  • LabVIEWCLI -OperationName ExecuteBuildSpec -ProjectPath <path to project> -TargetName <name of target> -BuildSpecName <name of build specification>

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

_______________
Automate LabVIEW builds easy with Jenkins Plugin www.kubes.ch/Jenkins
0 Kudos
Message 6 of 9
(6,580 Views)

Thanks for your clarification on this.

Does the Get/Set Build Specification Version.vi work for you to update the version?

api.png

And programatically modifying the display version is not ready yet.

0 Kudos
Message 7 of 9
(6,568 Views)

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?)

CLA, Teststand and advanced SQL
0 Kudos
Message 8 of 9
(6,545 Views)

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

CLA, Teststand and advanced SQL
0 Kudos
Message 9 of 9
(6,543 Views)