首页 文章

执行后安装文件后的Wix自定义动作DLL

提问于
浏览
2

我正在使用DLL安装一个打包在msi中的驱动程序 . 以下是片段:

<Binary Id="CustomAction2.CA.dll"
src="../artifacts/CustomAction2.CA.dll" />

<CustomAction Id="Install"                
        Execute="deferred"
        BinaryKey="CustomAction2.CA.dll" 
        DllEntry="CustomAction1" />

<CustomAction Id="InstallWithProperty"
        Property="Install"
        Value="location=[DEFAULT_INSTALLDIR]$FULL_NAME;name=myDll.dll" Execute="immediate"/>        


<InstallExecuteSequence>      
<Custom Action="InstallWithProperty" After="InstallInitialize"/>
<Custom Action="Install" After="InstallFiles" />
</InstallExecuteSequence>

我面临同样的问题 . 当调用自定义操作时,它说 .

自定义操作引发的异常:System.Reflection.TargetInvocationException:调用目标已抛出异常 . ---> System.DllNotFoundException:无法加载DLL“myDll.dll”:找不到指定的模块 . (更新来自HRESULT:0x8007007E)CustomAction2.CustomActions.ConfigDriver(IntPtr hwndParent,UInt16 fRequest,String lpszDriver,String lpszArgs,String lpszMsg,UInt16 cbMsgMax,Int64&pcbMsgOut)在CustomAction2.CustomActions.CustomAction1(会话会话)---结束System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo方法,Object target,Object arguments,Signature sig)中的System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo方法,Object目标,Object参数,SignatureStruct&sig,MethodAttributes methodAttributes,RuntimeType typeOwner)的内部异常堆栈跟踪System.Reflection.RuntimeMethodInfo.Invoke的System.Reflection.RuntimeMethodInfo.Invoke(Object obj,BindingFlags invokeAttr,Binder binder,Object parameters,CultureInfo culture,Boolean skipVisibilityChecks)中的,MethodAttributes methodAttributes,RuntimeType typeOwner(Object obj,BindingFlags invokeAttr,Binder在Microsoft.Depl上的binder,Object parameters,CultureInfo culture) oyment.WindowsInstaller.CustomActionProxy.InvokeCustomAction(Int32 sessionHandle,String entryPoint,IntPtr remotingDelegatePtr)CustomAction Install返回实际的错误代码1603(注意如果翻译发生在沙箱内,这可能不是100%准确)

有人可以帮忙 . 我想使用myDll.dll进行进一步安装,这是.msi文件的一部分 .

1 回答

  • 0

    您正在传递mydll.dll,这意味着它将尝试在运行DTF CA的当前目录/ temp目录中找到它 . 而是传递文件的文件密钥 . (File @ Id属性) .

    name = [#myDLL.dll]这将格式化为类似C:\ Program Files \ My Company \ My Product \ myDLL.dll

    另一种方法是将DLL添加到CA项目中,以便将其打包到CA中并在安装时解压缩到CA当前目录 .

相关问题