Hi all,
I am trying to insert a custom action dll programatically into an MSI
database using the following code:
private void InsertCustomActionDll(string msiLocation)
{
//get the records in memory
Database database = new Database(msiLocation,
DatabaseOpenMode.Direct);
Record record = new Record(2);
record.FormatString = "Name = [1], Data = [Binary Data]";
record.SetString(1, "TyrellTest");
record.SetStream(2, @"TestCustomActions.CA.dll");
Microsoft.Deployment.WindowsInstaller.View view =
database.OpenView("Insert into Binary (`Name`,`Data`) VALUES ({0},
{1})", record.GetString(1), record.GetStream(2));
view.Execute();
view.Close();
database.Close();
}
However, it fails with the following InstallerException: Message = "SQL
query syntax invalid or unsupported. Database: MyMSI.msi. Invalid identifier
'[Binary' in SQL query: Insert into Binary (`Name`,`Data`) VALUES ('Test',
[Binary data])"
Does anyone have any idea why? I would have thought using
record.GetStream(2) would ensure that it was attempting to insert a stream
type.
Thanks in advance.
Lewis
--
View this message in context:
http://n2.nabble.com/Insert-to-the-Binary-table-failing-tp2897616p2897616.html
Sent from the wix-devs mailing list archive at Nabble.com.
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
WiX-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-devs