Ejemplo n.º 1
0
 bool IWizardStep.SaveChanges(WizardArgs wizardArgs)
 {
   var args = (SetupWizardArgs)wizardArgs;
   args.LicenseFilePath = this.LicenseFile.Text;
   args.LocalRepositoryFolderPath = this.LocalRepositoryFolder.Text;
   return true;
 }
Ejemplo n.º 2
0
        bool IWizardStep.SaveChanges(WizardArgs wizardArgs)
        {
            var args = (ImportWizardArgs)wizardArgs;

            if (WebServerManager.WebsiteExists(this.websiteName.Text))
            {
                this.websiteNameWarn.Visibility = System.Windows.Visibility.Visible;
                return(false);
            }

            this.websiteNameWarn.Visibility = System.Windows.Visibility.Hidden;

            if (FileSystem.FileSystem.Local.Directory.Exists(this.rootFolderPath.Text) && FileSystem.FileSystem.Local.Directory.GetFiles(this.rootFolderPath.Text).Length > 0)
            {
                this.rootPathWarn.Visibility = System.Windows.Visibility.Visible;
                return(false);
            }


            args.siteName          = this.websiteName.Text;
            args.rootPath          = this.rootFolderPath.Text;
            args.updateLicense     = this.updateLicense.IsChecked == true ? true : false;
            args.pathToLicenseFile = ProfileManager.Profile.License;
            return(true);
        }
Ejemplo n.º 3
0
        bool IWizardStep.SaveChanges(WizardArgs wizardArgs)
        {
            var args = (SetupWizardArgs)wizardArgs;

            args.ConnectionString = ConnectionStringTextBox.Text;
            return(true);
        }
        public void InitializeStep(WizardArgs wizardArgs)
        {
            ImportWizardArgs args = (ImportWizardArgs)wizardArgs;

            // TODO: Parse bindings in (ImportWizardArgs), Fill user control from bindings dictionary, Append all bindings in hosts
            this.siteBindings.DataContext = args.bindings;
        }
        public bool SaveChanges(WizardArgs wizardArgs)
        {
            ImportWizardArgs args         = (ImportWizardArgs)wizardArgs;
            List <string>    usedBindings = new List <string>();

            foreach (var binding in args.bindings.Where(x => x.IsChecked == true))
            {
                if (this.BindingUsing(binding.hostName))
                {
                    usedBindings.Add(binding.hostName);
                }
            }

            if (usedBindings.Count > 0)
            {
                string usedBindingsMessage = string.Empty;
                foreach (string binding in usedBindings)
                {
                    usedBindingsMessage += binding + "\n";
                }

                MessageBox.Show("The following bindings are already used:\n" + usedBindingsMessage);
                return(false);
            }
            else
            {
                return(true);
            }
        }
Ejemplo n.º 6
0
        public override IEnumerable <FinishAction> GetFinishActions(WizardArgs wizardArgs)
        {
            InstallModulesWizardArgs installModulesWizardArgs = (InstallModulesWizardArgs)wizardArgs;
            List <Product>           modules = installModulesWizardArgs._Modules;

            foreach (var module in modules)
            {
                XmlDocument manifest = module.Manifest;
                if (manifest != null && manifest != Product.EmptyManifest)
                {
                    XmlElement finish = (XmlElement)manifest.SelectSingleNode("manifest/*/finish");
                    if (finish == null)
                    {
                        continue;
                    }

                    foreach (FinishAction action in WizardPipelineManager.GetFinishActions(finish, WizardArgumentsType))
                    {
                        yield return(new FinishAction(action.Text, action.Method));
                    }
                }
            }

            wizardArgs.HasInstallationBeenCompleted = true;
        }
