private void OnDetectComplete(object sender, DetectCompleteEventArgs e)
 {
     if (_installer.Command.Action == LaunchAction.Uninstall)
     {
         _engine.Log(LogLevel.Verbose, Resources.InvokingAutomaticPlanForUninstall);
         Uninstall = true;
         _mainVmFactory.GetViewModelInstance().MoveNextCommand.Execute(null);
     }
 }
예제 #2
0
        /// <summary>Called when the detection phase has completed.</summary>
        /// <param name="args">The arguments of the event.</param>
        protected override void OnDetectComplete(Wix.DetectCompleteEventArgs args)
        {
            LogVerbose("Enter Method: OnDetectComplete");
            WPFBootstrapperEventArgs <Wix.DetectCompleteEventArgs> cancelArgs = new WPFBootstrapperEventArgs <Wix.DetectCompleteEventArgs>(args);

            TryInvoke(new Action(() => { _mainWindow.OnDetectComplete(cancelArgs); }));
            if (!cancelArgs.Cancel)
            {
                base.OnDetectComplete(cancelArgs.Arguments);
            }
            LogVerbose("Leaving Method: OnDetectComplete");
        }
        /// <summary>Called when the detection phase has completed.</summary>
        /// <param name="args">The arguments of the event.</param>
        protected override void OnDetectComplete(Wix.DetectCompleteEventArgs args)
        {
            this.LogBootstrapperEnterEvent(args, "DetectComplete");
            WPFBootstrapperEventArgs <Wix.DetectCompleteEventArgs> cancelArgs = new WPFBootstrapperEventArgs <Wix.DetectCompleteEventArgs>(args);

            this.TryInvoke(new Action(() => { this.model.OnDetectComplete(cancelArgs); }));
            if (!cancelArgs.Cancel)
            {
                base.OnDetectComplete(cancelArgs.Arguments);
            }
            this.LogBootstrapperLeaveEvent(null, "DetectComplete");
        }
 private void OnDetectComplete(object sender, DetectCompleteEventArgs e)
 {
     // Identify the logged in user here itself so that it can be consumed by custom actions later.
     this.Bootstrapper.Engine.StringVariables["CURRENTLOGGEDINUSER"] = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
 }
예제 #5
0
		void DetectComplete(object sender, DetectCompleteEventArgs e)
		{
			if (LaunchAction.Uninstall == FiresecUX.Model.Command.Action)
			{
				FiresecUX.Model.Engine.Log(LogLevel.Verbose, "Invoking automatic plan for uninstall");
				FiresecUX.Dispatcher.Invoke((Action)delegate()
				{
					Plan(LaunchAction.Uninstall);
				}
				);
			}
			else if (Hresult.Succeeded(e.Status))
			{
				if (Downgrade == true)
				{
					// TODO: What behavior do we want for downgrade?
					_root.State = InstallationState.DetectedNewer;
				}

				if (LaunchAction.Layout == FiresecUX.Model.Command.Action)
				{
					PlanLayout();
				}
				else if (FiresecUX.Model.Command.Display != Display.Full)
				{
					// If we're not waiting for the user to click install, dispatch plan with the default action.
					FiresecUX.Model.Engine.Log(LogLevel.Verbose, "Invoking automatic plan for non-interactive mode.");
					FiresecUX.Dispatcher.Invoke((Action)delegate()
					{
						this.Plan(FiresecUX.Model.Command.Action);
					}
					);
				}
			}
			else
			{
				_root.State = InstallationState.Failed;
			}
		}
예제 #6
0
        private void DetectComplete(object sender, DetectCompleteEventArgs e)
        {
            // Parse the command line string before any planning.
            BaseModel.ParseCommandLine();

            if (LaunchAction.Uninstall == BaseModel.Command.Action)
            {
                ConfigureUninstall();
            }
            else if (Hresult.Succeeded(e.Status))
            {

                if (_downgrade)
                {
                    Logger.Standard("downgrade detected");
                    InstallationState = InstallationState.DetectedNewer;
                }

                if (_upgrade)
                {
                    Logger.Standard("upgrade detected");
                    InstallationState = InstallationState.DetectedOlder;
                }

                if (InstallationState == InstallationState.DetectedPresent)
                {
                    ExternalEngine = new ExternalUtilityEngine(
                        this,
                        Path.Combine(BaseModel.InstallFolder, "engine.exe"))
                        {
                            AllowBack = true
                        };
                    Dispatcher.Invoke(new Action(() => ExternalEngine.Initialize(BaseModel.InstallFolder)));

                }

                if (LaunchAction.Layout == BaseModel.Command.Action)
                {
                    BaseModel.PlanLayout();
                }
                else if (BaseModel.Command.Display != Display.Full)
                {
                    // If we're not waiting for the user to click install, dispatch plan with the default action.
                    Logger.Verbose("Invoking automatic plan for non-interactive mode.");
                    BaseModel.Plan(BaseModel.Command.Action.ToInstallAction());
                }
            }
            else
            {
                InstallationState = InstallationState.Failed;
            }
        }
