How to execute multiple launch conditions on installer exit

混江龙づ霸主 提交于 2019-12-05 14:07:00

Fairly straightforward, you'll need two separate actions to "set" WixShellExecTarget - they'll just run at different times.

First, you'll setup the actions that are going to be run.

<CustomAction Id="SetExec1" Property="WixShellExecTarget" Value="[#Application.exe]" />
<CustomAction Id="SetExec2" Property="WixShellExecTarget" Value="[CONFIGWIZARDURL]" />
<CustomAction Id="DoExec" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" Return="ignore" />

Now you want to schedule those actions to actually run, in this example I'm tying all of the actions to the Finish button on the final installation dialog. As we're publishing to a Control element, WiX will automatically set Publish/@Order to one greater than the previous event.

In addition, all these actions are conditioned to only execute during installation as this same dialog is displayed during removal and repair.

You'll likely also want to condition these based on the status of your checkboxes if execution is optional.

<UI>
    <!-- Publish set/do for first action -->
    <Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="SetExec1">
        <![CDATA[NOT Installed]]>
    </Publish>
    <Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="DoExec">
        <![CDATA[NOT Installed]]>
    </Publish>

    <!-- Publish set/do for second action -->
    <Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="SetExec2">
        <![CDATA[NOT Installed]]>
    </Publish>
    <Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="DoExec">
        <![CDATA[NOT Installed]]>
    </Publish>
</UI>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!