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
- :
- 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
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎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
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 20, 2010
09:15 AM
What do you mean with the application log? The installer log?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎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.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 27, 2010
04:47 AM
Use Kernel32.OutputDebugStringW(BYVAL WSTRING) to write into the logfile.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎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.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎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...?!?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎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;
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 28, 2010
05:15 PM
Got things working on WinXP and Vista, but not Windows 7. Unfortunately even trying to run eventcreate.exe from the command line gives me an access denied on a fresh install of Win7. 😞
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 31, 2010
02:43 AM
Are you administrator on that system => w.o.w. have you already created an admin user?
Are you launching the exe with admin rights?
Are you launching the exe with admin rights?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 02, 2010
03:24 PM
I am an admin, disabling UAC allowed me to write to the application log.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎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).
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)