views:

80

answers:

3

Guys, I'm looking for some c# sample code or a tool that could parse .vdproj file (Visual 2010 Studio Setup and Deployment Project).

Please, help me.

A: 

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.

Ike
A: 

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.

alt text

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.

p.campbell
Hmmm.. I was thinking of using Regex.Split() thing. Anyway thank you very much.
Ike
A: 

InstallShield can convert VDPROJ to ISM. That makes it an MSI database that could then be queried or Darked into WiX.

Christopher Painter
really? I need to give it a try..
Ike