Jump to content

How to terminate msiexec.exe process?


Recommended Posts

First, let me state that I did some searching for this, and found two threads describing this problem, but neither solution works for me in this case:



I'm working with an InstallShield MSI installer, which wraps the MSI and a few support files in an .exe. I call the InstallShield .exe with the /b parameter, which instructs it to copy the embedded MSI file to a specific temporary directory (in addition to the random directory in %temp% that is uses during installation). I then close the installer (only interested in extracting the MSI), move the extracted MSI file to a different directory, then remove the temporary directory to clean up afterward.

The problem is that after I exit the installer msiexec.exe continues running. Ordinarily I wouldn't care about that, but in this case it maintains a lock on the output directory. So, I try running processclose('msiexec.exe'), but it will not close. As described in the other threads, msiexec.exe is running as the System user. I can terminate the process myself through Task Manager, but AutoIt will not close it. I don't understand why AutoIt cannot terminate a process running as the System user if it's running in the context of an administrator account that has permission to terminate that process, but according to comments in the other threads it's apparently a known issue.

So, the issue at hand is that I need to figure out how to remove the lock on that directory so I can remove it. Terminating msiexec.exe seems like the most logical solution, but I haven't been able to figure out how to do so using AutoIt. Any suggestions? Failing that, are there any other suggestions to delete the directory that doesn't involved killing msiexec.exe?

There were a few suggestions in the other threads, but as I said above they don't seem to apply here:

  • Stopping a service - there is no service involved, only msiexec.exe and the original executable
  • Sopping the "Windows Installer" service - this seems like WAY overkill and would strongly prefer to avoid this option
  • Close the original exe/msi process - it's already closed; msiexec.exe itself is what's maintaining the lock
So.. any suggestions? :P I'm stuck at this point. Thanks. Edited by nitro322
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...