在“添加/删除程序"中隐藏卸载程序? [英] Hide the uninstaller in Add/Remove Programs?

查看:110
本文介绍了在“添加/删除程序"中隐藏卸载程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Visual Studio 2005创建Windows安装程序项目.

I am creating windows installer project using Visual Studio 2005.

是否有一个选项使我的项目在添加/删除程序"中没有卸载选项?

Is there an option make it so that my project does NOT have an uninstall option in Add/Remove programs?

我的一位客户要求我这样做.这是为什么:因为安装程序是现有程序的补丁程序.卸载后,该程序将不再起作用,因为已修补的文件将被卸载.我们没有想办法还原被替换的文件(我们无法使用此安装程序来进行恢复),而是想知道是否有可能禁用卸载.

One of my customers has asked me to do this.. Here's Why: Because the installer is a patch to an existing program. After uninstalling, the program no longer works because the patched files get uninstalled. Instead of figuring out a way to restore the replaced files (which we haven't been able to do with this installer), we're wondering if it is possible to disable the uninstall.

推荐答案

您只需要使用

You just need to set ARPSYSTEMCOMPONENT=1 in the Property table of the installer using Orca (Can't be done directly in Visual Studio from what I know)

通常在程序安装依赖项时使用,并且您不希望用户手动卸载依赖项,他们需要使用您提供的特定卸载脚本或其他方式.

This is commonly used when a program installs dependencies and you don't want the user to uninstall dependencies by hand, they need to use a specific uninstall script you've provided or something.

就我个人而言,我会将该补丁编写为补丁,并防止将其卸载.

Personally, I would author the patch as a patch and prevent the patch from being uninstalled.

我也建议您提取权威指南Windows Installer ,它将为您提供有关如何使用此类技巧的原因,原因和位置的一些说明.不仅可以使您对Windows Installer基本知识有一个很好的了解,而且可以帮助您从长远来看设计一个更好的安装程序.本书中的所有示例均使用

Also I suggest picking up a copy of The Definitive Guide to Windows Installer which will give you some explanation on how, why and where you should use tricks such as this. As well as giving you a really good understanding of the windows installer fundementals and help you to design a better installer in the long run. All the examples in the book use Visual Studio + free tools from the Windows Installer SDK.

编辑:用户仍然具有通过MSIEXEC进行卸载的完全控制权,可以通过您提供的自定义卸载快捷方式进行隐藏,所有这些操作就是隐藏添加/删除程序(ARP)"中的条目

The user still has full control to uninstall via MSIEXEC, via a custom uninstall shortcut that you provide, all this does is hide the entry in Add/Remove Programs (ARP)

Edit2 :示例VBS以添加属性(如果要在自动构建过程中添加)

Sample VBS to add the property (if you want to do so as part of an automated build process)

Dim installer, database, view

Set installer = CreateObject("WindowsInstaller.Installer")
Set database = installer.OpenDatabase ("test.msi", 1)

Set view = database.OpenView ("INSERT INTO Property(Property.Property, Property.Value) VALUES('ARPSYSTEMCOMPONENT', '1')")
view.Execute

Set database = Nothing
Set installer = Nothing

这篇关于在“添加/删除程序"中隐藏卸载程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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