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

Matthias Reuss matthias.mr.reuss at wsa.com
Thu Mar 9 08:35:53 PST 2023


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


More information about the wix-users mailing list