Ejemplo n.º 7
0
        private void AddStepToWizard(StepInfo stepInfo, WizardArgs wArgs)
        {
            Type ctrl = stepInfo.Control;

            Assert.IsNotNull(ctrl, "The {0} step contains null as a control".FormatWith(stepInfo.Title));
            var fullName = ctrl.FullName;

            Assert.IsTrue(ctrl.IsClass, "Control {0} is not class".FormatWith(fullName));

            if (!ctrl.GetInterfaces().Contains(typeof(IWizardStep)))
            {
                Log.Debug("Control {0} does not implement IWizardStep".FormatWith(fullName));
            }

            var param      = stepInfo.Param;
            var wizardStep = (UserControl)(!string.IsNullOrEmpty(param) ? ReflectionUtil.CreateObject(ctrl, param) : ReflectionUtil.CreateObject(ctrl));

            this.ProcessorArgs = wArgs;

            this.TabControl.Items.Insert(this.TabControl.Items.Count - 2, new TabItem
            {
                AllowDrop  = false,
                Content    = wizardStep,
                Visibility = Visibility.Collapsed
            });
        }
        public bool OnMovingNext(WizardArgs wizardArgs)
        {
            var productRevision = this.ProductRevision;

            Assert.IsNotNull(productRevision, nameof(productRevision));

            Product product = productRevision.SelectedValue as Product;

            Assert.IsNotNull(product, nameof(product));

            var rootName = GetValidRootName();

            var rootPath = GetValidRootPath(rootName);

            if (rootPath == null)
            {
                return(false);
            }

            var name = GetValidWebsiteName();

            if (name == null)
            {
                return(false);
            }

            var hostNames = GetValidHostNames();

            var sqlPrefix = GetValidSqlPrefix();

            var attachSql = this.attachSql.IsChecked ?? true;

            var connectionString = ProfileManager.GetConnectionString();

            SqlServerManager.Instance.ValidateConnectionString(connectionString);

            var licensePath = ProfileManager.Profile.License;

            Assert.IsNotNull(licensePath, @"The license file isn't set in the Settings window");
            FileSystem.FileSystem.Local.File.AssertExists(licensePath, "The {0} file is missing".FormatWith(licensePath));

            var appPoolInfo = GetAppPoolInfo();

            var args = (InstallWizardArgs)wizardArgs;

            args.InstanceName             = name;
            args.InstanceHostNames        = hostNames;
            args.InstanceSqlPrefix        = sqlPrefix;
            args.InstanceAttachSql        = attachSql;
            args.InstanceWebRootPath      = GetWebRootPath(rootPath);
            args.InstanceRootName         = rootName;
            args.InstanceRootPath         = rootPath;
            args.InstanceProduct          = product;
            args.InstanceConnectionString = connectionString;
            args.LicenseFileInfo          = new FileInfo(licensePath);
            args.InstanceAppPoolInfo      = appPoolInfo;
            args.Product = product;

            return(true);
        }
        bool IWizardStep.SaveChanges(WizardArgs wizardArgs)
        {
            var args = (ExportWizardArgs)wizardArgs;

            args.ExportFilePath                   = this.ExportedFile.Text;
            args.IncludeTempFolderContents        = !(this.ExcludeTempFolderContents.IsChecked ?? true);
            args.IncludeMediaCacheFolderContents  = !(this.ExcludeMediaCacheFolderContents.IsChecked ?? true);
            args.ExcludeLicenseFile               = this.ExcludeLicenseFile.IsChecked ?? false;
            args.ExcludeDiagnosticsFolderContents = this.ExcludeDiagnosticsFolderContents.IsChecked ?? false;
            args.ExcludeLogsFolderContents        = this.ExcludeLogsFolderContents.IsChecked ?? false;
            args.ExcludePackagesFolderContents    = this.ExcludePackagesFolderContents.IsChecked ?? false;
            args.ExcludeUploadFolderContents      = this.ExcludeUploadFolderContents.IsChecked ?? false;

            if (this.IsPathValid())
            {
                var path = Path.GetDirectoryName(this.ExportedFile.Text);

                if (!string.IsNullOrEmpty(path))
                {
                    FileSystem.FileSystem.Local.Directory.CreateDirectory(path);
                    return(true);
                }
            }

            WindowHelper.ShowMessage("You have specified the incorrect path or file name.");
            return(false);
        }
