tags:

views:

113

answers:

1

We have our custom setup.exe program which launches a series of individial MSIs in synchronous manner. Scheme and command use to launch msi is :

msiexcehandle = CreateProcess("msiexec.exe /i  product.msi /qr")
WaitForSingleObject(msiexechandle, INFINITE)

Now we want to do the following - When user pressess the Stop button in setup.exe program then we would like to stop the installation completely. We can control the installation of any product msi which is yet to be started, but we did not find a way to send some event to already running installation (which is already launched using CreateProcess). We want to send Cancel event from the setup.exe to msiexec.exe's created Progress dialog.

Please suggest some technique to perform this action. Is it possible to call a rollback on running installation from commandline?

FYI, we use Wise to create our MSIs and VS 2008 MFC to create our setup.exe.

-Kartlee

A: 

I don't think this is possible as you describe. The two options I see are UI automation (simulate a click to the cancel button), or an external UI handler used with MsiInstallProduct() instead of CreateProcess().

Note that in either case, you cannot always cancel the setup immediately or at all. While your setups may not do so, some setups will disable the cancel button at certain points because they know they cannot roll back cleanly.

Michael Urman

related questions