/build/static/layout/Breadcrumb_cap_w.png

automatic creation of log file

How would I have windows installer automatically create a log file without having the user type something at the command prompt? That is, I would like running the installation to be the same as typing to the following in the command prompt:
msiexec.exe /i mymsi.msi /l*v c:\temp\inst_log.log
Is there something I can add in my Visual Studio .NET setup project that will make the installation automatically create a log file just like that command?

0 Comments   [ + ] Show comments

Answers (4)

Posted by: WiseUser 19 years ago
Fourth Degree Brown Belt
2
The easiest way is to use the "Logging" policy.

But it's also possible to switch logging on from within your MSI using a custom action ("MsiEnableLog"). Here's a vbscript example of how:

Set oInst = Me.Installer
'Msgbox oInst.Version
oInst.EnableLog "v", "c:\temp\inst_log.log"

The most difficult issue is where to place your CA - it will not work otherwise. When I tried it, I placed it right at the start of the install (before "launchconditions" in the "InstallUISequence"). But this may not be suitable if you hide the user interface?

You can uncomment the second line for testing purposes (or omit it).

Good luck - and don't forget to rate the post if you like it (or hate it)!
Posted by: WiseUser 19 years ago
Fourth Degree Brown Belt
2
It should work as it is - but I should probably have used "session" instead to avoid confusion. It's a very simple script (only two lines). The third line was only there to reassure you that the script was running and creating a valid "Installer" object.

Set oInst = Session.Installer
oInst.EnableLog "v", "c:\temp\inst_log.log"

You simply need to create a vbscript custom action and schedule it correctly. Try it right at the start of your install first (like I did) - just to convince yourself that it works.
Posted by: Galen 19 years ago
Senior Yellow Belt
0
I suppose I don't quite understand how the script works. Am I supposed to replace "Me" with something or is the script going to work as is?
Posted by: Galen 19 years ago
Senior Yellow Belt
0
The script only worked when I put it before "launchconditions" in the "InstallUISequence" table just likeyou said. Thanks for your help!
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