51

I have been trying to create a log file for an issue with our installer with the following commands:

msiexec /i "installer.msi" /l*v "log.log"
msiexec /i "installer.msi" /l*v
msiexec /l*v /i "installer.msi"
msiexec /l*v "log.log" /i "installer.msi"

and several other variations of the command, but it always pops up the window that states what command line parameters are valid for msiexec. What is the correct way to have the msi file create a log? I have windows installer 4.5.

codewario
  • 19,553
  • 20
  • 90
  • 159
  • I just tried it again after a reboot, the first command worked immediately. Dunno what was wrong but it's logging now. – codewario Aug 19 '11 at 19:07
  • It could be that either .log or .msi got locked by a process, and it failed. Or Windows Installer service became unstable for some reason. – Alexey Ivanov Aug 20 '11 at 08:49
  • My experience is that it's best to always specify the full path to the MSI file. Can't tell if that's the problem without knowing the context of the msiexec commands. – PhilDW Oct 12 '14 at 19:50
  • 1
    [**Some MSI logging tips**](https://stackoverflow.com/a/54458890/129130) - including how to make logging policy based and always available. – Stein Åsmul Oct 28 '20 at 17:32

2 Answers2

82

The first and the last command lines are correct:

msiexec /i "installer.msi" /l*v "log.log"
msiexec /l*v "log.log" /i "installer.msi"

And you can drop quotes in this particular case.

codewario
  • 19,553
  • 20
  • 90
  • 159
Alexey Ivanov
  • 11,541
  • 4
  • 39
  • 68
13

If you are using Visual Studio 2008, use capital "/L" for the log option. Lower-case "/l" is ignored.

msiexec /i "installer.msi" /L*v "log.log"

This appears to have been fixed in later versions of msiexec.

codewario
  • 19,553
  • 20
  • 90
  • 159
Mark Lakata
  • 19,989
  • 5
  • 106
  • 123
  • Options are case-insensitive; Sure, capital `L` is more distinctive than lower-case `l`. – Alexey Ivanov Nov 25 '13 at 07:00
  • 1
    [MSDN documentation](http://msdn.microsoft.com/en-us/library/aa367988(v=vs.85).aspx) says _“Command-line options are case-insensitive.”_ (The second sentence on the page.) I have always used the lowercase `/i` and `/l` options. – Alexey Ivanov Nov 25 '13 at 17:21
  • It probably depends on which version. I wrote the answer because *it required capital L in Visual Studio 2008*. It seems that MS has fixed the issue, because I just tried again in Visual Studio 2013 and it accepts lower case L. – Mark Lakata Nov 25 '13 at 18:04