Bootstrapper.ManagedBA.ManagedBA_DetectPackageComplete C# (CSharp) Méthode

ManagedBA_DetectPackageComplete() private méthode

Method that gets invoked when the Bootstrapper DetectPackageComplete event is fired. Checks the PackageId and sets the installation scenario. The PackageId is the ID specified in one of the package elements (msipackage, exepackage, msppackage, msupackage) in the WiX bundle.
private ManagedBA_DetectPackageComplete ( object sender, Microsoft.Tools.WindowsInstallerXml.Bootstrapper.DetectPackageCompleteEventArgs e ) : void
sender object
e Microsoft.Tools.WindowsInstallerXml.Bootstrapper.DetectPackageCompleteEventArgs
Résultat void
        void ManagedBA_DetectPackageComplete(object sender, DetectPackageCompleteEventArgs e)
        {
            if (e.PackageId == "MyProduct")
            {
                if (e.State == PackageState.Absent)
                {
                    MessageBox.Show("Installing");
                    this.Engine.Plan(LaunchAction.Install);
                }
                else if (e.State == PackageState.Present)
                {
                    MessageBox.Show("UnInstalling");
                    this.Engine.Plan(LaunchAction.Uninstall);
                }
            }
        }