01-19-2016 01:43 AM
Hello,
i want to change the build specification name programmatically. I had no problem to do that with the Tag "Bld_buildSpecName" but the displayed Name at the project explorer is different to the build specification name displayed in the properties dialog.
I allready tried to:
I thought about change the xml entry inside the project xml file. Maybe someone have a differnet way to solve this problem.
01-19-2016 09:19 AM
Why do you want to do this? As I've discovered, Build Specs and the Build parts of Project are wonderfully arcane, illogical, and mysterious, and NI is reluctant to mess with it.
Can you possibly do this with VI Scripting?
Bob Schor
01-19-2016 01:32 PM
02-02-2017 03:50 AM
Hi.
I have the same problem, and I looked in to what happens in the project file when you change the build spec. name using the API vs. using the build spec. properties dialog. I have done so by opening the LabVIEW project file I am working on in Notepad++, since this file is basically just an XML file.
Before I do anything the file section for build specs. looks like this:
I<Item Name="Build Specifications" Type="Build">
<Item Name="Module App" Type="EXE">
<Property Name="App_copyErrors" Type="Bool">true</Property>
<Property Name="App_INI_aliasGUID" Type="Str">{CBF47618-0997-4E5B-8B92-54FC9488DCA8}</Property>
<Property Name="App_INI_GUID" Type="Str">{08C674C6-5E10-495E-BC78-C1A1F052FCB8}</Property>
<Property Name="App_serverConfig.httpPort" Type="Int">8002</Property>
<Property Name="Bld_autoIncrement" Type="Bool">true</Property>
<Property Name="Bld_buildCacheID" Type="Str">{530F7D44-44BC-4F35-8A99-5F0583B3CD7C}</Property>
<Property Name="Bld_buildSpecName" Type="Str">Module App</Property>
There are more lines in the section than shown above, but these are the esential to explain the issue.
When I change the name by using the API method "Set Tag" with the tag nam "Bld_buildSpecName" the section in the project file changes to look like this:
<Item Name="Build Specifications" Type="Build">
<Item Name="Module App" Type="EXE">
<Property Name="App_copyErrors" Type="Bool">true</Property>
<Property Name="App_INI_aliasGUID" Type="Str">{CBF47618-0997-4E5B-8B92-54FC9488DCA8}</Property>
<Property Name="App_INI_GUID" Type="Str">{08C674C6-5E10-495E-BC78-C1A1F052FCB8}</Property>
<Property Name="App_serverConfig.httpPort" Type="Int">8002</Property>
<Property Name="Bld_autoIncrement" Type="Bool">true</Property>
<Property Name="Bld_buildCacheID" Type="Str">{530F7D44-44BC-4F35-8A99-5F0583B3CD7C}</Property>
<Property Name="Bld_buildSpecName" Type="Str">Instrument Server App</Property>
As you can see the string value of "Bld_buildSpecName" changed. If I open the project file with LabVIEW at this point name displayed in the Project Explore under Build Specification is still "Module App".
Now I revert the project file and then use the properties dialog of the build specification to change the name. I save the project file and open it in Nopad++ again. Now the section looks like this:
<Item Name="Build Specifications" Type="Build">
<Item Name="Instrument Server App" Type="EXE">
<Property Name="App_copyErrors" Type="Bool">true</Property>
<Property Name="App_INI_aliasGUID" Type="Str">{CBF47618-0997-4E5B-8B92-54FC9488DCA8}</Property>
<Property Name="App_INI_GUID" Type="Str">{08C674C6-5E10-495E-BC78-C1A1F052FCB8}</Property>
<Property Name="App_serverConfig.httpPort" Type="Int">8002</Property>
<Property Name="Bld_autoIncrement" Type="Bool">true</Property>
<Property Name="Bld_buildCacheID" Type="Str">{530F7D44-44BC-4F35-8A99-5F0583B3CD7C}</Property>
<Property Name="Bld_buildSpecName" Type="Str">Instrument Server App</Property>
As you can see the Item Name below Build Specification also changed.
This tells me that the name displayed in the Procject Explore is the value of Item Name and thus setting the value of Bld_buildSpecName does not generate the result I wanted.
It also tells me that the properties dialog does some modifications to the XML that we do not have direct access to via the API, or am I missing something here?
02-02-2017 06:15 AM - edited 02-02-2017 06:15 AM
Hello,
Thank you for refreshing this post. At that time I unfortunately had not mentioned a solution.
"It also tells me that the properties dialog does some modifications to the XML that we do not have direct access to via the API, or am I missing something here?"
You are right withyour statement.
I have solved the problem as follows:
1. Using the API method "Set Tag" with the tag name "Bld_buildSpecName"
2. Close the project file + reference of the project
3. Open the *.lvproj file programmatically. (I use a self-written XML tool for this and further steps)
4. Search for the group [<Item Name="Build Specifications" Type="Build">]
5. Search for the entry [<Item Name="App Name - Application" Type="EXE">] ("App Name - Application" = self-chosen identifier)
6. Replace with the same name choosen in point 1
7. Save the project file
Best regards
Felix
Certified LabVIEW Developer