如果位于单独的文件中,则自定义操作未运行

Rik*_*tel 4 custom-action wix

如果我在产品块中编写下面的代码然后它工作正常但如果我在一个单独的文件中写它然后它不工作.

请有人能告诉我为什么会发生这件事吗?

这是自定义操作的单独文件代码:

<?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>
Run Code Online (Sandbox Code Playgroud)

Wim*_*nen 7

链接器将仅包含在解析引用时遇到的片段.

在产品wxs中使用CustomActionRef元素以确保链接器包含片段.