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

Matthias Reuss matthias.mr.reuss at wsa.com
Mon Mar 13 01:48:53 PDT 2023


Hi Sean,

thank you for that link and explanation! 
I resolved the issue by making the package non-vital (and making sure that e.Result==Result.Ignore).
I just was missing the overview of which values are accepted and have which meaning, which that table nicely provides.

Best regards

Matthias Reuss

-----Ursprüngliche Nachricht-----
Von: wix-users <wix-users-bounces at lists.wixtoolset.org> Im Auftrag von Sean Hall via wix-users
Gesendet: Donnerstag, 9. März 2023 19:43
An: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Cc: Sean Hall <r.sean.hall at gmail.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.

________________________________



The v4 documentation for the OnExecutePackageComplete action values are at https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwixtoolset.org%2Fdocs%2Freference%2Fapi%2Fwixtoolset.mba.core%2Fbootstrapper_executepackagecomplete_action%2F&data=05%7C01%7Cmatthias.mr.reuss%40wsa.com%7Ca8e2e38a5f134312d54108db20ce35c0%7C1a41b96d457d41ac94ef22d1901a7556%7C0%7C0%7C638139842259015505%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=YBvacp9KZBOTz7Xi6TkmELIqoOfVpOaszvoi5MIMB78%3D&reserved=0.
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.f
> iregiant.com%2F&data=05%7C01%7Cmatthias.mr.reuss%40wsa.com%7Ca8e2e38a5
> f134312d54108db20ce35c0%7C1a41b96d457d41ac94ef22d1901a7556%7C0%7C0%7C6
> 38139842259015505%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoi
> V2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=TZ5EFpJDc
> aHOrTH2N3MFsWkDWxFYTEZE80XPY3FJaVA%3D&reserved=0
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.f
> iregiant.com%2F&data=05%7C01%7Cmatthias.mr.reuss%40wsa.com%7Ca8e2e38a5
> f134312d54108db20ce35c0%7C1a41b96d457d41ac94ef22d1901a7556%7C0%7C0%7C6
> 38139842259015505%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoi
> V2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=TZ5EFpJDc
> aHOrTH2N3MFsWkDWxFYTEZE80XPY3FJaVA%3D&reserved=0
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.f
> iregiant.com%2F&data=05%7C01%7Cmatthias.mr.reuss%40wsa.com%7Ca8e2e38a5
> f134312d54108db20ce35c0%7C1a41b96d457d41ac94ef22d1901a7556%7C0%7C0%7C6
> 38139842259015505%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoi
> V2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=TZ5EFpJDc
> aHOrTH2N3MFsWkDWxFYTEZE80XPY3FJaVA%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%7Ca8e2e38a5f134312d54108db20ce35c0%7C1a41b96d457d41ac94ef22d1901a7556%7C0%7C0%7C638139842259015505%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=TZ5EFpJDcaHOrTH2N3MFsWkDWxFYTEZE80XPY3FJaVA%3D&reserved=0


More information about the wix-users mailing list