I have a custom bootstrapper application installer which has been worked well with the normal features such as install, uninstall and so on. But now I need to add a upgrade feature for the installer exactly for the bundle, but it always shows the installation UI or uninstallation UI during the installation process of newer bundle installer. I know the old version should be removed during this process but I expect the previous version is removed before the newer version installed and the uninstallation process should be in silence mode.
I am new be with Wix, but I have read lots of articles in StackOverflow, and tried most of the related solutions. Such as the following links:
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
Unfortunately None of them work for me. I don't know the call stacks of the burn engine well, so I post my code to here!
In my code, I have tried the following solutions:
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();
}
}
If anyone could help me to review my code, that would be appreciate. When you have downloaded my code, please change the MsiVersion parameter with a version number and change the ProjectRootDir paramter to be your local path of solution file in the "ccnetcall-build-language-package.bat" file in "Build" folder, and then create the different versions of the installers by launching the bat file.
Thanks in advance!