Open icnocop opened 1 year ago
This was the behavior requested in https://github.com/wixtoolset/issues/issues/5950. I believe the correct way to address this is to change the ExePackage
so it does not require user interaction when uninstalling.
Re-evaluating the DetectCondition
would require going through the whole Detect
cycle. We thought that doing that during Apply
was not the right thing to do.
Permanent
packages are never rolled back. I don't see us adding any other way to preventing rollback. I guess we could add the ability to disable rollback on a package only in this specific case when its failure caused the bundle to rollback but I don't know if that's a good idea.
We should not optimize for cases that involve user interactivity in the middle of a chain (execution or rollback).
This is the WiX v4 behavior. We could discuss changing that behavior in WiX v5 but as Sean points out, it's problematic.
Bugs
Which version of WiX are you building with? 4.0.0-rc.4
Which version of Visual Studio are you building with (if any)? Visual Studio 2022 17.5.3
Which version of the WiX Toolset Visual Studio Extension are you building with (if any)? N/A
Which version of .NET are you building with? .net 6.0
If the problem occurs when installing your packages built with WiX, what is the version of Windows the package is running on? Windows Server 2022 Standard 21H2
Describe the problem and the steps to reproduce it.
If an
ExePackage
installation fails, the bundle will still try to rollback theExePackage
by runningUninstallArguments
. However, since the installation fails, there's nothing to rollback.For example, if the
ExePackage
has a UI and the user cancels theExePackage
from installing, the bundle will start to perform a rollback. As part of the rollback, theExePackage
will be run again withUninstallArguments
. If theExePackage
displays its UI again, the user has to now cancel/close theExePackage
again.I did not expect the
ExePackage
to rollback because theExePackage
was not installed.For example, the
ExePackage
may also have its own rollback mechanism.Maybe the
DetectCondition
should be re-evaluated to determine if theExePackage
was successfully installed or not. For example, if theExePackage
returned an exit code which indicates an install failure andDetectCondition
re-evaluates tofalse
, then a rollback should not be performed.Another option could be to dd a
DisableRollback
attribute to theExePackage
which can be set toyes
for example which indicates to not rollback theExePackage
in case of a failure.Thank you.