So I use WiX 3.8 with a custom BootstrapperUI. For the custom UI i use WiX WPF.
For the moment i use a full setup even for updating the program.
When you start the bootstrapper you can choose between uninstall and update (if the program is already installed).
When you choose update a componentdialog is shown where you can see the optional and vital components depending on the previous installation.
Next, two configuration pages are displayed.
Until this point everything works very reliable, but when i start the installation(Update) it drives me crazy:
I most cases it works fine and everything is going how it should. But sometimes it just did nothing.
For the update i use
<RemoveExistingProducts After="InstallInitialize" />
so that normally everything will be uninstalled before the new version is installed. But when it fails to update, the packages seem to be just skipped. A big problem for me to resolve the problem is, i was not able to reproduce that error.
My first attempt to search for a reason was to check the prerequisites, but they were fine. Next i checked the bootstrapperlog, but it says the the components just were not chosen for installing.
Here is the C# code i use for determining what the user had chosen:
public override void OnPlanPackageBegin(WPFBootstrapperEventArgs<Wix.PlanPackageBeginEventArgs> args)
{
base.OnPlanPackageBegin(args);
string msg = "";
if (Inst && !forceabsent) {
if (update) {
bool displayed = false;
foreach (WixPackage item in config.pkgInfo.Packages) {
if (item.Package == args.Arguments.PackageId) {
displayed = true;
if (item.isChecked) {
break;
}
else {
args.Arguments.State = Wix.RequestState.None;
}
}
}
if (!displayed) {
args.Arguments.State = Wix.RequestState.None;
}
}
else {
foreach (WixPackage item in config.pkgInfo.Packages) {
if (item.Package == args.Arguments.PackageId) {
if (item.isChecked) {
}
else {
args.Arguments.State = Wix.RequestState.None;
}
}
msg += item.DisplayName + " " + item.isChecked + "\n";
}
}
}
if (forceabsent) {
foreach (WixPackage item in config.pkgInfo.Packages) {
if (item.Package == args.Arguments.PackageId) {
args.Arguments.State = Wix.RequestState.ForceAbsent;
}
}
}
}
Do you have any suggestions what else i can check to determine why the update is not working?
Sooo i found the answer myself, just because i stumbled randomly about a table which explained, that the condition Remove="ALL"
also applies for modify and upgrade.
But that does not explains the randomness.
the product i installed in this package is also available as standalone and i forgot to check that. So it only occured when someone tried to upgrade his version and he installed all components with the same bundle.
Thanks to all who have thought about a solution to my problem ;)