예제 #7
0
        private void DetectComplete(object sender, DetectCompleteEventArgs e)
        {
            // Parse the command line string before any planning.
            this.ParseCommandLine();
            this.root.InstallState = InstallationState.Waiting;

            if (LaunchAction.Uninstall == WixBA.Model.Command.Action)
            {
                WixBA.Model.Engine.Log(LogLevel.Verbose, "Invoking automatic plan for uninstall");
                WixBA.Plan(LaunchAction.Uninstall);
            }
            else if (Hresult.Succeeded(e.Status))
            {
                // block if CLR v2 isn't available; sorry, it's needed for the MSBuild tasks
                if (WixBA.Model.Engine.EvaluateCondition("NETFRAMEWORK35_SP_LEVEL < 1"))
                {
                    string message = "WiX Toolset requires the .NET Framework 3.5.1 Windows feature to be enabled.";
                    WixBA.Model.Engine.Log(LogLevel.Verbose, message);

                    if (Display.Full == WixBA.Model.Command.Display)
                    {
                        WixBA.Dispatcher.Invoke((Action)delegate()
                            {
                                MessageBox.Show(message, "WiX Toolset", MessageBoxButton.OK, MessageBoxImage.Error);
                                if (null != WixBA.View)
                                {
                                    WixBA.View.Close();
                                }
                            }
                        );
                    }

                    this.root.InstallState = InstallationState.Failed;
                    return;
                }

                if (this.Downgrade)
                {
                    // TODO: What behavior do we want for downgrade?
                    this.root.DetectState = DetectionState.Newer;
                }

                if (LaunchAction.Layout == WixBA.Model.Command.Action)
                {
                    WixBA.PlanLayout();
                }
                else if (WixBA.Model.Command.Display != Display.Full)
                {
                    // If we're not waiting for the user to click install, dispatch plan with the default action.
                    WixBA.Model.Engine.Log(LogLevel.Verbose, "Invoking automatic plan for non-interactive mode.");
                    WixBA.Plan(WixBA.Model.Command.Action);
                }
            }
            else
            {
                this.root.InstallState = InstallationState.Failed;
            }
        }
예제 #8
0
 /// <summary>
 /// Called when the detection phase has completed.
 /// </summary>
 /// <param name="args">Additional arguments for this event.</param>
 protected virtual void OnDetectComplete(DetectCompleteEventArgs args)
 {
     EventHandler<DetectCompleteEventArgs> handler = this.DetectComplete;
     if (null != handler)
     {
         handler(this, args);
     }
 }
