如何防止在升级过程中显示wix自定义引导程序卸载UI

时间:2019-05-27 06:12:24

标签: wix upgrade burn

我有一个自定义的引导程序应用程序安装程序,该程序可以很好地与常规功能(如安装,卸载等)一起使用。但是现在我需要为捆绑软件的安装程序添加一个完全与捆绑软件相同的升级功能,但是在较新的捆绑软件安装程序的安装过程中,它始终显示安装UI或卸载UI。我知道在此过程中应该删除旧版本,但是我希望在安装新版本之前删除旧版本,并且卸载过程应处于静默模式。

我对Wix还是陌生的,但是我已经阅读了StackOverflow上的许多文章,并尝试了大多数相关解决方案。如以下链接:

How do I detect the currently installed features during a MajorUpgrade using WiX Burn MBA Bundles?

How to perform Wix Upgrade with custom bootstrapper

Wix doesn't remove previous version of burn exe during major upgrade

WiX burn Upgrade shows uninstall UI at the end

不幸的是,他们都不为我工作。我不太了解刻录引擎的调用堆栈,因此我将代码发布到here

在我的代码中,我尝试了以下解决方案:

private void DetectComplete(object sender, DetectCompleteEventArgs e)
{
    if (LaunchAction.Uninstall == WixBA.Model.Command.Action)
    {
    WixBA.Model.Engine.Log(LogLevel.Verbose, "Invoking automatic plan for uninstall");
    WixBA.Plan(LaunchAction.Uninstall);
    }
}


private void BootstrapperApplication_ApplyComplete(object sender, ApplyCompleteEventArgs e)
{
    if (this.model.BootstrapperApplication.Command.Action == LaunchAction.Uninstall && isRelatedBundlePresent) // this will be called in case of Upgrade of the bundle
    {
            CustomBootstrapperApplication.Dispatcher.InvokeShutdown();
    }
}

如果有人可以帮助我查看我的代码,将不胜感激。下载我的代码后,请更改MsiVersion参数的版本号,并将ProjectRootDir参数更改为解决方案文件在“ Build”文件夹中“ ccnetcall-build-language-package.bat”文件中的本地路径,然后然后通过启动bat文件创建不同版本的安装程序。

谢谢!

1 个答案:

答案 0 :(得分:1)

BootstrapperApplication.Command结构包含display字段,您的BA在决定显示(或不显示)UI时应遵循的字段。

在旧版本升级期间,值应该为Display.EmbeddedDisplay.None(我忘了哪个值)。

相关问题