Skip to content
Tags

,

Failed to grab execution mutex. System error 258.

May 26, 2014

The error in the title can happen during MSI installations, if the msiexec global mutex is not available.

I encountered it while developing a small script that would uninstall all existing JRE versions on the machine and install the latest one (using the msi package).

Apparently the JRE uninstall command spawns the Java Automatic Update (AU) uninstaller, but returns control immediately to the caller. Hence, if I perform a JRE uninstall and immediately start another installation, it would sometime fail with MSI error 258 since Windows Installer is still busy with the AU uninstall.

The best solution I found so far is as mentioned in this Stack Overflow thread. I wrote a small program based on that code, that waits until the mutex is available (or until a certain timeout). So my script now runs the JRE uninstall, then the ‘wait for mutex’ program, and only then it launches the JRE installer, and everyone’s happy 🙂

Advertisements
Leave a Comment

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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: