Exemplo n.º 1
0
        public override void Setup()
        {
            base.Setup();

            WebAdministration.SetupApplicationPool(ServerName, ApplicationPoolName, ManagedRuntimeVersion, ManagedPipelineMode, ApplicationPoolUser, ApplicationPoolUserPassword);
            WebAdministration.SetupApplication(ServerName, SiteName, VirtualDirectoryPath, ApplicationPoolName, InstallationPath);
        }
Exemplo n.º 2
0
        private void LoadLocalWebSites()
        {
            WebAdministration.UnloadServerManager();

            if (!WebAdministration.CanAdminister)
            {
                return;
            }

            try
            {
                var serverManager = WebAdministration.ServerManager;
                if (serverManager == null)
                {
                    return;
                }

                foreach (var s in serverManager.Sites)
                {
                    var comboBoxItem = new ComboBoxItem
                    {
                        Content = s.Name,
                        Tag     = s
                    };

                    Server.Items.Add(comboBoxItem);
                }
            }
            catch (Exception ex)
            {
                AppHost.Output.LogException(ex);
            }
        }
Exemplo n.º 3
0
        private string GetSiteName()
        {
            var comment = string.Empty;

            if (!string.IsNullOrEmpty(Site.WebRootPath))
            {
                if (!Directory.Exists(Site.WebRootPath))
                {
                    comment = "Web Root Path not found";
                }
                else if (!Directory.Exists(Path.Combine(Site.WebRootPath, "bin")))
                {
                    comment = "/bin folder not found";
                }
                else if (!Directory.Exists(Path.Combine(Site.WebRootPath, "sitecore")))
                {
                    comment = "/sitecore folder not found";
                }
                else
                {
                    comment = WebAdministration.GetWebSiteState(Site);
                }
            }

            var result = Site.Name;

            if (!string.IsNullOrEmpty(comment))
            {
                result += string.Format(" ({0})", comment);
            }

            return(result);
        }
        public override void Setup()
        {
            base.Setup();

            SetupNtfsPermissionsToFolder(Path.Combine(InstallationPath, "App_Data"));
            WebAdministration.SetupWinAuth(ServerName, SiteName + VirtualDirectoryPath + "/signin-windows");
            ConfigureInnovatorIISWebApplication(SiteName + VirtualDirectoryPath);
            SetupConfigurationFiles();
        }
Exemplo n.º 5
0
        public override void Remove()
        {
            Logger.Instance.Log(LogLevel.Info, "\nRemoving component ({0}):\n", Id);

            WebAdministration.RemoveApplicationPoolWithApplications(ServerName, ApplicationPoolName);
            WebAdministration.RemoveWinAuth(ServerName, VirtualDirectoryPath);

            base.Remove();
        }
 private void SetupAdditionalApplications()
 {
     WebAdministration.SetupApplication(ServerName, SiteName, VirtualDirectoryPath + "/Client", ApplicationPoolName, Path.Combine(InstallationPath, "Client"));
     ConfigureInnovatorIISWebApplication(SiteName + VirtualDirectoryPath + "/Client");
     WebAdministration.SetupApplication(ServerName, SiteName, VirtualDirectoryPath + "/NotificationServer", ApplicationPoolName, Path.Combine(InstallationPath, "Server"));
     ConfigureInnovatorIISWebApplication(SiteName + VirtualDirectoryPath + "/NotificationServer");
     WebAdministration.SetupApplication(ServerName, SiteName, VirtualDirectoryPath + "/Server", ApplicationPoolName, Path.Combine(InstallationPath, "Server"));
     ConfigureInnovatorIISWebApplication(SiteName + VirtualDirectoryPath + "/Server");
 }
Exemplo n.º 7
0
        private void SetLocalSite([NotNull] object sender, [NotNull] SelectionChangedEventArgs e)
        {
            Debug.ArgumentNotNull(sender, nameof(sender));
            Debug.ArgumentNotNull(e, nameof(e));

            var text = Server.Text;

            if (string.IsNullOrEmpty(text))
            {
                return;
            }

            string webRootPath;
            string hostName;

            try
            {
                dynamic website = null;
                foreach (var item in Server.Items.OfType <ComboBoxItem>())
                {
                    if (item.IsSelected)
                    {
                        website = item.Tag;
                        break;
                    }
                }

                if (website == null)
                {
                    return;
                }

                hostName    = WebAdministration.GetWebSiteHostName(website);
                webRootPath = WebAdministration.GetWebRootPath(website);
            }
            catch
            {
                return;
            }

            e.Handled = true;

            Dispatcher.BeginInvoke(new Action(delegate { Server.Text = hostName; }));
            WebRootPath.Text = webRootPath;
        }
Exemplo n.º 8
0
        public static bool RefreshLocalConnections()
        {
            WebAdministration.UnloadServerManager();

            dynamic serverManager;

            try
            {
                if (!WebAdministration.CanAdminister)
                {
                    return(false);
                }

                serverManager = WebAdministration.ServerManager;
                if (serverManager == null)
                {
                    return(false);
                }
            }
            catch
            {
                return(false);
            }

            var modified = false;

            var folder = GetLocalConnectionFolder();

            AppHost.Files.CreateDirectory(folder);

            var localConnections = connections.Where(c => c.FileName.StartsWith(folder, StringComparison.InvariantCultureIgnoreCase)).ToList();

            try
            {
                foreach (var website in serverManager.Sites)
                {
                    string webRootPath;
                    string hostName;
                    try
                    {
                        hostName    = WebAdministration.GetWebSiteHostName(website);
                        webRootPath = WebAdministration.GetWebRootPath(website);
                    }
                    catch
                    {
                        continue;
                    }

                    var list = connections.Where(c => string.Compare(c.HostName, hostName, StringComparison.InvariantCultureIgnoreCase) == 0).ToList();

                    if (list.Any())
                    {
                        foreach (var connection in list)
                        {
                            if (localConnections.Contains(connection) && connection.WebRootPath != webRootPath)
                            {
                                connection.WebRootPath = webRootPath;
                                modified = true;
                            }

                            localConnections.Remove(connection);
                        }

                        continue;
                    }

                    var newConnection = new Connection
                    {
                        UserName            = "******",
                        Password            = "******",
                        HostName            = hostName,
                        DataServiceName     = "Hard Rock Web Service",
                        WebRootPath         = webRootPath,
                        Description         = hostName,
                        AutomaticallyUpdate = true
                    };

                    newConnection.FileName = GetFileName(newConnection, folder);

                    Add(newConnection);
                    modified = true;
                }
            }
            catch (Exception ex)
            {
                AppHost.Output.LogException(ex);
                return(false);
            }

            foreach (var connection in localConnections)
            {
                Remove(connection);
                modified = true;
            }

            if (modified)
            {
                Save();
            }

            return(modified);
        }
        public override void Remove()
        {
            WebAdministration.RemoveWinAuth(ServerName, SiteName + VirtualDirectoryPath + "/signin-windows");

            base.Remove();
        }
 public void SetupWinAuth()
 {
     WebAdministration.SetupWinAuth(ServerName, SiteName + VirtualDirectoryPath + "/Client/Scripts/login.aspx");
     WebAdministration.SetupWinAuth(ServerName, SiteName + VirtualDirectoryPath + "/Client/Scripts/IOMlogin.aspx");
 }
 private void RemoveAuth()
 {
     WebAdministration.RemoveWinAuth(ServerName, SiteName + VirtualDirectoryPath + "/Server/SharePoint/Auth");
     WebAdministration.RemoveWinAuth(ServerName, SiteName + VirtualDirectoryPath + "/NotificationServer/UserNotifications/Auth");
 }