Inserting log into MSI log - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

cecil@coral8.com
Posts: 18
Joined: Mon Oct 27, 2008 11:45 pm

Inserting log into MSI log

Hi,

When debugging vbs associated with AI, I frequently want a log of settings, etc.

When installing, the MSI log gets created on the command line with:

Code: Select all

msiexec /i my_prog.msi /L*V install.log
In your vbs, add the following:

Code: Select all

Function LogInfo(msg)
    Dim rec
    Set rec = Session.Installer.CreateRecord(1)
    rec.StringData(0) = "XXX my_script.vbs: " & msg
    LogInfo = Session.Message(&H04000000, rec)
End Function
and send a string to the log:

Code: Select all

    LogInfo "This is a test"
and install.log will contain the string: "XXX my_script.vbs: This is a test"

Use your editor to extract the "XXX" starting each line for the vbs logs.

This technique side-steps the annoying MsgBox popup debugging style and integrates with the file associated with the flow of the rest of the installation.

Thanks to AI for a GREAT installer - keep up the good work! :D
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Inserting log into MSI log

Hi,

Thank you for this. This approach is indeed better than using message boxes.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”