我有非常简单的托管 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,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?