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?
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)
Please log in to answer
Posted by:
WiseUser
19 years ago
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)!
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:
'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
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.
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
Posted by:
Galen
19 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.