void configureClick(object sender, EventArgs e) { _repository.Configuration.ForPublication = (sender == publishWebMenuItem); if (_repository.Configuration.ForPublication && string.IsNullOrEmpty(_repository.Configuration.WebPublicationDirectory)) { try { Microsoft.Web.Administration.ServerManager serverMgr = new Microsoft.Web.Administration.ServerManager(); //try to get default directory... _repository.Configuration.WebPublicationDirectory = Path.Combine(serverMgr.Sites[0].Applications[0].VirtualDirectories[0].PhysicalPath.Replace("%SystemDrive%\\", Path.GetPathRoot(Environment.SystemDirectory)), _repository.Configuration.WebApplicationName); } catch { } } if (!_adminWarningDone && !Helper.IsMachineAdministrator()) { if (MessageBox.Show("We recommend to execute the 'Server Manager' application with the option 'Run as administrator' to publish the Web Server application...\r\nDo you want to continue ?", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.Cancel) { _adminWarningDone = true; return; } } if (_repository.Configuration.ForPublication) { if (!Helper.CheckWebServerOS()) return; } var frm = new ConfigurationEditorForm(_repository.Configuration); if (frm.ShowDialog() == DialogResult.OK) { if (string.IsNullOrEmpty(_repository.Configuration.FilePath)) _repository.Configuration.FilePath = _repository.ConfigurationPath; _repository.Configuration.SaveToFile(); } }