Ejemplo n.º 10
0
        bool IWizardStep.SaveChanges(WizardArgs wizardArgs)
        {
            var args = (SetupWizardArgs)wizardArgs;

            args.InstancesRootFolderPath = this.MainRootFolder.Text.Trim();
            return(true);
        }
Ejemplo n.º 11
0
        bool IFlowControl.OnMovingNext(WizardArgs wizardArgs)
        {
            var args = (SetupWizardArgs)wizardArgs;

            if (Accounts == null)
            {
                return(false);
            }

            try
            {
                const string Message = "You probably don't have necessary permissions set. Please try to click 'Grant' button before you proceed.\r\n\r\nNote, the SQL Server account that you selected previously must have necessary permissions to create a SQL database in the instances root folder you specified earlier - please ensure that it is correct. In addition, the SQL Server service must use NETWORK SERVICE identity so that SIM can assign necessary permissions for it.";
                foreach (var account in Accounts)
                {
                    if (!FileSystem.FileSystem.Local.Security.HasPermissions(args.InstancesRootFolderPath, account, FileSystemRights.FullControl))
                    {
                        WindowHelper.ShowMessage(Message, MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK);
                        return(false);
                    }
                }

                if (!SqlServerManager.Instance.TestSqlServer(args.InstancesRootFolderPath, args.ConnectionString))
                {
                    WindowHelper.ShowMessage(Message, MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK);
                    return(false);
                }

                return(true);
            }
            catch (Exception ex)
            {
                Log.Error(ex, "Cannot verify permissions");
                return(true);
            }
        }
Ejemplo n.º 12
0
        bool IFlowControl.OnMovingNext(WizardArgs wizardArgs)
        {
            var           args       = (SetupWizardArgs)wizardArgs;
            SqlConnection connection = null;

            try
            {
                connection = SIM.Adapters.SqlServer.SqlServerManager.Instance.OpenConnection(new SqlConnectionStringBuilder(args.ConnectionString), true);
                connection.Close();
                return(true);
            }
            catch (SqlException ex)
            {
                WindowHelper.HandleError(ex.Message, false, ex);
                return(false);
            }
            catch (Exception ex)
            {
                WindowHelper.HandleError(ex.Message, true, ex);
                return(false);
            }
            finally
            {
                if (connection != null)
                {
                    connection.Close();
                }
            }
        }
        void IWizardStep.InitializeStep(WizardArgs wizardArgs)
        {
            Init();
            this.owner = wizardArgs.WizardWindow;
            ProductName.DataContext = _StandaloneProducts.GroupBy(p => p.Name);

            var args = (InstallWizardArgs)wizardArgs;

            _InstallParameters = args;

            Product product = args.Product;

            if (product != null)
            {
                Select(ProductName, product.Name);
                Select(ProductVersion, product.ShortVersion);
                Select(ProductRevision, product.Revision);
            }
            else
            {
                SelectFirst(ProductName);
            }

            var name = args.InstanceName;

            if (!string.IsNullOrEmpty(name))
            {
                InstanceName.Text = name;
            }

            //this.LocationText.Text =Path.Combine(ProfileManager.Profile.InstancesFolder,args.InstanceName);
        }
