I am bundling a MSI package with the .NET 4.0 framework installer in Burn. Since i do not like the userinterface Burn applies, i have written my own custom Bootstrapper Application. The .NET framework is installed correctly, if it is not already installed. But i can not figure out how to install the MSI package. This is the code i have for my custom BA, i have checked that it gets executed.
public class ShopProtectBA : BootstrapperApplication
{
protected override void Run()
{
//Here i would like to run the bundled MSI package.
Engine.Quit(0);
}
}
The documentation on this is sparse. Should i not install the package in Run() ? How do this ting work?
Edit: I forgot to mention that is is a custom Managed Bootstrapper Application. If it makes any difference.
The best i can come up with is this:
var pl = new PlanMsiFeatureEventArgs("MyMsiPackage", "Complete", FeatureState.Local);
Engine.Detect();
OnPlanMsiFeature(pl);
Engine.Plan(LaunchAction.Install);
Engine.Elevate(FindWindow(null, "Setup"));
Engine.Apply(FindWindow(null, "Setup"));
But it results only in a window telling me that the installation is prepared. Then i closes and nothing more happends.