自定义“修复"和“卸载" MSI安装程序的功能(从“控制面板"调用时) [英] Custom "Repair" and "Uninstall" functions for MSI installers (when called from the Control Panel)

查看:209
本文介绍了自定义“修复"和“卸载" MSI安装程序的功能(从“控制面板"调用时)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

添加/删除程序(或程序和功能)控制面板小程序通常允许卸载或修复程序.

对于非MSI安装,当用户单击更改"或卸载"按钮时,很容易定义应该发生的情况.只需在注册表(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\<AppName>)中设置适当的键即可.

我的问题是,如果使用MSI安装,如何使更改",修复"和卸载"按钮按我的方式工作(例如,启动自定义程序)?

解决方案

如果您使用的是MSI,请以MSI方法进行操作.

如果要执行其他操作,请不要使用MSI.首先,您会给自己带来很多麻烦,并且会失去使用MSI的好处.

如果在卸载过程中需要运行自己的EXE,请,然后使用上面指定的注册表项为您的自定义安装程序手动添加ARP条目.

The Add/Remove Programs (or Programs and Features) Control Panel applet usually allows to uninstall or repair a program.

For a non-MSI installation it's easy to define what should happen, when a user clicks the "Change" or "Uninstall" button. Just set the appropriate keys in the Registry (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\<AppName>).

My question is how to make the "Change", "Repair", and "Uninstall" buttons to work my way (e.g. to start a custom program) if an MSI-installation is used?

解决方案

If you're using an MSI, do it the MSI way.

If you want to do something different, then don't use an MSI. You'll give yourself many, many headaches and lose the benefits of using MSI in the first place.

If you need to run your own EXE during uninstall, see my answer to this question and simply just negate the conditions.

One thing you have to remember with an MSI installation is that the user interface is optional, you can't count on it being displayed either during install or uninstall. A user might remove an application with MSIEXEC /X rather than clicking a button in ARP

If you really want to "do it your way" then I'd suggest creating a bootstrapper for the MSI, having the MSI install hide itself from Add/Remove Programs, and then manually add an ARP entry for your custom installer using the registry keys you have specified above.

这篇关于自定义“修复"和“卸载" MSI安装程序的功能(从“控制面板"调用时)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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