Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to avoid getting "The following applications should be closed..." when uninstalling

2,078 views
Skip to first unread message

justice...@gmail.com

unread,
Oct 22, 2006, 12:13:13 PM10/22/06
to
Hello,
I have recently made a windows service which launches another
application (a small gui app).
In the installer of the service I stop the service and the application
it launches just to keep things neat.
The problem is that if the application is still up when uninstalling I
get an annoying message:
"The following applications should be closed before continuing the
install".
This check done by the windows installer (I guess) happens before the
Uninstall and BeforeUninstall of my service's installer.

Is there another way to close my app in an earlier stage so that I
don't end up getting this message every time I try to uninstall?

Thanks...

justice...@gmail.com

unread,
Oct 22, 2006, 12:57:23 PM10/22/06
to
Forgot to mention:
I am using VS2003 (.Net1.1)

Christopher Painter

unread,
Oct 22, 2006, 2:10:09 PM10/22/06
to

justice...@gmail.com wrote:
> Forgot to mention:
> I am using VS2003 (.Net1.1)

You are describing the FilesInUse dialog. This pattern is where
Windows Installer automatically looks to see if any of the files to be
installed or uninstalled are locked. Since your running app has a
lock on it's EXE when it's running, you are seeing this dialog. The
only two ways no not see the dialog is

1) Ensure all processes that would call a lock are terminated

or

2) Set the REBOOT property to ReallySupress. You should not see the
FilesInUse dialog and the installer won't reboot the machine. However
your running process and locked file are not gone until after the next
system reboot.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/filesinuse_dialog.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/reboot.asp

Phil Wilson

unread,
Oct 22, 2006, 2:25:19 PM10/22/06
to
There's your problem.... ;=) I believe you'd to need to run code to shut
down the app before the InstallValidate action in the uninstall, but Visual
Studio sequences its custom actions after that. You know all this anyway,
all I can suggest is a post-processing step of your MSI file to have a
custom action before InstallValidate.
--
Phil Wilson
[Microsoft MVP-Windows Installer]
Definitive Guide to Windows Installer
http://apress.com/book/bookDisplay.html?bID=280

<justice...@gmail.com> wrote in message
news:1161536243.6...@b28g2000cwb.googlegroups.com...

Christopher Painter

unread,
Oct 22, 2006, 8:39:11 PM10/22/06
to

Ah the old post processing and related hacks that VDPROJ shoves upon
you. At my last job they had hundreds of installer class custom
actions. It was scary..... But anyways we had to have a `resequence`
file that old a post build script the proper script execution order.
It was in VBScript but I refactored it as a C# NAnt task before I left.

Quite frightening...

James Drain

unread,
Oct 23, 2006, 10:33:01 AM10/23/06
to
Justice,

Don't forget that taskkill.exe is included in Windows Xp and for legacy
clients there is the resource kit utility kill.

You "could" author a Custom Action (type 34) somewhere before remove files
to terminate the process of the exe.

Just to confirm - you are stopping and uninstalling the process on Remove of
the product?

Hope this helps,
James
http://dotmsi.com
James

justice...@gmail.com

unread,
Oct 23, 2006, 2:12:33 PM10/23/06
to
Hi,
Thanks for the ideas, but unfortunately I haven't found my solution
yet:
Setting the Reboot property - didn't work, the fileInUse dialog is
still displayed.
Post processing - I've tried adding my custom action (c#) which kills
the gui app but after failing to do so, I found numerous discussions
saying it is not possible at all (since the VS does a lot of work in
the background that I can't do on my own).

I haven't tried custom action (type 34) yet, I'll try tomorrow.
And yes, what I am trying to do is to stop & uninstall the process
(without getting the fileInUse message).

p.s:
Where can I find a list of custom actions types? I haven't found it
yet...

will

unread,
Oct 24, 2006, 12:51:18 PM10/24/06
to
I'm also encountering this problem when using my vs2005 (setup and
deployment project) msi on vista but it works fine on XP.

Will

justice...@gmail.com

unread,
Oct 25, 2006, 12:32:30 PM10/25/06
to
Just wanted to let you know that I eventually succeeded to solve it.
The way to do it was just like phil suggested - I created a custom
action dll with a function that stops the app as an entry point.
Added this CA to my project to the binary table and with a little help
of ORCA & transforms changed its type to 1 and its sequence to 1350
(InstallValidate is 1400 here..)


Thanks again!

0 new messages