Wix, custom dialog when previous version exists

烂漫一生 提交于 2019-11-27 05:41:55

Next / Back Button Override: I am no GUI expert, in fact it is a neglected area (GUI is always suppressed for corporate deployment), but I believe something like this can work - redefining the Next and Back buttons - 3 dialogs involved:

<!-- 1. OldVersionDlg showing -->
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" 
         Value="OldVersionDlg">LicenseAccepted = "1" AND PREVIOUSVERSIONSINSTALLED</Publish>

<Publish Dialog="SetupTypeDlg" Control="Back" Event="NewDialog" 
         Value="OldVersionDlg">PREVIOUSVERSIONSINSTALLED</Publish>

<!-- 2. OldVersionDlg dialog not showing -->
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" 
         Value="SetupTypeDlg">LicenseAccepted = "1" AND NOT PREVIOUSVERSIONSINSTALLED</Publish>

<Publish Dialog="SetupTypeDlg" Control="Back" Event="NewDialog" 
         Value="LicenseAgreementDlg">NOT PREVIOUSVERSIONSINSTALLED</Publish>

Actual Dialog Sequences:

  1. LicenseAgreementDlg <-> OldVersionDlg <-> SetupTypeDlg

  2. LicenseAgreementDlg <-> SetupTypeDlg

To be sure, remember to test in all installation modes: install, upgrade, repair, modify, patching, uninstall (and there are stranger shores such as resumed installs - rarely seen).

In closing: is this feature really necessary? I find that features like these often cause more bugs than benefits, but that is just a personal opinion. In fact I wrote an answer a long time ago on how to implement such an upgrade check without using setup dialogs.


Some Links:

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