Exemplo n.º 1
0
        internal static SetupComponentInfoCollection GetRequiredComponents(string roleName, InstallationModes mode)
        {
            TaskLogger.LogEnter(new object[]
            {
                roleName
            });
            Role           roleByName   = RoleManager.GetRoleByName(roleName);
            RoleCollection currentRoles = RoleManager.GetCurrentRoles();

            currentRoles.Remove(roleByName);
            SetupComponentInfoCollection setupComponentInfoCollection = new SetupComponentInfoCollection();

            foreach (Role role in currentRoles)
            {
                setupComponentInfoCollection.AddRange(role.AllComponents);
            }
            SetupComponentInfoCollection allComponents = roleByName.AllComponents;
            SetupComponentInfoCollection setupComponentInfoCollection2 = new SetupComponentInfoCollection();

            if (mode == InstallationModes.BuildToBuildUpgrade)
            {
                setupComponentInfoCollection2.AddRange(allComponents);
            }
            else
            {
                using (List <SetupComponentInfo> .Enumerator enumerator2 = allComponents.GetEnumerator())
                {
                    while (enumerator2.MoveNext())
                    {
                        SetupComponentInfo candidate = enumerator2.Current;
                        bool flag = false;
                        if (candidate.AlwaysExecute)
                        {
                            TaskLogger.Log(Strings.RunningAlwaysToRunComponent(candidate.Name));
                            flag = true;
                        }
                        else if (setupComponentInfoCollection.Find((SetupComponentInfo sci) => sci.Name == candidate.Name) == null)
                        {
                            TaskLogger.Log(Strings.AddingUniqueComponent(candidate.Name));
                            flag = true;
                        }
                        else
                        {
                            TaskLogger.Log(Strings.AlreadyConfiguredComponent(candidate.Name));
                        }
                        if (flag)
                        {
                            setupComponentInfoCollection2.Add(candidate);
                        }
                    }
                }
            }
            TaskLogger.LogExit();
            return(setupComponentInfoCollection2);
        }
Exemplo n.º 2
0
        private int CountStepsToBeExecuted(SetupComponentInfoCollection componentList, InstallationModes installationMode, InstallationCircumstances installationCircumstance)
        {
            int num  = 0;
            int num2 = 0;

            foreach (SetupComponentInfo setupComponentInfo in componentList)
            {
                foreach (TaskInfo taskInfo in setupComponentInfo.Tasks)
                {
                    if (!string.IsNullOrEmpty(taskInfo.GetTask(installationMode, installationCircumstance)) && this.IsTaskIncluded(taskInfo, setupComponentInfo))
                    {
                        num2++;
                        num += taskInfo.GetWeight(installationMode);
                    }
                }
            }
            base.WriteVerbose(Strings.FoundTasksToExecute(num2));
            return(num);
        }