如何在卸载C#windows窗体应用程序之前运行代码? [英] How to run code before uninstall of C# windows forms app?

查看:232
本文介绍了如何在卸载C#windows窗体应用程序之前运行代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在卸载时从Windows启动中删除该程序。



我尝试过:



Installer.AfterUninstall活动



但我不能很好地使用它

解决方案

< blockquote> Microsoft ClickOnce 技术可以自动为您完成此操作,请参阅以下文章:

ClickOnce - 快速部署,安装和更新基于Windows的客户端应用程序的步骤 [ ^ ]

所有你需要的一个 - ClickOnce爱情故事 [ ^ ]


ClickOnce的唯一限制是你的应用程序安装在一个安全的单独用户目录中。

但是有办法绕过这个:http://matijabozicevic.com/blog/wpf-winforms-development/running -a-clickonce-application-as-administrator-also-for-windows-8 [ ^ ]




上面的答案不是你要求的,我想这会回答你的问题:

c# - 在注册表中禁用启动程序; - 堆栈溢出 [ ^

I need to remove the program from Windows startup on uninstall.

What I have tried:

Installer.AfterUninstall Event

but i cant use it well

Microsoft ClickOnce technology can do this automatically for you, see these articles:
ClickOnce - Quick steps to Deploy, Install and Update Windows Based Client Applications[^]
and All You Need Is One - A ClickOnce Love Story[^]

The only limitation of ClickOnce is that your application is installed in a safe separate user directory.
But there are ways to circumvent this: http://matijabozicevic.com/blog/wpf-winforms-development/running-a-clickonce-application-as-administrator-also-for-windows-8[^]


The answer above is not what you asked for, I think this will answer your question:
c# - Disable startup program in registry; - Stack Overflow[^]


这篇关于如何在卸载C#windows窗体应用程序之前运行代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