Ejemplo n.º 14
0
        void IWizardStep.InitializeStep(WizardArgs wizardArgs)
        {
            ImportWizardArgs args = (ImportWizardArgs)wizardArgs;

            this.websiteName.Text    = args.siteName;
            this.rootFolderPath.Text = args.rootPath;
        }
        public bool OnMovingNext(WizardArgs wizardArgs)
        {
            var args = (Delete9WizardArgs)wizardArgs;

            args.ScriptsOnly = this.scriptsOnly.IsChecked ?? false;

            args.ScriptRoot = args.Tasker.GlobalParams.FirstOrDefault(p => p.Name == "FilesRoot").Value;

            Tasker tasker = args.Tasker;

            tasker.GlobalParams.FirstOrDefault(p => p.Name == "FilesRoot").Value = args.ScriptRoot;
            InstallParam sqlServer = tasker.GlobalParams.FirstOrDefault(p => p.Name == "SqlServer");

            if (sqlServer != null)
            {
                sqlServer.Value = args.InstanceConnectionString.DataSource;
            }

            InstallParam sqlAdminUser = tasker.GlobalParams.FirstOrDefault(p => p.Name == "SqlAdminUser");

            if (sqlAdminUser != null)
            {
                sqlAdminUser.Value = args.InstanceConnectionString.UserID;
            }

            InstallParam sqlAdminPass = tasker.GlobalParams.FirstOrDefault(p => p.Name == "SqlAdminPassword");

            if (sqlAdminPass != null)
            {
                sqlAdminPass.Value = args.InstanceConnectionString.Password;
            }
            return(true);
        }
        void IWizardStep.InitializeStep(WizardArgs wizardArgs)
        {
            var args = (SetupWizardArgs)wizardArgs;

            this.LicenseFile.Text           = args.LicenseFilePath;
            this.LocalRepositoryFolder.Text = args.LocalRepositoryFolderPath.EmptyToNull() ?? GetRepositoryPath();
        }
        void IWizardStep.InitializeStep(WizardArgs wizardArgs)
        {
            var args = (SetupWizardArgs)wizardArgs;

            this.InstancesRootFolder.Text = args.InstancesRootFolderPath;
            this._connectionString        = args.ConnectionString;
        }
        void IWizardStep.InitializeStep(WizardArgs wizardArgs)
        {
            var args = (InstallModulesWizardArgs)wizardArgs;

            // create new checkbox list
            Product instanceProduct = args.Product;

            if (instanceProduct == null)
            {
                return;
            }

            var modules = ProductManager.Modules.Where(m => m.IsMatchRequirements(instanceProduct)).OrderByDescending(m => m.SortOrder);
            IEnumerable <string> moduleNames = modules.GroupBy(module => module.Name).Select(moduleGroup => moduleGroup.Key);

            ProductInCheckbox[] productCheckboxes = moduleNames.Select(moduleName => new ProductInCheckbox(moduleName, modules.Where(module => module.Name.EqualsIgnoreCase(moduleName)).OrderByDescending(m => m.VersionAndRevision).ToArray())).ToArray();

            this.productFamilies           = new ObservableCollection <ProductInCheckbox>(productCheckboxes);
            this.unfilteredProductFamilies = new ObservableCollection <ProductInCheckbox>(productCheckboxes);

            foreach (Product module in args.Modules)
            {
                Product           alreadySelectedModule = module;
                ProductInCheckbox checkBoxItem          = productCheckboxes.SingleOrDefault(cbi => cbi.Name.Equals(alreadySelectedModule.Name, StringComparison.OrdinalIgnoreCase));
                if (checkBoxItem != null)
                {
                    checkBoxItem.IsChecked = checkBoxItem.Name == module.Name || module.Name.EqualsIgnoreCase("Sitecore Analytics");
                    checkBoxItem.Value     = module;
                }
            }

            this.DoSearch(this.SearchTextBox.Text = string.Empty);
            this.sitecoreModules.ItemsSource      = this.productFamilies;
        }
Ejemplo n.º 19
0
        void IWizardStep.InitializeStep(WizardArgs wizardArgs)
        {
            var args = (DownloadWizardArgs)wizardArgs;

            this.UserName.Text     = args.UserName;
            this.Passowrd.Password = args.Password;
        }
        bool IWizardStep.SaveChanges(WizardArgs wizardArgs)
        {
            var args = (RestoreWizardArgs)wizardArgs;

            args.Backup = this.backups.SelectedItem as InstanceBackup;

            return(true);
        }
Ejemplo n.º 21
0
        public void InitializeStep(WizardArgs wizardArgs)
        {
            Assert.ArgumentNotNull(wizardArgs, nameof(wizardArgs));
            Install9WizardArgs args = (Install9WizardArgs)wizardArgs;

            this.owner  = args.WizardWindow;
            this.tasker = args.Tasker;
            this.TasksList.DataContext = args.Tasker.Tasks.Where(t => (t.SupportsUninstall() && t.UnInstall) || !t.UnInstall);
        }
