[wix-users] Actions based on return code of ExePackage?
Matthias Reuss
matthias.mr.reuss at wsa.com
Thu Mar 9 07:30:48 PST 2023
My bundle calls a third-party EXE with several return codes, not all of which indicate errors. For one of these return codes (here: 200), I want to continue installation, but trigger an additional action (here: write a log message).
Therefore I implemented the handler in ExecutePackageComplete :
if (e.PackageId.ToLower().Contains("ThisExe"))
{
_model.LogMessage($"This Exe returned Status={e.Status}, result={e.Result}. ");
if (e.Status == 0xc8 /*200*/ || e.Status == unchecked((int)0x800700c8))
{
e.Result = Result.Ok; //I want to continue installation!
_model.LogMessage($"Status is {e.Status}, set the result to {e.Result}");
}
else if (e.Status != 0)
{
_model.LogMessage($"Error in This Exe; Status is {e.Status}, result is {e.Result}");
}
}
If I interpret this return value as acceptable in the bundle with
<ExitCode Value="200" Behavior="success"/>
Burn does not set e.Status to the same value, but to 0, not writing any of these log messages.
If I leave out that special treatment of Status 200, I get the expected line in the log, but the bundle rolls back even though I have set e.Result=Result.Ok.
So does the engine ignore that value of e.Result having been set in ExecutePackageComplete? Is there another way to do some action and make the installation continue?
Best regards
Matthias Reuss
More information about the wix-users
mailing list