Wix, custom dialog when previous version exists

前端 未结 1 2029
鱼传尺愫
鱼传尺愫 2020-11-29 13:14

I\'m making installation for my application with WiX toolset. I want to show custom dialog if previous version found.

Now I don\'t know how to check if there is pre

相关标签:
1条回答
  • 2020-11-29 13:50

    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:

    • Changing text color to Wix dialogs (Customizing WiX GUI)
    • Wix default folder dialog
    0 讨论(0)
提交回复
热议问题