2

I have a requirement to calculate the relative paths of files in a MSI. Currently, I am querying the File table to obtain the corresponding Component to the FileName. Then, I am using this Component to query the Component table and find the Directory_. Next, I use this Directory_ to query the Directory table and find the Parent Directory of the Directory_.

Subsequently, I keep querying the Directory table for the Parent_Directory to my previous Parent and constructing the path of the file, until I hit $TARGETDIR. Here I just substitute the Property Value of $TARGETDIR to get the absolute path.

My question is, since all this requires a number of queries across tables in the MSI Database, there is a considerable performance hit. Are there any API's out there in C++ or any library in VC++ that does it differently, or does Microsoft provide a similar (but Readymade) solution? Will really appreciate any kind of help!

Thanks, Shankha

1 Answers1

0

If I understood well your question, what you need is to work with strings and strings operations. C++ is providing this in the string class. In alternative Qt is providing some stuff to work with file paths.

ISTB
  • 1,799
  • 3
  • 22
  • 31
  • No, my question was regarding whether or not there is any API available in C++/VC++ to give me the complete target install path of a file (which is part of an MSI) by querying into the MSI Database. – user1734732 Oct 10 '12 at 12:56