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

How to kill a process before uninstall starts removing files?

956 views
Skip to first unread message

Cinthia Lee

unread,
May 19, 2004, 3:08:32 AM5/19/04
to
Hi, all,

I am using Microsoft Visual Studio .Net to create the setup project.

I have finally figured out how to start the installed exe (a dialog
application in MFC) right after the installation finishes. But now I am
having a problem trying to stop it before uninstall starts removing the
files. It will ask the user to manually stop the exe file.

How do I add custom functions either before or during uninstall? It
seems that the Custom Action for "Uninstall" will only be activated AFTER
uninstal finishes.

Any comments will be a great help.

Thank you,

Cinthia


Phil Wilson

unread,
May 22, 2004, 11:49:27 AM5/22/04
to
VS uninstall custom actions happen during the uninstall, fairly early in the
uninstall process. You wouldn't be able to run one of the programs you
installed if the custom action was called after the uninstall. What exactly
does your custom action do?

I'm a bit surprised that Windows Installer doesn't automatically give you a
prompt to shutdown the program. If I install notepad.exe somewhere and run
it, the uninstall prompts me to close it down, so that might be something to
do with your dialog app description.
--
Phil Wilson
[MVP Windows Installer]
Definitive Guide to Windows Installer
http://www.installsite.org/pages/en/msi/books.htm

"Cinthia Lee" <cinth...@hotmail.com> wrote in message
news:uTdvc%23WPEH...@TK2MSFTNGP09.phx.gbl...

Cinthia Lee

unread,
May 25, 2004, 5:46:03 AM5/25/04
to
Hi, Phil,

I thought I replied to the group earlier, but couldn't find the posting
anymore... Hmm... probably made a mistake somewhere...

Anyway, my problem right now is that I have a setup project in Microsoft
Visual Studio .Net. I used to use InstallShield in my previous company and
it allows me to do things like shutdown a service or kill a running exe
during uninstallation.

However, I can't seem to do that in Visual Studio .Net. I have a setup
program that will run the installed exe file right after the installation is
complete. And since the exe file is running in the background, there is no
UI for the user to see or to terminate. I am hoping to find a solution to
terminate the program gracefully during the uninstall so the uninstall can
remove all the files nicely.

To simplify my question: Is it possible to carry out custom actions(kill
a process, write to the registry, etc.) right after the unsintallation
starts?

Thank you, and looking forward to any comments,

Cinthia

"Phil Wilson" <pdjw...@nospam.cox.net> 在郵件
news:ePZNpQBQ...@TK2MSFTNGP11.phx.gbl 中撰寫...

Phil Wilson

unread,
May 26, 2004, 10:16:25 AM5/26/04
to
You should get Orca from the Windows Installer SDK and examine the MSI
file - you can see where VS sequences custom actions. There's a lot less
flexibility with VS setup projects compared to the full InstallShield and
Wise products. There's no support in VS for stopping Services (in other
words no VS way to populate the ServiceControl table) and all the genertated
custom actions are deferred. An uninstall custom action in VS should work,
but if the running exe is not a Service and doesn't have a visible UI you'll
probably need a DLL custom action to enumerate the processes on the system
and terminate yours if it's there.

--
Phil Wilson
[MVP Windows Installer]
Definitive Guide to Windows Installer
http://apress.com/book/bookDisplay.html?bID=280

"Cinthia Lee" <cinth...@hotmail.com> wrote in message

news:%237GnZ0j...@TK2MSFTNGP12.phx.gbl...

Joe Goeke

unread,
May 28, 2004, 3:42:55 PM5/28/04
to
Hey Cinthia,
I have also had this same problem. Despite the wrong documentation
information on CA execution in the VS installer, the CA execution for
Uninstall actually happens before the files are removed. Therefore
you can run something app to shutdown your app.

In our case we engineered our app to shut it's self down if you try
and run it again with a -EXIT switch. I did not code this so I don't
know exactly what that takes, but in essense I just run a CA during
uninstall as follows: app.exe -EXIT

Hope this helps!
---JHG

"Phil Wilson" <pdjw...@nospam.cox.net> wrote in message news:<#sEERvyQ...@TK2MSFTNGP11.phx.gbl>...

0 new messages