-1

I have a CustomAction inside my MSI Project with a condition of MsiPatchRemovalList, this is because i need to execute this for each patch uninstall process.

This is working properly, when i execute the uninstall patch it is executing the CustomAction and do the process refere to the specific patch without error.

The problem is when i uninstall the MSI, all patches are uninstalled but the event is not fired.

Note: execute in the MSI uninstall is not an option because this event need to do a process specific for each patch

Update: The custom action process is take the MSIPATCHREMOVE element to know the Patch Guid and create a register key using this guid, in the register to have a historic to know what patch was uninstalled

4

1 回答 1

2

您应该能够满足(MsiPatchRemovalList 或 REMOVE="ALL")的条件。

如果您需要知道在卸载产品时已将哪些补丁应用于产品,那么您需要在我假设的安装之前合并对 MsiEnumPatches (或等效)的调用,并执行一些操作,例如在卸载时传递它们命令行:

https://msdn.microsoft.com/en-us/library/windows/desktop/aa370099(v=vs.85).aspx

您可以为每个补丁添加一个包含(例如)其补丁 guid 的注册表项,从而有效地制作您自己的列表。然后,您可以对每个可能的补丁或您的列表进行注册表搜索,并设置类似于标准补丁删除列表的属性。我还没有完全考虑过这一点,但是如果每个补丁都在注册表中添加了一些内容说“我在这里”,那么您就不必过于依赖补丁删除列表,因为您已经创建了自己的列表。

于 2018-03-16T18:58:23.947 回答