Windows   发布时间:2022-05-07  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了安装 – Wix返回错误“在模块中找不到CA或UI入口点”但在dll中使用[CustomAction]大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
首先,为模糊的屏幕截图道歉并且不包括代码中的全名.

我在使用Wix Framework尝试使用dll中的自定义操作时遇到问题.

我正在使用Wix 3.10.2

我在我的解决方案下有一个名为Install.CustomAction的C#Custom Action项目.然后在主Wix项目中引用它.你可以在这看到

安装 – Wix返回错误“在模块中找不到CA或UI入口点”但在dll中使用[CustomAction]

我在主Product.wxs文件中将CA dll引用为二进制文件

<Binary Id="CustomActions.dll" sourceFile="$(var.<porjectname>.Install.CustomAction.TargetDir)<projectname>.CustomAction.CA.dll"/>

现在在一个片段中,我有像这样引用的动作

<CustomAction Id="CA_RestoreDB" BinaryKey="CustomActions.dll" DllEntry="RestoreMobileDB" Execute="immediate" Return="check" />
<InstallExecuteSequence>
  <Custom Action="CA_RestoreDB" After="InstallFinalize"/>
</InstallExecuteSequence>

所以,尽管如此,我希望一切顺利.

在名为CustomAction.cs的实际c#文件中,我使用[CustomAction]属性进行了此设置

[CustomAction]

public ActionResult RestoreMobileDB(Session session)
{
    //String installPath = session.GetTargetPath(TARGETDIR);
    String x = session["INSTALLFOLDER"];
    session.Log("Begin CustomAction1");
    doSomestuff(x,session);

    return ActionResult.success;
}

到目前为止,一切看起来都很好,而且我正在努力工作.但是当我来编译所有内容时,我得到了这个错误

Severity    Code    Description Project File    Line    Suppression State
Error       The command ""C:\Program Files (x86)\WiX Toolset v3.10\bin\..\sdk\MakeSfxCA.exe" "C:\Work Files\Development\<product>\<solution>\<project>.Install.CustomAction\obj\x86\Release\<project>.Install.CustomAction.CA.dll" "C:\Program Files (x86)\WiX Toolset v3.10\bin\..\sdk\x86\SfxCA.dll" "C:\Work Files\Development\<product>\<solution>\<project>Install.CustomAction\obj\x86\Release\<project>.Install.CustomAction.dll" "C:\Program Files (x86)\WiX Toolset v3.10\SDK\Microsoft.Deployment.WindowsInstaller.dll;C:\Work Files\Development\<product>\<solution>\<project>.Install.CustomAction\CustomAction.config"" exited with code 1.    <project>.Install.CustomAction

接下来是这个错误

你知道是什么原因引起的吗?我已经指定了一个入口点,并在我的.wxs文件中引用了dll,但它似乎对我不起作用.

解决方法

我认为它需要:

public static ActionResult ...

大佬总结

以上是大佬教程为你收集整理的安装 – Wix返回错误“在模块中找不到CA或UI入口点”但在dll中使用[CustomAction]全部内容,希望文章能够帮你解决安装 – Wix返回错误“在模块中找不到CA或UI入口点”但在dll中使用[CustomAction]所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签:首先