Ejemplo n.º 22
0
        public bool SaveChanges(WizardArgs wizardArgs)
        {
            var args     = (DownloadWizardArgs)wizardArgs;
            var selected = this.checkBoxItems.Where(mm => mm.IsChecked);

            args.Products.AddRange(selected);

            return(true);
        }
        public bool OnMovingNext(WizardArgs wizardArgs)
        {
            if (_SelectedInstances.Count != 0)
            {
                return(true);
            }

            MessageBox.Show("You haven't selected any of the instances");
            return(false);
        }
        public bool SaveChanges(WizardArgs wizardArgs)
        {
            var args = (MultipleDeletionWizardArgs)wizardArgs;

            if (_SelectedInstances.Count != 0)
            {
                args._SelectedInstances = _SelectedInstances;
            }

            return(true);
        }
        void IWizardStep.InitializeStep(WizardArgs wizardArgs)
        {
            var args = (RestoreWizardArgs)wizardArgs;

            this.checkBoxItems.Clear();

            this.checkBoxItems.AddRange(args.Instance.Backups);


            this.backups.DataContext = this.checkBoxItems;
        }
Ejemplo n.º 26
0
        public void Execute(WizardArgs args)
        {
            var tempFolder = ApplicationManager.TempFolder;

            if (!Directory.Exists(tempFolder))
            {
                Directory.CreateDirectory(tempFolder);
            }

            File.WriteAllText(Path.Combine(tempFolder, "agreement-accepted.txt"), @"agreement accepted");
        }
Ejemplo n.º 27
0
        public void InitializeStep([NotNull] WizardArgs wizardArgs)
        {
            Assert.ArgumentNotNull(wizardArgs, "wizardArgs");

            var args = (InstallModulesWizardArgs)wizardArgs;

            this.Dictionaries.IsChecked             = args.SkipDictionaries ?? !Settings.CoreInstallDictionaries.Value;
            this.RadControls.IsChecked              = args.SkipRadControls ?? !Settings.CoreInstallRadControls.Value;
            this.ServerSideRedirect.IsChecked       = args.ServerSideRedirect ?? Settings.CoreInstallNotFoundTransfer.Value;
            this.IncreaseExecutionTimeout.IsChecked = args.IncreaseExecutionTimeout ?? true;
        }
        bool IWizardStep.SaveChanges(WizardArgs wizardArgs)
        {
            var     args    = (InstallModulesWizardArgs)wizardArgs;
            Product product = args.Product;

            Assert.IsNotNull(product, "product");
            Product[] selectedModules = this.unfilteredProductFamilies.Where(mm => mm.IsChecked).Select(mm => mm.Value).ToArray();
            args.Modules.AddRange(selectedModules.Where(module => !args.Modules.Any(p => p.Name.Equals(module.Name, StringComparison.OrdinalIgnoreCase))));

            return(true);
        }
Ejemplo n.º 29
0
        public void InitializeStep(WizardArgs wizardArgs)
        {
            this.WizardArgs = wizardArgs;
            var args = (InstallModulesWizardArgs)wizardArgs;

            this.actualProducts.Clear();
            args.Modules.ForEach(module => this.actualProducts.Add(module));

            this.modulesList.ItemsSource          = this.actualProducts;
            this.selectedProductLabel.DataContext = args.Product;
        }
        public void InitializeStep([NotNull] WizardArgs wizardArgs)
        {
            Assert.ArgumentNotNull(wizardArgs, nameof(wizardArgs));

            var args = (InstallWizardArgs)wizardArgs;

            PreHeat.IsChecked                  = args.PreHeat;
            Dictionaries.IsChecked             = args.SkipDictionaries;
            RadControls.IsChecked              = args.SkipRadControls;
            ServerSideRedirect.IsChecked       = args.ServerSideRedirect;
            IncreaseExecutionTimeout.IsChecked = args.IncreaseExecutionTimeout;
        }