08-30-2012 06:21 PM
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.
Solved! Go to Solution.
08-30-2012 08:18 PM - edited 08-30-2012 08:20 PM
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
08-31-2012 08:43 AM
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.
08-31-2012 10:00 AM
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,
09-06-2012 06:30 PM
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.