예제 #9
0
		private void OnDetectComplete(object sender, DetectCompleteEventArgs e)
		{
			if (HResult.Succeeded(e.Status))
			{
				switch (_installer.Command.Action)
				{
					case LaunchAction.Layout:
						Operation = Operation.Layout;
						break;
					case LaunchAction.Help:
						Operation = Operation.Help;
						OnUIThread(() =>
						{
							var helpNavigationItem = _navigationManager.GetNavigationItemByName(NavigationNames.Help);
							_navigationManager.Navigate(helpNavigationItem);
						});
						break;
					default:
						if (_installer.Command.Display != Display.Full)
						{
							_engine.Log(LogLevel.Verbose, Resources.InvokingAutomaticPlanForNonInteractiveMode);
							_engine.PlanAsync(_installer.Command.Action);
						}
						break;
				}
			}
			else
			{
				Operation = Operation.Information;
				_completedStepVmFactory.GetViewModelInstance().ExitCode = e.Status;
				_completedStepVmFactory.GetViewModelInstance().Result = Cancelled ? OperationResult.Cancelled : OperationResult.Failed;
			}

			RegisterWizardSteps();

			IsInitializing = false;
		}
 private void OnDetectComplete(object sender, DetectCompleteEventArgs e)
 {
     switch (Result)
     {
         case OperationResult.Downgrade:
             _engine.Log(LogLevel.Error, Resources.Downgrade);
             if (_installer.Command.Display != Display.Full)
             {
                 _mainVmFactory.GetViewModelInstance().Shutdown((int)SystemErrorCodes.ERROR_INSTALL_PACKAGE_DOWNGRADE);
             }
             break;
         case OperationResult.Cancelled:
             Cancel();
             break;
         case OperationResult.Failed:
             Fail();
             break;
     }
 }
		private void DetectComplete(object sender, DetectCompleteEventArgs e)
		{
			// If necessary, parse the command line string before any planning
			// (e.g. detect installation folder)

			if (LaunchAction.Uninstall == this.bootstrapper.Command.Action)
			{
				this.engine.Log(LogLevel.Verbose, "Invoking automatic plan for uninstall");
				this.engine.Plan(LaunchAction.Uninstall);
			}
			else if (e.Status >= 0 /* Success */)
			{
				if (this.Downgrade)
				{
					// What do you want to do in case of downgrade?
					// Here: Stop installation

					string message = "Sorry, we do not support downgrades.";
					this.engine.Log(LogLevel.Verbose, message);
					if (this.bootstrapper.Command.Display == Display.Full)
					{
						this.interactionService.ShowMessageBox(message);
						this.interactionService.CloseUIAndExit();
					}
				}

				if (this.bootstrapper.Command.Action == LaunchAction.Layout)
				{
					// Copies all of the Bundle content to a specified directory
					this.engine.Plan(LaunchAction.Layout);
				}
				else if (this.bootstrapper.Command.Display != Display.Full)
				{
					// If we're not waiting for the user to click install, dispatch plan with the default action.
					this.engine.Log(LogLevel.Verbose, "Invoking automatic plan for non-interactive mode.");
					this.engine.Plan(LaunchAction.Install);
				}
			}
		}
        private void DetectComplete(object sender, DetectCompleteEventArgs e)
        {
            if (LaunchAction.Uninstall == Bootstrapper.Model.Command.Action)
            {
                Bootstrapper.Model.Engine.Log(LogLevel.Verbose, "Invoking automatic plan for uninstall");
                Bootstrapper.Dispatcher.Invoke((Action)(() => Plan(LaunchAction.Uninstall)));
            }
            else if (Hresult.Succeeded(e.Status))
            {
                if (Downgrade)
                {
                    // TODO: What behavior do we want for downgrade?
                    _root.State = InstallationState.DetectedNewer;
                }

                // If we're not waiting for the user to click install, dispatch plan with the default action.
                if (Bootstrapper.Model.Command.Display != Display.Full)
                {
                    Bootstrapper.Model.Engine.Log(LogLevel.Verbose, "Invoking automatic plan for non-interactive mode.");
                    Bootstrapper.Dispatcher.Invoke((Action)(() => Plan(Bootstrapper.Model.Command.Action)));
                }
            }
            else
            {
                _root.State = InstallationState.Failed;
            }
        }
        private void DetectComplete(object sender, DetectCompleteEventArgs e)
        {
            if (ba.Command.Action == LaunchAction.Uninstall)
            {
                ba.Engine.Log(LogLevel.Verbose, "Invoking automatic plan for uninstall");
                Execute.OnUIThread(() =>
                {
                    this.Plan(LaunchAction.Uninstall);
                });
            }
            else if (HResultSucceeded(e.Status))
            {
                if (this.Downgrade)
                {
                    // TODO: What behavior do we want for downgrade?
                    this.State = InstallationState.DetectedNewer;
                }

                // If we're not waiting for the user to click install, dispatch plan with the default action.
                if (ba.Command.Display != Display.Full)
                {
                    ba.Engine.Log(LogLevel.Verbose, "Invoking automatic plan for non-interactive mode.");
                    Execute.OnUIThread(() =>
                    {
                        this.Plan(ba.Command.Action);
                    });
                }
            }
            else
            {
                this.State = InstallationState.Failed;
            }
        }