Get rid of the MsiInterop that you are using and use the interop found in WiX's DTF. The Microsoft.Deploymnet.WindowsInstaller namespace has a SummaryInformation Class that exposes a read/write string Template property. Way better object model and interop without worrying about all the P/Invoke details that your current interop makes you deal with.
I'm home now so here's a code snippet:
using Microsoft.Deployment.WindowsInstaller;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
using( var database = new Database(@"C:\orca.msi", DatabaseOpenMode.Direct ))
{
database.SummaryInfo.Template = "Intel;666";
}
}
}
}
Notice the use of the using() clause. The Database class implements the IDisposable interface and automatically handles ( pun intended ) cleaning up all those pesky unmanaged handles for you.
Christopher Painter
2010-08-31 17:05:54