首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何使MSI (使用InstallShield)从我的应用程序安装目录加载Microsoft.Deployment.WindowsInstaller dll?

如何使MSI (使用InstallShield)从我的应用程序安装目录加载Microsoft.Deployment.WindowsInstaller dll?
EN

Stack Overflow用户
提问于 2013-10-26 20:20:39
回答 2查看 1.4K关注 0票数 0

我有非常简单的托管CA,它使用Microsoft.Deployment.WindowsInstaller:

代码语言:javascript
运行
复制
[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之后的文件夹。

以下是部分日志:

代码语言:javascript
运行
复制
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?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 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中打开它。你会看到其他文件在那里。

票数 2
EN

Stack Overflow用户

发布于 2013-10-27 05:05:32

解决这个问题的方法是在以下ISClrWrap表中创建一个条目:

代码语言:javascript
运行
复制
Action: {nameOfCustomAction}
Name: Dependency0
Value: Path to the dependency in this case Microsoft.Deployment.WindowsInstaller.dll (you can use a path variable with this)
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19611471

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档