[wix-users] CustomAction does not seem to be called from the msi

Edwin Castro egcastr at gmail.com
Tue Feb 7 11:13:15 PST 2017


On Tue, Feb 7, 2017 at 12:13 AM, Urban Olars <urban.olars at gmail.com> wrote:
> Hi,
>
> I am trying to learn how to write custom actions in C++ and how to use them
> in my msi installation project. Unfortunately with no luck so far. I have
> looked at numerous examples I have found on internet but still have not
> found out what I am doing wrong. I kindly ask for input from someone on
> this mailing list. Thank you in advance.
>
>
> This is part of the code in my *.wxs file:
> <Binary Id="CAICRoot"
> SourceFile="..\CustomActions\CustomActions\bin\Release\CustomActions.dll" />
> <CustomAction Id="IronCADRootDirectory" BinaryKey="CAICRoot"
> DllEntry="GetICRootDir" Execute="firstSequence" HideTarget="no" />
>
> <InstallExecuteSequence>
> <Custom Action='IronCADRootDirectory' Before='InstallInitialize'/>
> <RemoveExistingProducts Before="InstallInitialize"></RemoveExistingProducts>
> </InstallExecuteSequence>
>
> <Condition Message="IronCAD root directory not found. Installation
> aborting">
> <![CDATA[ICROOTDIR]]>
> </Condition>
> ...
> ...
>

Check the InstallExecuteSequence table in your compiled MSI in Orca or
InstEdit. I expect that the LaunchConditions action is scheduled to
run before IronCADRootDirectory. In other words, you are checking if
the ICROOTDIR property is set well before your custom action runs. If
this is the case then scheduling the custom action before
LaunchConditions should fix it:

<InstallExecuteSequence>
  <Custom Action="IronCADRootDirectory" Before="LaunchConditions"/>
</InstallExecuteSequence>

--
Edwin G. Castro


More information about the wix-users mailing list