tags:

views:

20

answers:

1

Hi,

Is it possible that my application, when exit, uninstalls itself automatically, without any user intervention and involvement?

Thanks

A: 

Yes, this is possible. You need to detect the shutdown (perhaps via the Application.OnExit event), and then in the event handler you could call Process.Start that will kick off the uninstall.

You will need to make sure your application has fully existed by the time the uninstaller needs to remove it.

Oded
That last sentence is the rub.
Hans Passant
@Hans Passant - absolutely. I would probably run it as a separate app that will poll the processes on the system and only kick off the actual uninstall after seeing that the process in question is no more.
Oded
How do you uninstall that 'separate app'?
Hans Passant
@Hans - got me there...
Oded
Hi Oded, could you kindly give me the code..............Does it work silently or it needs user intervention. I need silent uninstall
@user415037 - There is no code. This is simply a suggestion on how such a thing _may_ work and what classes to look at.
Oded