[wix-users] Actions based on return code of ExePackage?
Nir Bar
nir.bar at panel-sw.com
Thu Mar 9 08:12:45 PST 2023
You can set in the package Vital="no" and in ExecutePackageComplete set e.Result = Result.Ignore--Nir BarWiX Expert ---- On Thu, 09 Mar 2023 17:30:48 +0200 wix-users at lists.wixtoolset.org wrote ----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
____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/
More information about the wix-users
mailing list