Example #1
0
        private void FindStartingTask(ref List <SetupComponentInfo> .Enumerator componentEnumerator, ref List <TaskInfo> .Enumerator taskEnumerator, ref bool nextTaskNonFatal, InstallationModes installationMode, InstallationCircumstances installationCircumstance)
        {
            bool flag = false;

            if (this.ImplementsResume && this.isResuming && installationMode != InstallationModes.BuildToBuildUpgrade)
            {
                ConfigurationStatus configurationStatus = new ConfigurationStatus(this.taskNoun, this.InstallationMode);
                RolesUtility.GetConfiguringStatus(ref configurationStatus);
                base.WriteVerbose(Strings.LookingForTask(configurationStatus.Action.ToString(), configurationStatus.Watermark));
                while (!flag && componentEnumerator.MoveNext())
                {
                    taskEnumerator = componentEnumerator.Current.Tasks.GetEnumerator();
                    while (!flag && taskEnumerator.MoveNext())
                    {
                        if (taskEnumerator.Current.GetID() == configurationStatus.Watermark)
                        {
                            flag = true;
                            if (this.InstallationMode == InstallationModes.Uninstall && configurationStatus.Action == InstallationModes.Install)
                            {
                                nextTaskNonFatal = true;
                            }
                        }
                        else if (!string.IsNullOrEmpty(taskEnumerator.Current.GetTask(installationMode, installationCircumstance)))
                        {
                            this.completedSteps += taskEnumerator.Current.GetWeight(installationMode);
                        }
                    }
                }
                if (!flag)
                {
                    base.WriteVerbose(Strings.CouldNotFindTask);
                    this.completedSteps = 0;
                }
            }
            if (!flag)
            {
                componentEnumerator = this.ComponentInfoList.GetEnumerator();
                while (componentEnumerator.MoveNext())
                {
                    SetupComponentInfo setupComponentInfo = componentEnumerator.Current;
                    taskEnumerator = setupComponentInfo.Tasks.GetEnumerator();
                    if (taskEnumerator.MoveNext())
                    {
                        flag = true;
                        break;
                    }
                    base.WriteVerbose(Strings.ComponentEmpty(componentEnumerator.Current.Name));
                }
                if (!flag)
                {
                    throw new EmptyTaskListException();
                }
            }
        }
Example #2
0
        protected override void InternalValidate()
        {
            TaskLogger.LogEnter();
            this.CheckInstallationMode();
            ConfigurationStatus configurationStatus = new ConfigurationStatus(this.taskNoun);

            RolesUtility.GetConfiguringStatus(ref configurationStatus);
            if (this.ImplementsResume && configurationStatus.Action != InstallationModes.Unknown && configurationStatus.Watermark != null)
            {
                this.isResuming = true;
                if (configurationStatus.Action != this.InstallationMode && (configurationStatus.Action != InstallationModes.Install || this.InstallationMode != InstallationModes.Uninstall))
                {
                    base.WriteError(new IllegalResumptionException(configurationStatus.Action.ToString(), this.InstallationMode.ToString()), ErrorCategory.InvalidOperation, null);
                }
            }
            base.InternalValidate();
            TaskLogger.LogExit();
        }