views:

74

answers:

2

Is there any way to execute a custom action in WIX as soon as the first dialog (welcome) appears?

The requirement is to check prerequisites, and some of those require a custom action.

The custom action could be executed as we click to the next dialog, but then the standard WIX prereqs are determined apart from our custom prereq.

(The custom action we need is to check that IIS 6 Metabase Compatibility is turned on and a registry search does not work on x64 machines with a 32-bit installer)

A: 

Add something like:

<Custom Action="MyCustomAction" Before="FindRelatedProducts">1</Custom>
  • Instead of FindRelatedProducts you may need to place other standard action. You can simply open your current msi in Orca to see InstallExecuteSequence.
  • Instead of "1" condition you may need to place something another.
VitalyVal
There isn't a Before attribute on the Custom element beneath Product? Can you give some more context?
jbloomer
http://www.tramontana.co.hu/wix/lesson10.php#10.1 - here for example is code with using custom actions (but instead of "Before" the "After" is used).
VitalyVal
+1  A: 

I use something like this...

<InstallExecuteSequence>
        <Custom Action="CA_DoSomething" After="FindRelatedProducts">
            <![CDATA[1]]>
        </Custom>    
</InstallExecuteSequence>
<InstallUISequence>
        <Custom Action="CA_DoSomething" After="FindRelatedProducts">
            <![CDATA[1]]>
        </Custom>
</InstallUISequence>

<CustomAction Id="CA_DoSomething" Error="Error message goes here" />
sascha
I couldn't get this to work, I've had success at the end of the install sequence after install, but not immediately.
jbloomer
Works perfectly for me with type 19 (error) actions, it could be a problem with the CA rather than the sequencing. (i.e. you can't schedule deferred actions this early)
sascha