views:

295

answers:

1

HI All,

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 in Orca and foud that my custum 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 action is supposed to set a property which is used in the LaunchCodition. (If application is running exit the installer/updater).

Thanks, Rahul Muley

+1  A: 

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>
sascha