LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scripted Build of Host and RT application and installer

Solved!
Go to solution

Looking to make a script that allows me to create the host application from a project template. But I need it to change some of the values in the project such as file paths, files included in the installer and names of the build exe and rtexe.  I cant find the way that I can  programtally control that thing based on user input.  

 

This is something I am doing so our developer team can be more consistant about how we compile updates and how they are distribuited to the customer.  

0 Kudos
Message 1 of 5
(2,508 Views)
Solution
Accepted by topic author Taylor.Kendall

You can turn on VI scripting and may be able to change the paths etc. the project is just an XML file so if you wanted you could just write something to edit that file directly to update the paths. Then you can use the application builder api to write a program that you can set up to do the build every night at midnight, for example, or however you want to handle it. Is this what you were getting at? The problem is I don't know if updating the VI path with scripting will cause it to update where the build spec looks when doing the build

0 Kudos
Message 2 of 5
(2,504 Views)

As for(imstuck) has said, all of what you want to do is possible, but it is spread out over two APIs - the VI server API (property and method nodes) and the application builder API, which is not on the palettes, but can be found in <vi.lib>\AppBuilder\AB_API.

 

For working with projects, you can get project references through the Application class, then move on to project items, etc.  You can use the class browser (Ctl-Shift-B) to find things.

 

AppBuilder has several APIs, depending upon what your final target is (source code, executable, packed library, etc.).  Use the appropriate one.

 

I would strongly recommend you do not directly touch the project file.  It can contain binary information and has a lot of interdependencies.  You may be successful, but your solution will probably be brittle, since the project format can and does change with the LabVIEW version.

 

If you have any more specific questions, let us know.

0 Kudos
Message 3 of 5
(2,490 Views)

I was not aware that the project file was just XML thats super useful and I think i can make it work from there.  

 

Thanks, 

0 Kudos
Message 4 of 5
(2,482 Views)

Having trouble with the xml, I can brute force it but its not pretty and the xml nodes are somwhat unclear for values that are not strings.  The examples dont show anything except handling a Text_Node types, whereas the children of the lvproj show up as attribute_node types.  Not sure how to handle these.  

0 Kudos
Message 5 of 5
(2,451 Views)