Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom Action not running if located in separate file

If I write the code below in a product block then it works fine but if I write it in a separate file then it is not working.

Please can anyone tell me why this thing happens?

This is separate file code for custom action:

<?xml version="1.0" encoding="UTF-8"?>
<?include SetupDefines.wxi?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Fragment>

    <!-- The custom action DLL itself.-->
    <Binary Id="CA" SourceFile="..\bin\debug\Name.CA.dll" />

    <CustomAction Id="CustomAction1"
              BinaryKey="CA"
              DllEntry="CustomAction1"
              Execute="immediate"
              Return="check" />

    <!--Custom Actions END-->
    <InstallExecuteSequence>

      <Custom Action="CustomAction1" Before="InstallFiles">
        <![CDATA[NOT Installed]]>
      </Custom>

    </InstallExecuteSequence>
  </Fragment>
</Wix>
like image 377
Rikin Patel Avatar asked Dec 26 '22 21:12

Rikin Patel


1 Answers

The linker will only include fragments that it encounters while resolving references.

Use a CustomActionRef element in your product wxs to ensure that the linker includes the fragment.

like image 73
Wim Coenen Avatar answered Dec 29 '22 12:12

Wim Coenen