Jump to content

ProcessClose Help


Recommended Posts

I have a program that I am trying to automate an uninstall of one portion of prior to actually installing the newer version. I have an uninsatll string that works just fine, but I am having an issue with an MsiExec.exe process that won't close.

When the uninstall runs it calls MsiExec as administrator then 3 additional MsiExec.exe processes start under the SYSTEM account. One of these MsiExec processes never closes(it closes, but only after about 10 minutes which seems like a time out to me). To automate this I have a ProcessWaitClose("MsiExec.exe") line, but given the problem I am having you can see that this will never progress(it will after the time out). I suppose I could get the PID on the original MsiExec and continue on in the script after that portion exits, but this brings me to my next problem...

When the install runs it does the exact same thing. An MsiExec with the SYSTEM user just sits there after the install is finished, so I have the same problem as above. I have additional tasks that have to happen after the installation exits, but it takes 10 minutes for the process to exit. This one is even more complicated because the original MsiExec exits long before the install is completed.

Is this a common thing with MsiExec or is this bad programming in the installer? Any ideas?

UPDATE: I cannot end the MsiExec process running as SYSTEM. I can do it manually, but ProcessClose does not close it.

Edited by Anaxibius
Link to comment
Share on other sites

This is all normal behavior. As you've already established, it will run itself under the SYSTEM account and automatically close itself after a timeout has elapsed. If you absolutely must stop it after you are sure the installation is completely, you can trying to stop the "Windows Installer" service. I would research whether this is safe or not, however. I can see you getting some (un)installer errors if you close down the service while it's doing something.

Link to comment
Share on other sites

I will not comment on ProcessClose, as Valik has covered that.

If ProcessWaitClose is used to wait for the MSI process to finish, then you will need to monitor the name of the MSI process, rather then MSIExec itself. Yes, it is common for some reason the MSIExec keeps running for awhile before closing.

If you have

msiexec /i file.msi /qb

then you should see msiexec.exe and file.msi in task manager when executed. Use

ProcessWaitClose('file.msi')

to wait for the process to finish. ProcessWaitClose supports a timeout parameter also if you do not want your script to hang if something unexpected happens, so aleast your script can continue.

Link to comment
Share on other sites

I will not comment on ProcessClose, as Valik has covered that.

If ProcessWaitClose is used to wait for the MSI process to finish, then you will need to monitor the name of the MSI process, rather then MSIExec itself. Yes, it is common for some reason the MSIExec keeps running for awhile before closing.

If you have

msiexec /i file.msi /qb

then you should see msiexec.exe and file.msi in task manager when executed. Use

ProcessWaitClose('file.msi')

to wait for the process to finish. ProcessWaitClose supports a timeout parameter also if you do not want your script to hang if something unexpected happens, so aleast your script can continue.

Also try using the /log switches for MSIEXEC, that is the best way to figure out what MSIEXEC is doing during a silent install/uninstall.

Try this

Edited by blademonkey

---"Educate the Mind, Make Savage the Body" -Mao Tse Tung

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
 Share

  • Recently Browsing   0 members

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