Question

I have created a Bootstrapper with WiX. It contains a chain with two MSI-Packages. When it is running, It is calling a .NET-CustomAction which is showing a View (like this sample: http://bryanpjohnston.com/2012/09/28/custom-wix-managed-bootstrapper-application), where the User can choose some settings.

Now, I have to install the first msi only, when the user is choosing a special setting in this view. I am searching now a way to do this. The simplest way would be, that I can run the MSI-Installation from my .NET-class (ViewModel). But how can I access the MSI-Package which is included in the MSI-Bootstrapper and run it?

Était-ce utile?

La solution

When Burn plans your MSI packages, it will callback with the "requested state" for each package that you can override. To see this attach to the PlanPackageBegin event. That event is provided the PlanPackageBeginEventArgs. In those event args you will see the State field that will tell you what Burn would do for that package by default. You can set that State field to any RequestState you want.

For example, if the package is absent and you Plan() an LaunchAction.Install then the State would be RequestState.Present. Your custom BA code can change that to whatever RequestState you want. Thus your UI could say, "I know you think you should install that package but this user unchecked the box that says install the FooWidget so make that package RequestState.Absent."

The log file will show you the result of the plan and can be very useful when debugging.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top