Beispiel #1
0
        /// <summary>Called when the engine is about to plan an MSI feature of a specific package.</summary>
        /// <param name="args">The arguments of the event.</param>
        protected override void OnPlanMsiFeature(Wix.PlanMsiFeatureEventArgs args)
        {
            LogVerbose("Enter Method: OnPlanMsiFeature");
            WPFBootstrapperEventArgs <Wix.PlanMsiFeatureEventArgs> cancelArgs = new WPFBootstrapperEventArgs <Wix.PlanMsiFeatureEventArgs>(args);

            TryInvoke(new Action(() => { _mainWindow.OnPlanMsiFeature(cancelArgs); }));
            if (!cancelArgs.Cancel)
            {
                base.OnPlanMsiFeature(cancelArgs.Arguments);
            }
            LogVerbose("Leaving Method: OnPlanMsiFeature");
        }
        /// <summary>Called when the engine is about to plan an MSI feature of a specific package.</summary>
        /// <param name="args">The arguments of the event.</param>
        protected override void OnPlanMsiFeature(Wix.PlanMsiFeatureEventArgs args)
        {
            this.LogBootstrapperEnterEvent(args, "PlanMsiFeature");
            WPFBootstrapperEventArgs <Wix.PlanMsiFeatureEventArgs> cancelArgs = new WPFBootstrapperEventArgs <Wix.PlanMsiFeatureEventArgs>(args);

            this.TryInvoke(new Action(() => { this.model.OnPlanMsiFeature(cancelArgs); }));
            if (!cancelArgs.Cancel)
            {
                base.OnPlanMsiFeature(cancelArgs.Arguments);
            }
            this.LogBootstrapperLeaveEvent(args, "PlanMsiFeature");
        }
Beispiel #3
0
        ///
        /// when engine plans action for a feature, set the requested future state of
        /// the package based on what the user requested
        ///
        private void SetFeaturePlannedState(Wix.PlanMsiFeatureEventArgs planMsiFeatureEventArgs)
        {
            var pkg = BundlePackages.First(p => p.Package == planMsiFeatureEventArgs.PackageId);

            if (pkg != null)
            {
                var feature = pkg.AllFeatures.First(feat => feat.Feature == planMsiFeatureEventArgs.FeatureId);
                if (feature != null)
                {
                    if (feature.RequestedState.HasValue)
                    {
                        planMsiFeatureEventArgs.State = feature.RequestedState.Value;
                    }
                    else if (this.PlannedAction == Wix.LaunchAction.Uninstall)
                    {
                        planMsiFeatureEventArgs.State = Wix.FeatureState.Absent;
                    }
                    else if (feature.CurrentInstallState == Wix.FeatureState.Local || (feature.Level > 0 && feature.Level <= this.InstallLevel))
                    {
                        planMsiFeatureEventArgs.State = Wix.FeatureState.Local;
                    }
                }
            }
        }
 private void SetFeaturePlannedState(object sender, PlanMsiFeatureEventArgs e)
 {
     Util.Log("SetFeaturePlannedState: " + e.FeatureId);
     e.State = FeatureState.Unknown;
 }
Beispiel #5
0
        Result IBootstrapperApplication.OnPlanMsiFeature(string wzPackageId, string wzFeatureId, ref FeatureState pRequestedState)
        {
            PlanMsiFeatureEventArgs args = new PlanMsiFeatureEventArgs(wzPackageId, wzFeatureId, pRequestedState);
            this.OnPlanMsiFeature(args);

            pRequestedState = args.State;
            return args.Result;
        }
Beispiel #6
0
 /// <summary>
 /// Called when the engine is about to plan an MSI feature of a specific package.
 /// </summary>
 /// <param name="args">Additional arguments for this event.</param>
 protected virtual void OnPlanMsiFeature(PlanMsiFeatureEventArgs args)
 {
     EventHandler<PlanMsiFeatureEventArgs> handler = this.PlanMsiFeature;
     if (null != handler)
     {
         handler(this, args);
     }
 }