cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ChipBrowne
Level 2

Option to Output list of Files including Versions

During build time, is there an option to output a list of files including build numbers that were included in the final package?
Labels (1)
0 Kudos
(3) Replies
Christopher_Pai
Level 16

InstallShield does this by default. Look at the location you build your MSI in and find the Reports directory.

If you don't like the format of that report, you can write your own custom build automation to reflect the MSI package and generate the report in any format that you like. Personally I've found the InstallPackage class in Microsoft.Deployment.WindowsInstaller.Package.dll ( WiX / DTF ) to be very useful for this purpose. It has a InstallPath collection that returns the destination directory, filename and version for every file in the installer. Very easy to use it to get the data you need without having to query the various MSI tales to put that together.

using( var package = new InstallPackage(@"C:\IsWiX.msi", DatabaseOpenMode.ReadOnly))
{
foreach (var file in package.Files)
{
var version = package.ExecuteScalar("SELECT `File`.`Version` FROM `File` WHERE `File`.`File` = '" + file.Key + "'");
Console.WriteLine( String.Format("{0},{1}", file.Value, version));
}
}
0 Kudos
ChipBrowne
Level 2

Hi Christopher,
Thank you for your reply. I discovered the report in the Reports directory, and HTML file which will work just great for my purposes.

Thank you also for the snippet of code to customize my own solution.

Kindest regards,

Chip Browne
0 Kudos
Christopher_Pai
Level 16

BTW, what we did at my last job was I wrote a build automation NAnt task that pulled the information out of the MSI and formed an XML document that I defined the schema for. Then a web developer on my team did some XSLT magic and turned it into an HTML page that was fully interactive.

I showed this to a developer at InstallShield so I wouldn't be suprised if they don't do something similar one day.
0 Kudos