我有非常简单的托管CA,它使用Microsoft.Deployment.WindowsInstaller:
[CustomAction]
public static ActionResult TestDtf(Session session)
{
MessageBox.Show("Test");
ActionResult result = ActionResult.Success;
return result;
}
我用net4编译它。我在InstallShield2012中有一个托管CA,它存储在二进制表中,方法签名为method=TestDtf、arguments=value:MsiHandle、arguments=value:MsiHandle
我不确定我说得对,但这也不是我眼前的问题。问题似乎是msiexec只查找Microsoft.Deployment.WindowsInstaller.dll的系统文件夹,而不是像我刚刚安装这个程序集并确认它在CopyFiles之后的文件夹。
以下是部分日志:
InstallShield: Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Deployment.WindowsInstaller, Version=3.0.0.0, Culture=neutral, PublicKeyToken=ce35f76fcda82bad' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.Deployment.WindowsInstaller, Version=3.0.0.0, Culture=neutral, PublicKeyToken=ce35f76fcda82bad'
at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters()
at System.Reflection.RuntimeMethodInfo.GetParameters()
at InstallShield.ClrHelper.CustomActionHelper.PrepareParameters(EntryPointInfo info, Boolean& anyHidden)
如果我手动将Microsoft.Deployment.WindowsInstaller.dll放到syswow64中,它就会加载得很好。我不确定我想把这个安装到我们的客户系统文件夹.
如何设置我的安装程序以便它能够找到Microsoft.Deployment.WindowsInstaller.dll?
发布于 2013-10-27 05:52:10
你搞错了。当您构建DTF项目FOO时,您将得到FOO.DLL和FOO.CA.DLL,它是作为Windows自定义操作添加到InstallShield中的。DTF将FOO.DLL封装在FOO.CA.DLL中,并为您打包任何其他文件,包括Microsoft.Deployment.WindowsInstaller.dll互操作。
看一看:
http://blog.iswix.com/2008/05/deployment-tools-foundation-dtf-managed.html
将FOO.CA.DLL重命名为FOO.CA.ZIP,并在7 7Zip或WinZip中打开它。你会看到其他文件在那里。
发布于 2013-10-27 05:05:32
解决这个问题的方法是在以下ISClrWrap
表中创建一个条目:
Action: {nameOfCustomAction}
Name: Dependency0
Value: Path to the dependency in this case Microsoft.Deployment.WindowsInstaller.dll (you can use a path variable with this)
https://stackoverflow.com/questions/19611471
复制相似问题