By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,584 Members | 1,803 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,584 IT Pros & Developers. It's quick & easy.

Auto close running instance during uninstall

P: n/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
Jul 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I have just answered my second question. I update the version number and
product code. D'oh!

My first question still stands though.
"Dave A" <da**@sigmasolutionsdonotspamme.com.au> wrote in message
news:OT**************@TK2MSFTNGP11.phx.gbl...
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

Jul 21 '05 #2

P: n/a
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.

Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.