开发者

C# uninstall event

Is it possible to catch the uninstall event and execute some code when the program starts uninstalling?

program is installed by autoinstall. i already try to use this

public override void Uninstall(
 IDictionary savedState
)

but it said that method can not be overriden becous开发者_高级运维e it does not exist.


If you are talking about Setup projects in Visual Studio then look at this thread: Install directory from deployment projects. You can execute code on the install and uninstall using the Installer class.


You should be able to do this using a System.Management listener for deletion of instances of Win32_Product. Take a look at this, you would need to use Win32_Product and __InstanceDeletionEvent though.

This applies to software installed using Windows Installer, at least. For others, you may have to brute force the registry settings or the like.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