WIX: How can I uninstall a previous MSI built using a VS *.vdproj

血红的双手。 提交于 2019-12-24 15:30:26

问题


I'm using WIX to create a new installer for an existing product. The installer is very simple - just drops a few dll's into a specified folder on disk.

In the field, my users already have that folder with old dll's in them (since they installed the old MSI - created using a *.vdproj project in VS).

My problem is that after I install the WIX, I have both the old MSI and the new Wix MSI appear in Add/Remove. Expected (? since these 2 are two different kind of MSI's?). I need some kind of an upgrade mechanism - so I was wondering if I can call the old MSI uninstaller from within the WIX one. Or alternately somehow take care of the old Add/Remove entry (a registry hack perhaps?)


回答1:


Assuming the old install and the new install are installed using the same context ( per-user -> per-user or per-machine -> per-machine ) you can use a MajorUpgrade rule to find the old version and get rid of it. You can do this by syncing up the UpgradeCode property and using a higher ProductVersion or you can do it by authoring a second Upgrade rule using the legacy UpgradeCode GUID.

If the old install was per-user and you want the new install to be per-machine you are out of luck. This isn't supported by MSI. Typically I only support per-machine installs and hardcode the ALLUSERS property and remove the CustomerInformation dialog from the installer UI experience. This is not the default experience for VDPROJ based installers.



来源:https://stackoverflow.com/questions/31814392/wix-how-can-i-uninstall-a-previous-msi-built-using-a-vs-vdproj

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