Esempio n. 1
0
        private void DetectComplete(object sender, DetectCompleteEventArgs e)
        {
            // Parse the command line string before any planning.
            this.ParseCommandLine();

            if (LaunchAction.Uninstall == PanelSwWixBA.Model.Command.Action)
            {
                PanelSwWixBA.Model.Engine.Log(LogLevel.Verbose, "Invoking automatic plan for uninstall");
                PanelSwWixBA.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 (PanelSwWixBA.Model.Engine.EvaluateCondition("NETFRAMEWORK35_SP_LEVEL < 1"))
                {
                    string message = "WiX Toolset requires the .NET Framework 3.5.1 Windows feature to be enabled.";
                    PanelSwWixBA.Model.Engine.Log(LogLevel.Verbose, message);

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

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

                if (this.Downgrade)
                {
                    // TODO: What behavior do we want for downgrade?
                    this.root.State = InstallationState.DetectedNewer;
                }

                if (LaunchAction.Layout == PanelSwWixBA.Model.Command.Action)
                {
                    PanelSwWixBA.PlanLayout();
                }
                else if (PanelSwWixBA.Model.Command.Display != Display.Full)
                {
                    // If we're not waiting for the user to click install, dispatch plan with the default action.
                    PanelSwWixBA.Model.Engine.Log(LogLevel.Verbose, "Invoking automatic plan for non-interactive mode.");
                    PanelSwWixBA.Plan(PanelSwWixBA.Model.Command.Action);
                }
            }
            else
            {
                this.root.State = InstallationState.Failed;
            }
        }
Esempio n. 2
0
 private void ApplyComplete(object sender, ApplyCompleteEventArgs e)
 {
     if (Hresult.Succeeded(e.Status))
     {
         root.State = InstallationState.Applied;
     }
     else
     {
         root.State = InstallationState.Failed;
     }
     StartFinishView();
 }
Esempio n. 3
0
 private void PlanComplete(object sender, PlanCompleteEventArgs e)
 {
     if (Hresult.Succeeded(e.Status))
     {
         this.root.PreApplyState = this.root.State;
         this.root.State         = InstallationState.Applying;
         PanelSwWixBA.Model.Engine.Apply(this.root.ViewWindowHandle);
     }
     else
     {
         this.root.State = InstallationState.Failed;
     }
 }
Esempio n. 4
0
        private void ApplyComplete(object sender, ApplyCompleteEventArgs e)
        {
            PanelSwWixBA.Model.Result = e.Status; // remember the final result of the apply.

            // If we're not in Full UI mode, we need to alert the dispatcher to stop and close the window for passive.
            if (Microsoft.Tools.WindowsInstallerXml.Bootstrapper.Display.Full != PanelSwWixBA.Model.Command.Display)
            {
                // If its passive, send a message to the window to close.
                if (Microsoft.Tools.WindowsInstallerXml.Bootstrapper.Display.Passive == PanelSwWixBA.Model.Command.Display)
                {
                    PanelSwWixBA.Model.Engine.Log(LogLevel.Verbose, "Automatically closing the window for non-interactive install");
                    PanelSwWixBA.Dispatcher.BeginInvoke((Action) delegate()
                    {
                        PanelSwWixBA.View.Close();
                    }
                                                        );
                }
                else
                {
                    PanelSwWixBA.Dispatcher.InvokeShutdown();
                }
            }
            else if (Hresult.Succeeded(e.Status) && LaunchAction.UpdateReplace == PanelSwWixBA.Model.PlannedAction) // if we successfully applied an update close the window since the new Bundle should be running now.
            {
                PanelSwWixBA.Model.Engine.Log(LogLevel.Verbose, "Automatically closing the window since update successful.");
                PanelSwWixBA.Dispatcher.BeginInvoke((Action) delegate()
                {
                    PanelSwWixBA.View.Close();
                }
                                                    );
            }

            // Set the state to applied or failed unless the state has already been set back to the preapply state
            // which means we need to show the UI as it was before the apply started.
            if (this.root.State != this.root.PreApplyState)
            {
                this.root.State = Hresult.Succeeded(e.Status) ? InstallationState.Applied : InstallationState.Failed;
            }
        }