12

I have a strange issue that although not critical I'm wondering why it's happening.

After finishing my fairly complex installer I decided to refactor the code and abstract the different tasks into separate fragments. I have C# CustomAction that is being called after the WriteRegistryValues action.

<InstallExecuteSequence>
    <Custom Action="CA_SSLCertGenerateInstall" After="WriteRegistryValues">
        <![CDATA[NOT REMOVE]]>
    </Custom>
</InstallExecuteSequence>

However when I move the above snippet from the Product.wxs into the Fragment, the dll is not included into the installer and obviously the CustomAction is not called.

When looking at the schema docs (http://wix.sourceforge.net/manual-wix3/wix_xsd_fragment.htm) InstallExecuteSequence is clearly a valid child of Fragment.

caveman_dick
  • 6,302
  • 3
  • 34
  • 49

1 Answers1

13

The contents of the fragment won't be included unless you reference ANY of the elements inside it from Product/Module element. So, in your case you should add the following line to your Product.wxs:

   <CustomActionRef Id="CA_SSLCertGenerateInstall" />

NOTE: the entire contents of that fragment will be included, not just the custom action you reference.

Yan Sklyarenko
  • 31,557
  • 24
  • 104
  • 139
  • It should be noticed that inside a Fragment both CustomAction and Custom elements must be defined. If CustomAction is defined inside one fragment, and calling of this CA is defined in another fragment, then referencing to CA in Product.wxs wouldn't call CA. – Andrey G.A Aug 06 '15 at 12:27