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
- :
- Re: Writing to the Application Log during installation
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
‎May 14, 2010
07:15 PM
Writing to the Application Log during installation
I'm working on a Basic MSI and looking for some way to write custom events to the Application log during installation. I'd like to include useful troubleshooting info by dumping some properties in the entry as well as predetermined messages.
i.e. "Invalid User/Password [USERNAME] provided"
Anyone know of any good solutions or approaches to this?
i.e. "Invalid User/Password [USERNAME] provided"
Anyone know of any good solutions or approaches to this?
(10) Replies
‎May 26, 2010
04:29 PM
"Application log" as in the one that's viewed in the Event Viewer. aka Event Logs 🙂
Basically we have an installer that we want to be able to write info there that can be pulled using WMI to see if/why the installer failed.
Basically we have an installer that we want to be able to write info there that can be pulled using WMI to see if/why the installer failed.
‎May 27, 2010
06:12 PM
Thanks for the suggestion Christoph, although it looks like this function is meant for writing to debug, rather than the application log. I'm looking for something that we can write to the application log.
‎May 28, 2010
02:06 AM
There seems to be an utility, present in a windows installation, that can be used to write event log entries:
http://blogs.techrepublic.com.com/datacenter/?p=243
How you do it via your 'own code', I don't know. I would think there should be a Windows API call available...?!?
http://blogs.techrepublic.com.com/datacenter/?p=243
How you do it via your 'own code', I don't know. I would think there should be a Windows API call available...?!?
‎May 28, 2010
01:25 PM
Excellent! Exactly what I was looking for. Thank you
Here's a snippet of Installscript code that I'll use in a custom action that I threw together for a proof-of-concept:
Here's a snippet of Installscript code that I'll use in a custom action that I threw together for a proof-of-concept:
function MyFunction(hMSI)
STRING szEventCreate, szParameters;
STRING svInstallDir;
NUMBER nvBuffer;
begin
nvBuffer = 255;
MsiGetProperty(hMSI, "INSTALLDIR", svInstallDir, nvBuffer);
szParameters = " /L Application /T information /ID 33 /SO \"My Installer\" /D \"We are going to install to "+svInstallDir+"\"";
szEventCreate = WINSYSDIR^"eventcreate.exe";
LongPathToQuote(szEventCreate, TRUE);
MessageBox(szEventCreate+szParameters, INFORMATION);
LaunchApplication(szEventCreate, szParameters, "", SW_HIDE, 1000, LAAW_OPTION_HIDDEN);
end;
‎Jun 02, 2010
03:27 PM
If you run it from an elevated command prompt window, does it work?
If so, maybe you need to pass LAAW_OPTION_USE_SHELLEXECUTE. For more information, see LaunchApplication (especially the first bullet point in the Additional Information section).
If so, maybe you need to pass LAAW_OPTION_USE_SHELLEXECUTE. For more information, see LaunchApplication (especially the first bullet point in the Additional Information section).