[wix-users] Validate a success full process code form the Bootstrapper

Nicolas Clement nicolas.clement at bbconsult.co.uk
Wed Oct 26 09:17:48 PDT 2016


Hi,

What I'm looking isn't how to return the error code from my bundle to a batch launcher, but the opposite how to get the error code from the batch and return it to my bundle without having my bundle starting to rollback but still been able to know that my batch had an error.

By the way I'm using Wix3.10, c# and Winform.

For this I tried something like:

private void OnExecutePackageComplete(object sender, ExecutePackageCompleteEventArgs e)
{
	If (e.Status == -2147024895)
	{
		e.Result = Result.Continue; // also tried Ignore,Ok,None,Yes
	}
}

But the bundle still rollback.

Also I don't know If it's a bug but the Error EventHandler doesn't catch the error.


Regards,

Nicolas

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Phill Hogland
Sent: 26 October 2016 16:45
To: wix-users at lists.wixtoolset.org
Subject: Re: [wix-users] Validate a success full process code form the Bootstrapper

In general you might want to look at the InstallationViewModel.cs file in the WixTollset source of the WixBA project.  That is a WPF project, but your approach may need to be different if you are using a different display technology.


In WPF your model would hold a 'result' property and a 'state' property in the VM.  In the handlers for PlanComplete and ApplyComplete save the 'result' code to your model.  Your View can present different information depending on your result property and if your 'state' property is InstallationState.Failed or InstallationState.Applied, etc.  You might also want to look at the Executeerror handler.   And when your bundle exits you can call this.Engine.Quit( your-result-code); to pass the result code back as the return code of your bundle.exe, for processing by a batch launcher.


The wix4\src\Setup\WixBA is the approach which I use.  It is a little different from wix3, but the same basic concept.

________________________________
From: wix-users <wix-users-bounces at lists.wixtoolset.org> on behalf of Nicolas Clement <nicolas.clement at bbconsult.co.uk>
Sent: Wednesday, October 26, 2016 9:11:14 AM
To: wix-users at lists.wixtoolset.org
Subject: [wix-users] Validate a success full process code form the Bootstrapper

Hi,

I would like to know how it's possible to have the same behaviour as "<ExitCode Value="" Behavior="success"/>" in my custom Bootstrapper so that I can show an finish message depending on the returned process code of my batch file.

Regards,

Nicolas

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/



More information about the wix-users mailing list