.Net 安装程序修复选项

发布于 2024-10-03 02:20:28 字数 207 浏览 1 评论 0原文

我正在开发一个项目,如果以前安装了程序,我需要为我的安装程序提供修复/删除选项[将在安装时显示]。我需要使用 VS 2008 来完成此操作。请帮助我。

编辑:实际上出于某种安全原因,我删除了以前安装的注册表项。这样我就只能从受密码保护的应用程序中卸载它。这就是为什么我需要自定义修复/删除选项。这样它就会通过查看某些特定的注册表值而出现。我怎样才能做到这一点?

谢谢。

I am working on a project, where I need to give a repair/remove option to my installer [which will be shown at installation time] if the program previously installed. And I need to do it with VS 2008. Please help me on that.

EDIT: Actually for some security reason I removing registry entry for previous installation. So that I can uninstall it from my application only, which is password protected. So thats why I need to customize that repair/remove option. So that it will appear by seeing some specific registry value. How can I do that ?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

Hello爱情风 2024-10-10 02:20:28

只需将安装项目添加到您当前的解决方案中即可。安装项目使用 Windows Installer 技术,为您提供免费的修复和删除选项。当您进行“简单”安装时,请使用此类项目。如果您想要更多控制(自定义对话框),您应该安装 Wix。它插入到 VS 中,您可以在 XML 中定义安装文件,然后将其编译为 Windows Installer 程序包。

Just add a Setup project to your current solution. A setup project uses the Windows Installer technology which gives you the repair and remove option for free. Use this type of project when you have a "simple" installation. If you want more control (custom dialogs) you should install Wix. It plugs into VS and you can define an installation file in XML which is then compiled to a Windows Installer package.

与往事干杯 2024-10-10 02:20:28

我相信 WIX 更适合您的要求,您可以更好地控制安装程序。

如果您只想从应用程序中卸载应用程序,则可以在安装程序中添加自定义操作(或条件),以验证安装程序操作(修复/删除)是否是从您的应用程序而不是从 ARP 启动。

一种方法是将自定义属性从您的应用程序传递到 msiexec,该属性在您的自定义操作(或条件)中进行测试,并且如果在不设置此属性的情况下执行,则不会让安装程序进程继续进行。

I believe WIX is more suitable for your requirements where you have more control over your installer.

If you only want your application to be uninstalled only from your application, you can probably add a custom action (or Condition) in your installer which validates if the installer action (Repair/Remove) was launched from your application and not from ARP.

One way would to be pass a Custom Property from your application to the msiexec which is tested in your custom action (or Condition) and doesn't let the installer process proceed if executed without setting this property.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文