开发者

Sequencing a custom action in WiX before "LaunchConditions"

Is it possible to sequence a custom action before "LaunchConditions"?

This is my custom action:

<CustomAction
    Id="CA_vcAppRunning"
    BinaryKey="vcShowMsg"
    DllEntry="IsAppRunning"
    Return="check"
    Execute="immediate"/>

Sequenced in <InstallExecuteSequence/>

<Custom Action="CA_vcAppRunning" Before="LaunchConditions" />

I tried this, opened the MSI file in Orca and found that my custom action is sequenced at "99". But when I tried to install, it never got called.

I want to schedule this before LaunchConditions as this custom 开发者_Go百科action is supposed to set a property which is used in the LaunchCondition (if the application is running, exit the installer/updater).


Don't schedule it in before LaunchConditions, schedule it after FindRelatedProducts and then add a second custom action that blocks install based on the results from your first CA.

This is the same method used to prevent downgrading in many tutorials, e.g.

<CustomAction Id="CA_BlockOlderVersionInstall" Error="!(loc.LaunchCondition_LaterVersion)" />
<InstallExecuteSequence>
        <LaunchConditions After="AppSearch" />
        <Custom Action="CA_BlockOlderVersionInstall" After="FindRelatedProducts">
            <![CDATA[NEWERVERSIONDETECTED]]>
        </Custom>
</InstallExecuteSequence>
<InstallUISequence>
        <LaunchConditions After="AppSearch" />
        <Custom Action="CA_BlockOlderVersionInstall" After="FindRelatedProducts">
            <![CDATA[NEWERVERSIONDETECTED]]>
        </Custom>
</InstallUISequence>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