Install MSI with log from shell context menu

When authoring MSI packages, you frequently need the installation to be logged. Instead of repeatedly opening a console to type in msiexec /l* install.log /i foobar.msi, these shell context menu items may speed this process up a little. They do the same as ‘Install’ and ‘Uninstall’ but log everything (/l*) to PackageName.msi-install.log or PackageName.msi-uninstall.log, respectively.
msi.png

Here are the registry entries:

[HKEY_CLASSES_ROOT\\Msi.Package\\shell\\LoggedInstall]
@="&Logged Install"
[HKEY_CLASSES_ROOT\\Msi.Packageshell\\LoggedInstall\\command]
@="msiexec.exe /l* \"%1-install.log\" /i \"%1\" %*"
[HKEY_CLASSES_ROOT\\Msi.Package\\shell\\LoggedUninstall]
@="L&ogged Uninstall"
[HKEY_CLASSES_ROOT\\Msi.Package\\shell\\LoggedUninstall\\command]
@="msiexec.exe /l* \"%1-uninstall.log\" /x \"%1\" %*"

And in case you have not yet configured ‘Run as’ for MSI files, you may want to add these as well:

[HKEY_CLASSES_ROOT\\Msi.Package\\shell\\runas\\command]
@="msiexec.exe /l* \"%1.log\" /i \"%1\" %*"

MSI shell context menu (Save as and rename to .reg)

4 Responses to “Install MSI with log from shell context menu”


  1. 1 nettellect February 4, 2008 at 3:05 pm

    very informative post. this will really help everyone who is trying to log issues on install and uninstall operations.
    thanks for sharing such a nice piece of information

  2. 2 Farrukh December 4, 2009 at 12:36 pm

    Awesomley informative and useful :).
    I work with MSI based installations and it is a very handy tip to work with.

    Thanks a lot Johannes

  3. 3 sintaur February 2, 2012 at 10:49 pm

    Msi.Packageshell\\LoggedInstall should be Msi.Package\\shell\\LoggedInstall.

    Also the commands have to be REG_EXPANDSZ, for example, use this:

    [HKEY_CLASSES_ROOT\Msi.Package\shell\LoggedInstall\command]
    @=hex(2):0,0

    Then run regedit to put in the actual strings. If the reg entries are regular REG_SZ, the menu commands appear, but don’t work when you invoke them, at least not on Win2008.


  1. 1 More Context Menu Handlers for Everyday Use « JP’s Blog Trackback on August 5, 2009 at 5:21 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s




Categories

Try Visual Assert, the unit testing add-in for Visual Studio (R)


NTrace: Function Boundary Tracing for Windows on IA-32

About me

Johannes Passing, M.Sc., living in Berlin, Germany.

Besides his consulting work, Johannes mainly focusses on Win32, COM, and NT kernel mode development, along with Java and .Net. He also is the author of cfix, a C/C++ unit testing framework for Win32 and NT kernel mode, Visual Assert, a Visual Studio Unit Testing-AddIn, and NTrace, a dynamic function boundary tracing toolkit for Windows NT/x86 kernel/user mode code.

Contact Johannes: jpassing (at) acm org

Johannes' GPG fingerprint is BBB1 1769 B82D CD07 D90A 57E8 9FE1 D441 F7A0 1BB1.

LinkedIn LinkedIn Profile
Xing Xing Profile
Twitter Follow me on Twitter (new)

Follow

Get every new post delivered to your Inbox.