Auto close running instance during uninstall

D

Dave A

I have an application that runs in the system tray (taskbar notification
area) and it runs at startup. Occasionally I need to release a new version.
I have created a deployment project in .Net. With the MSI it detects
whether a current version is installed and requests that the user uninstalls
it prior to installing the new version. Also, MSI detects a running instance
of the application during the uninstall and requests that it be closed prior
to continuing. Both of these features I love and it is going to save me a
lot of time in supporting the software.

My question is two fold:

1. When uninstalling is it possible to force the automatic termination of
the application if its running?

I have partially solved this already but have hit a brick wall. My
application knows to terminate immediately and silently when an application
defined windows message is passed to it. I also have also written a very
small C application that searches for a running instance of my main
application and posts that windows message. It duly shuts down. The C
program is included in the MSI package and is set to run as an 'Uninstall
Custom Action'. In theory, during the uninstall my application will
magically shut down and the uninstall will continue without notifying the
user of the running application.

The problem is (and its a big problem) that the Uninstall custom action only
runs at the end of the uninstall so the user is presented with the
termination message before my C program can send off the message.

Does anyone have any better ideas on how to solve this one?

2. When the user is installing the new version of the application they will
always be presented with the message to uninstall the old version first. I
would prefer it if the previous version could be silently uninstalled first.
This would make the whole experience a lot more user friendly.
Alternatively can you convince MSI to simply clobber the existing
installation and install right over the top of it?

I have also attempted to solve this one but again have hit a brick wall. I
can include a BAT file within the MSI project that runs the command line
argument msiexec /x {GUID}. It would be set to run as an 'Install custom
action'. However the user is presented with a message asking them if they
want to uninstall the product. It should be done silently. I have tried
the 'silent switch' but msiexec does not accept a /x /s switch combination
(probably for good reason though) In addition the install custom action
only runs at the end of the setup so again I am foiled.

Thanks in advance.

Regards
Dave
 
D

Dave A

I have just answered my second question. I update the version number and
product code. D'oh!

My first question still stands though.
 
F

Felix Wang

Hi Dave,

I have replied you in another post under "microsoft.public.vb.deployment".

If you have time, please have a look and reply me there.

Have a nice day.

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top