How to perform Wix Upgrade with custom bootstrapper

為{幸葍}努か 提交于 2019-12-02 04:27:50

What is happening is your old BA is getting called in silent mode with the uninstall switch. I can see your code does have some of the plumbing to handle a command line uninstall although I can't see where you're calling Engine.Plan(LaunchAction.Uninstall).

Q1) I don't believe you have to do anything in particular to let your original BA know you're finished. You just need to exit the install in the normal way.

Q2) Yes I think you're almost there. I suggest you download the WIX source code off git to see how it implements its custom BA. Specifically look at the DetectComplete code:

private void DetectComplete(object sender, DetectCompleteEventArgs e)
{
    // Parse the command line string before any planning.
    this.ParseCommandLine();
    this.root.InstallState = InstallationState.Waiting;

    if (LaunchAction.Uninstall == WixBA.Model.Command.Action)
    {
        WixBA.Model.Engine.Log(LogLevel.Verbose, "Invoking automatic plan for uninstall");
        WixBA.Plan(LaunchAction.Uninstall);
    }

You can see it is checking for the uninstall command line option and immediately kicking off an uninstall.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!