[wix-users] Actions based on return code of ExePackage?

Sean Hall r.sean.hall at gmail.com
Thu Mar 9 10:43:21 PST 2023


The v4 documentation for the OnExecutePackageComplete action values are at
https://wixtoolset.org/docs/reference/api/wixtoolset.mba.core/bootstrapper_executepackagecomplete_action/.
It probably is the same for v3.

If a vital package fails then the engine will rollback. Due to all of the
complexities around dependency checking, that's probably not ever going to
be something that the BA can change during execution.

It looks like the raw exit code is never given to the BA. You could create
a feature request for that.

On Thu, Mar 9, 2023 at 10:36 AM Matthias Reuss via wix-users <
wix-users at lists.wixtoolset.org> wrote:

> Thank you for this idea. So Result.Ok is not taken into account when
> deciding whether or not to continue? Is there some documentation available
> for the various values of the Result enum - Ok, Continue, Ignore, ...?
>
> Best regards
>
> Matthias Reuss
>
> -----Ursprüngliche Nachricht-----
> Von: wix-users <wix-users-bounces at lists.wixtoolset.org> Im Auftrag von
> Nir Bar via wix-users
> Gesendet: Donnerstag, 9. März 2023 17:13
> An: wix-users at lists.wixtoolset.org
> Cc: Nir Bar <nir.bar at panel-sw.com>
> Betreff: Re: [wix-users] Actions based on return code of ExePackage?
>
> CAUTION: This email originated from outside the organization. Do not click
> links or open attachments unless you recognize the sender and know the
> content is safe.
>
> ________________________________
>
>
>
> 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
> https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.firegiant.com%2F&data=05%7C01%7Cmatthias.mr.reuss%40wsa.com%7C5b1f79a275554fc07b1508db20b92aaf%7C1a41b96d457d41ac94ef22d1901a7556%7C0%7C0%7C638139751868818068%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=hOcgZiyPZZ0ihTU0DJgEUVk36UHW3cxQfSB6k%2BdoaAg%3D&reserved=0
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.firegiant.com%2F&data=05%7C01%7Cmatthias.mr.reuss%40wsa.com%7C5b1f79a275554fc07b1508db20b92aaf%7C1a41b96d457d41ac94ef22d1901a7556%7C0%7C0%7C638139751868818068%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=hOcgZiyPZZ0ihTU0DJgEUVk36UHW3cxQfSB6k%2BdoaAg%3D&reserved=0
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/
>


More information about the wix-users mailing list