This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Problem logging from managed CA using InstallShield.Interop.Msi
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 25, 2010
12:45 AM
Problem logging from managed CA using InstallShield.Interop.Msi
I'm trying to log messages from my managed CA written in C#.
Messages from the first CA that gets called shows up correctly in the install log file. I've added this CA directly to the UI sequence. The other CAs are called when buttons are clicked.
The first CA's message looks like this:
MSI (c) (40!1C) [08:49:18:202]: Creating MSIHANDLE (77) of type 790531 for thread 2332
INFO: (00654) My message.
MSI (c) (40!1C) [08:49:18:202]: Closing MSIHANDLE (77) of type 790531 for thread 2332
From then on I'm just getting lots of Creating/Closing pairs like this:
MSI (c) (40!34) [08:49:26:377]: Creating MSIHANDLE (79) of type 790531 for thread 5684
MSI (c) (40!34) [08:49:26:377]: Closing MSIHANDLE (79) of type 790531 for thread 5684
MSI (c) (40!34) [08:49:26:392]: Creating MSIHANDLE (80) of type 790531 for thread 5684
MSI (c) (40!34) [08:49:26:392]: Closing MSIHANDLE (80) of type 790531 for thread 5684
MSI (c) (40!34) [08:49:26:392]: Creating MSIHANDLE (81) of type 790531 for thread 5684
MSI (c) (40!34) [08:49:26:392]: Closing MSIHANDLE (81) of type 790531 for thread 5684
I create a custom action handle using the msi handle passed from the installer.
Then I use the following method to log the message.
[CODE]
public void Log(string level, string code, string description)
{
using (var record = new Msi.Record(4))
{
record.SetString(0, "[1]: ([2]) [3]");
record.SetString(1, level);
record.SetString(2, code);
record.SetString(3, description);
m_Install.ProcessMessage(Msi.InstallMessage.Info, record);
}
}
[/CODE]
When the CA ends I dispose of the custom action handle, like this:
Any idea what is going wrong here?
Messages from the first CA that gets called shows up correctly in the install log file. I've added this CA directly to the UI sequence. The other CAs are called when buttons are clicked.
The first CA's message looks like this:
MSI (c) (40!1C) [08:49:18:202]: Creating MSIHANDLE (77) of type 790531 for thread 2332
INFO: (00654) My message.
MSI (c) (40!1C) [08:49:18:202]: Closing MSIHANDLE (77) of type 790531 for thread 2332
From then on I'm just getting lots of Creating/Closing pairs like this:
MSI (c) (40!34) [08:49:26:377]: Creating MSIHANDLE (79) of type 790531 for thread 5684
MSI (c) (40!34) [08:49:26:377]: Closing MSIHANDLE (79) of type 790531 for thread 5684
MSI (c) (40!34) [08:49:26:392]: Creating MSIHANDLE (80) of type 790531 for thread 5684
MSI (c) (40!34) [08:49:26:392]: Closing MSIHANDLE (80) of type 790531 for thread 5684
MSI (c) (40!34) [08:49:26:392]: Creating MSIHANDLE (81) of type 790531 for thread 5684
MSI (c) (40!34) [08:49:26:392]: Closing MSIHANDLE (81) of type 790531 for thread 5684
I create a custom action handle using the msi handle passed from the installer.
m_Install = Msi.CustomActionHandle(m_MsiHandle);
Then I use the following method to log the message.
[CODE]
public void Log(string level, string code, string description)
{
using (var record = new Msi.Record(4))
{
record.SetString(0, "[1]: ([2]) [3]");
record.SetString(1, level);
record.SetString(2, code);
record.SetString(3, description);
m_Install.ProcessMessage(Msi.InstallMessage.Info, record);
}
}
[/CODE]
When the CA ends I dispose of the custom action handle, like this:
m_Install.Dispose();
Any idea what is going wrong here?
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 27, 2010
03:44 PM
This is a limitation of Windows Installer. While you can do various things from a ControlEvent action, logging isn't one of them. One workaround during debugging is to change the value of a property, as that will get logged even from a ControlEvent action.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 04, 2010
01:11 AM
Thanks, thats good to know.