启动64位进程时Wix DLL错误

时间:2013-07-24 09:33:14

标签: c# wix windows-installer

我有wxs

的配置
<CustomAction Id="UninstallDriver" BinaryKey="Setup.CustomActions.dll"
              DllEntry="UninstallDriver" Execute="immediate" Return="check"/>
<Custom Action="UninstallDriver" After="InstallInitialize">Installed AND (NOT REINSTALL)</Custom>

自定义操作:

  /// <summary>
    /// Uninstall driver
    /// </summary>
    /// <param name="session"></param>
    /// <returns></returns>
    [CustomAction]
    public static ActionResult UninstallDriver(Session session)
    {
        try
        {
            session.Log("Start unistalling redirect driver");
            var toolPath = GetPathToFile(session, @"%INSTALLLOCATION%Tools.exe");
            session.Log("Path for tools={0}", toolPath);
            if (!File.Exists(toolPath))
            {
                session.Log("Can't find Tools.exe at specified location");
                return ActionResult.Failure;
            }
            var proc = Process.Start(toolPath);
            proc.StartInfo.Arguments = @"/uninstall";
            proc.Start();
            var exited = proc.WaitForExit(10000);
            if (exited && proc.ExitCode == 0)
            {
                session.Log("Driver uninstall completed");
                return ActionResult.Success;
            }
        }
        catch (Exception ex)
        {
            session.Log("Error while uninstalling driver={0}", ex.Message);
        }
        return ActionResult.Failure;
    }

当它在卸载时调用此自定义操作时,我“无法运行此安装所需的DLL”。但是,当我为x86构建Tools.exe时,没有出现任何问题。如何使它与64x位版本一起使用?

0 个答案:

没有答案
相关问题