wix: upgrade didn't remove the earlier product from ARP

南笙酒味 提交于 2021-01-28 11:45:39

问题


Using Wix 3.5, my initial MSI package (MyProduct v1.0) contained quite a few features, e.g. MS Word 95/XP/2003/2007/2010, MS Excel 95/XP/2003/2007/2010, MS PowerPoint 95/XP/2003/2007/2010. Their feature level was initially set to 0 but set to 1 if the specific app existed (using AppSearch). In other words, if MS Office 2003 was installed, only Word 2003, Excel 2003 and PowerPoint 2003 features had level=1, and the rest remained as 0.

Recently I made the upgrade MSI package (MyProduct v2.0) using the same approach people said, such as, in How to implement WiX installer upgrade?

And I scheduled "RemoveExistingProducts" After="InstallValidate" in "InstallExecuteSequence".

Here is a fatal bug: suppose the user had MS Office 2003 when he installed MyProduct v1.0. Now he upgraded MS Office to Office 2007 (therefore Office 2003 no longer exists), before he upgrades MyProduct to v2.0. My installer can't handle this. Why? I've tried to remove the old features (e.g. Word 2003, etc.) using the type 1 custom action by calling MsiSetFeatureState function. Although that function returned ERROR_SUCCESS, their states didn't get set to ABSENT but remained as NULL (I know the feature levels for Word 2003 etc. are 0 since they don't exist any more, and I believe that's why feature state unchanged), and I gave up eventually. (If you have any idea to make it work, please guide me to the light!!!)

Anyway, my main question is not about the above bug. For now, I am more concerned about unable to remove the existing product, v1.0:

Case1: upgrade without upgrading MS Office (works)

When I tested the upgrade without upgrading MS Office, the upgrade works, and there is only one entry (MyProduct v2.0) in Add/Remove Program (aka ARP): the upgrade removed the earlier product entry from ARP.

Case2: upgrade after upgrading MS Office (disaster)

However, if I upgrade Office from Office 2003 to Office 2007 and then perform the MSI upgrade, not only Word 2003 feature / Word 2007 feature were installed, but also there are two entries (MyProduct v1.0 and MyProduct v2.0) in ARP. If I tried to uninstall v1.0 in ARP, it seemed to uninstall it, but if I refresh ARP, v1.0 re-appears, so I couldn't even uninstall v1.0.

I compared the log files generated for both cases but it didn't tell me why. And I have no idea why. Can anyone help me?

来源:https://stackoverflow.com/questions/9918455/wix-upgrade-didnt-remove-the-earlier-product-from-arp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!