简体   繁体   English

WIX removefiles和Windows删除注册表项

[英]WIX removefiles and Windows delete registry entry

I'm been wondering during uninstall, how to control the sequence of removefiles and Windows delete registry entry through WIX. 我一直想知道在卸载过程中,如何通过WIX控制removefiles的顺序以及Windows删除注册表项。

One of my program's registry 我的程序的注册表之一

HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\S-1-5-18\\Products\\GUID\\Transforms HKEY_LOCAL_MACHINE \\ SOFTWARE \\ Microsoft \\ Windows \\ CurrentVersion \\ Installer \\ UserData \\ S-1-5-18 \\ Products \\ GUID \\ Transforms

is deleted before removefiles. 在删除文件之前被删除。 If then removefiles failed, the uninstall process abort. 如果之后removefiles失败,则卸载过程将中止。 But the registry is already deleted, that would be a disaster。 但是注册表已被删除,那将是一场灾难。

I would recommend adding a new custom action that will be scheduled to run after removefiles during uninstallation and that will clean up the registry as you need. 我建议添加一个新的自定义操作,该操作将在卸载过程中计划在removefiles之后运行,并将根据需要清理注册表。 At the same time you will need another custom action that will be scheduled to run during installation and that will create the registry entries. 同时,您将需要另一个自定义操作,该操作将安排在安装期间运行,并将创建注册表项。 Therefore you would have to remove your registry definitions out of WiX XML. 因此,您将必须从WiX XML中删除注册表定义。

The custom actions can be written even as shell commands I believe. 我相信这些自定义操作甚至可以编写为shell命令。 Otherwise writing C# custom actions is also a good option. 否则,编写C#自定义操作也是一个不错的选择。

Please don't forget when creating the conditions when to run the custom actions on cases as minor/major upgrades and repair. 创建条件时,请不要忘记对案例进行小/大升级和维修时运行自定义操作的时间。 Fiddling the right conditions might be quite tedious. 摆弄正确的条件可能很繁琐。 However all this really depends on your installation scenarios. 但是,所有这些实际上取决于您的安装方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM