.vdproj parser wanted
I'm l开发者_StackOverflowooking for some c# sample code or a tool that could parse .vdproj file (Visual 2010 Studio Setup and Deployment Project).
I wrote a simple console application that converts a VDPROJ file to/from an XML structure. This made it much simpler to do things like set the add/remove programs icon in our build process.
https://github.com/dump247/VDProjectXml
Suggest using C# and LINQ to parse this file. Let's go with this vdproj sample. Unfortunately it's not XML based, but rather it looks similar to JSON, but not exactly.
Suggest to iterate through the lines. Determine where you are based on the number of tabs seen, and the line number of the section heading you want to parse out.
string[] allLines = System.IO.File.ReadAllLines(@"C:\foo.vdproj");
// iterate, and determine where the Configuration heading is....
if (line == "\t\"Configurations\"")
My sample code is too large to paste here, so please see the code at http://pastebin.com/DAiTCUtD
The complexity goes as far as how much data you need to extract from the file.
Hope this helps. Sounds like you were looking for a prebuilt tool, but perhaps this code gets you started in parsing .vdproj files.
Got something here. hope that this is it
Upd: D'oh! It has bunch of tools like VCProjectBindingParser.cs and VBProjectBindingParser.cs and nothing for .vdproj. I don't know, probably I'm gonna need to build my own parser.
Ahhh (heavily sighing) Just wanted to save some time.
InstallShield can convert VDPROJ to ISM. That makes it an MSI database that could then be queried or Darked into WiX.
$_ = join('', <>);
s/[=](.+)/:$1,/g;
s/[{]/: {/sg;
s/}/},/g;
s/[,](?:\s+)?[}]/}/sg;
s/[,](?:\s+)?$//s;
print "{$_}";
^-- this perl snippet converts [my] vdproj to json.
精彩评论