0

我有非常简单的托管 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:M​​siHandle,Parameter:Microsoft.Deployment.WindowsInstaller

我不确定我是否正确,但即使这也不是我的直接问题。问题似乎是 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?

4

2 回答 2

2

你对这一切都错了。当您构建 DTF 项目 FOO 时,您将获得 FOO.DLL 和 FOO.CA.DLL。它是作为 Windows Installer DLL 自定义操作添加到 InstallShield 的 FOO.CA.DLL。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 并在 7Zip 或 WinZip 中打开它。您将在那里看到其他文件。

于 2013-10-27T05:52:10.043 回答
0

看起来解决这个问题的方法是在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)
于 2013-10-27T05:05:32.910 回答