CP-41473: Restored options to check for server updates and new versions automatically.

Signed-off-by: Konstantina Chremmou <Konstantina.Chremmou@cloud.com>
This commit is contained in:
Konstantina Chremmou 2023-05-11 21:17:57 +01:00
parent 02ded9ba71
commit 6bed1dcde3
29 changed files with 675 additions and 260 deletions

View File

@ -151,7 +151,7 @@
<value>7.0</value>
</data>
<data name="PRODUCT_VERSION_7_1_2" xml:space="preserve">
<value>XenServer 7.1.2</value>
<value>XenServer 7.1 CU2</value>
</data>
<data name="PRODUCT_VERSION_7_1_2_SHORT" xml:space="preserve">
<value>7.1.2</value>
@ -166,7 +166,7 @@
<value>Citrix Hypervisor 8.2</value>
</data>
<data name="PRODUCT_VERSION_8_2_1" xml:space="preserve">
<value>Citrix Hypervisor 8.2.1</value>
<value>Citrix Hypervisor 8.2 CU1</value>
</data>
<data name="PRODUCT_VERSION_8_2_SHORT" xml:space="preserve">
<value>8.2</value>

View File

@ -81,7 +81,7 @@ namespace CFUValidator
public void Validate(Action<string> statusReporter)
{
statusReporter($"Getting check for updates XML from {_xmlLocation}...");
ReadCheckForUpdatesXML(out var xenServerPatches, out var xenServerVersions, out var clientVersions);
ReadCheckForUpdatesXML(out var xenServerPatches, out var xenServerVersions);
List<string> versionsToCheck;
if (_serverVersion == CFUCommandLineOptionManager.AllVersions)
@ -96,20 +96,17 @@ namespace CFUValidator
var summaryGenerators = new List<ISummaryGenerator>();
foreach (string ver in versionsToCheck)
summaryGenerators.AddRange(RunTestsForGivenServerVersion(ver, xenServerVersions, xenServerPatches, clientVersions, statusReporter));
summaryGenerators.AddRange(RunTestsForGivenServerVersion(ver, xenServerVersions, xenServerPatches, statusReporter));
summaryGenerators.ForEach(s => statusReporter(s.GenerateSummary()));
}
private List<ISummaryGenerator> RunTestsForGivenServerVersion(string serverVersion, List<XenServerVersion> xenServerVersions,
List<XenServerPatch> xenServerPatches, List<ClientVersion> clientVersions, Action<string> statusReporter)
List<XenServerPatch> xenServerPatches, Action<string> statusReporter)
{
statusReporter($"Generating server {serverVersion} mock-ups...");
SetupMocks(serverVersion, xenServerPatches, xenServerVersions);
statusReporter("Determining required client update...");
var xcupdateAlerts = XenAdmin.Core.Updates.NewClientUpdateAlerts(clientVersions, new Version(serverVersion));
statusReporter("Determining required XenServer update...");
var updateAlerts = XenAdmin.Core.Updates.NewXenServerVersionAlerts(xenServerVersions).Where(alert => !alert.CanIgnore).ToList();
@ -132,7 +129,6 @@ namespace CFUValidator
var summaryGenerators = new List<ISummaryGenerator> {new HeaderDecorator(serverVersion, _xmlLocation)};
summaryGenerators.AddRange(validators);
summaryGenerators.Add(new ClientUpdateDecorator(xcupdateAlerts));
summaryGenerators.Add(new XenServerUpdateDecorator(updateAlerts));
summaryGenerators.Add(new PatchAlertDecorator(patchAlerts));
return summaryGenerators;
@ -150,7 +146,7 @@ namespace CFUValidator
}
}
private void ReadCheckForUpdatesXML(out List<XenServerPatch> patches, out List<XenServerVersion> versions, out List<ClientVersion> xcVersions)
private void ReadCheckForUpdatesXML(out List<XenServerPatch> patches, out List<XenServerVersion> versions)
{
ICheckForUpdatesXMLSource checkForUpdates = xmlFactory.GetAction(UrlOrFile, _xmlLocation);
checkForUpdates.RunAsync();
@ -166,7 +162,6 @@ namespace CFUValidator
patches = checkForUpdates.XenServerPatches;
versions = checkForUpdates.XenServerVersions;
xcVersions = checkForUpdates.ClientVersions;
}
private void SetupMocks(string versionToCheck, List<XenServerPatch> xenServerPatches, List<XenServerVersion> xenServerVersions)

View File

@ -99,34 +99,6 @@ namespace CFUValidator.OutputDecorators
}
class ClientUpdateDecorator : AlertDecorator
{
private readonly List<ClientUpdateAlert> _alerts;
public ClientUpdateDecorator(List<ClientUpdateAlert> alerts)
{
_alerts = alerts;
}
protected override string GenerateSummaryCore()
{
if (_alerts.Count == 0)
return "None";
var sb = new StringBuilder();
foreach (ClientUpdateAlert alert in _alerts)
sb.AppendLine(alert == null
? "Client update could not be found"
: $"{alert.NewVersion.Name} ({alert.NewVersion.VersionAndLang})");
return sb.ToString();
}
protected override string SummaryTitle => "Client updates required:";
}
class PatchAlertDecorator : AlertDecorator
{
private readonly List<XenServerPatchAlert> _alerts;

View File

@ -37,12 +37,12 @@ using XenAdmin.Actions;
namespace CFUValidator.Updates
{
class AlternativeUrlDownloadUpdatesXmlSourceAction : DownloadUpdatesXmlAction, ICheckForUpdatesXMLSource
class AlternativeUrlDownloadUpdatesXmlSourceAction : DownloadCfuAction, ICheckForUpdatesXMLSource
{
private readonly string _url;
public AlternativeUrlDownloadUpdatesXmlSourceAction(string url)
: base(true, true, true, "CFU", true)
: base(true, true, "CFU", url, true)
{
_url = url ?? throw new ArgumentNullException(nameof(url));
}

View File

@ -38,7 +38,6 @@ namespace CFUValidator.Updates
{
List<XenServerPatch> XenServerPatches { get; }
List<XenServerVersion> XenServerVersions{ get; }
List<ClientVersion> ClientVersions { get; }
bool IsCompleted { get; }
void RunAsync();
int PercentComplete { get; }

View File

@ -35,12 +35,12 @@ using XenAdmin.Actions;
namespace CFUValidator.Updates
{
class ReadFromFileUpdatesXmlSource : DownloadUpdatesXmlAction, ICheckForUpdatesXMLSource
class ReadFromFileUpdatesXmlSource : DownloadCfuAction, ICheckForUpdatesXMLSource
{
private readonly string _location;
public ReadFromFileUpdatesXmlSource(string location)
: base(true, true, true, "CFU", true)
: base(true, true, "CFU", location, true)
{
_location = location ?? throw new ArgumentNullException(nameof(location));
}

2
Jenkinsfile vendored
View File

@ -30,7 +30,7 @@
* SUCH DAMAGE.
*/
def XENADMIN_BRANDING_TAG = 'v4.16'
def XENADMIN_BRANDING_TAG = 'merge'
@Library(['PacmanSharedLibrary', "xencenter-pipeline@v4.7"])
import com.citrix.pipeline.xencenter.*

View File

@ -74,6 +74,8 @@ namespace XenAdmin.Core
internal struct CFU
{
public bool AllowXenCenterUpdates;
public bool AllowPatchesUpdates;
public bool AllowXenServerUpdates;
}
internal struct Proxy
@ -128,7 +130,12 @@ namespace XenAdmin.Core
},
Settings = new XenCenterSettings
{
CFU = new CFU {AllowXenCenterUpdates = Properties.Settings.Default.AllowXenCenterUpdates},
CFU = new CFU
{
AllowXenCenterUpdates = Properties.Settings.Default.AllowXenCenterUpdates,
AllowPatchesUpdates = Properties.Settings.Default.AllowPatchesUpdates,
AllowXenServerUpdates = Properties.Settings.Default.AllowXenServerUpdates
},
Proxy = new Proxy
{
UseProxy = (HTTPHelper.ProxyStyle) Properties.Settings.Default.ProxySetting == HTTPHelper.ProxyStyle.SpecifiedProxy,

View File

@ -156,9 +156,14 @@ namespace XenAdmin.Core
public static string AdditionalFeatures => ReadInstalledKey(ADDITIONAL_FEATURES, RegistryView.Registry32);
public static string GetCustomUpdatesXmlLocation()
public static string GetCustomXcUpdatesXmlLocation()
{
return ReadInstalledKey(CUSTOM_UPDATES_XML_LOCATION);
return ReadInstalledKey(CUSTOM_XC_UPDATES_XML_LOCATION);
}
public static string GetCustomCfuLocation()
{
return ReadInstalledKey(CUSTOM_CFU_LOCATION);
}
public static string GetInternalStageAuthToken()
@ -197,7 +202,8 @@ namespace XenAdmin.Core
private const string PowerShellStamp = "Install";
private const string HIDDEN_FEATURES = "HiddenFeatures";
private const string ADDITIONAL_FEATURES = "AdditionalFeatures";
private const string CUSTOM_UPDATES_XML_LOCATION = "CheckForUpdatesXmlLocationOverride";
private const string CUSTOM_XC_UPDATES_XML_LOCATION = "XcUpdatesXmlLocationOverride";
private const string CUSTOM_CFU_LOCATION = "CfuLocationOverride";
private const string INTERNAL_STAGE_AUTH_TOKEN = "InternalStageAuthToken";
private const string CUSTOM_FILESERVICE_PREFIX = "PatchUrlPrefixOverride";
private const string CUSTOM_CLIENT_ID_URL = "ClientIdUrlOverride";

View File

@ -46,8 +46,10 @@ namespace XenAdmin.Core
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public static event Action CheckForUpdatesCompleted;
public static event Action CheckForUpdatesStarted;
public static event Action CheckForClientUpdatesStarted;
public static event Action CheckForClientUpdatesCompleted;
public static event Action CheckForServerUpdatesStarted;
public static event Action CheckForServerUpdatesCompleted;
public static event Action<CollectionChangeEventArgs> UpdateAlertCollectionChanged;
private static readonly object downloadedUpdatesLock = new object();
@ -90,7 +92,7 @@ namespace XenAdmin.Core
/// value of the parameter userRequested. If AutomaticCheck is disabled it checks
/// for all update types if userRequested is true.
/// </summary>
public static void CheckForUpdates(bool userRequested = false)
public static void CheckForClientUpdates(bool userRequested = false)
{
if (Helpers.CommonCriteriaCertificationRelease)
return;
@ -99,21 +101,49 @@ namespace XenAdmin.Core
{
string userAgent = $"{BrandManager.BrandConsole}/{Program.Version} ({IntPtr.Size * 8}-bit)";
var action = new DownloadUpdatesXmlAction(Properties.Settings.Default.AllowXenCenterUpdates || userRequested,
false, false, userAgent, !userRequested);
action.Completed += actionCompleted;
CheckForUpdatesStarted?.Invoke();
var action = new DownloadXcUpdatesXmlAction(
Properties.Settings.Default.AllowXenCenterUpdates || userRequested,
userAgent,
XenAdminConfigManager.Provider.GetCustomXcUpdatesXmlLocation() ?? BrandManager.XcUpdatesUrl,
!userRequested);
action.Completed += DownloadXcUpdatesXmlAction_Completed;
CheckForClientUpdatesStarted?.Invoke();
action.RunAsync();
}
}
private static void actionCompleted(ActionBase sender)
/// <summary>
/// If AutomaticCheck is enabled it checks for updates regardless the
/// value of the parameter userRequested. If AutomaticCheck is disabled it checks
/// for all update types if userRequested is true.
/// </summary>
public static void CheckForServerUpdates(bool userRequested = false)
{
Program.AssertOffEventThread();
if (Helpers.CommonCriteriaCertificationRelease)
return;
if (!(sender is DownloadUpdatesXmlAction action))
if (Properties.Settings.Default.AllowPatchesUpdates ||
Properties.Settings.Default.AllowXenServerUpdates || userRequested)
{
string userAgent = $"{BrandManager.BrandConsole}/{Program.Version} ({IntPtr.Size * 8}-bit)";
var action = new DownloadCfuAction(
Properties.Settings.Default.AllowXenServerUpdates || userRequested,
Properties.Settings.Default.AllowPatchesUpdates || userRequested,
userAgent,
XenAdminConfigManager.Provider.GetCustomCfuLocation() ?? BrandManager.CfuUrl,
!userRequested);
action.Completed += DownloadCfuAction_Completed;
CheckForServerUpdatesStarted?.Invoke();
action.RunAsync();
}
}
private static void DownloadXcUpdatesXmlAction_Completed(ActionBase sender)
{
if (!(sender is DownloadXcUpdatesXmlAction action))
return;
bool succeeded = action.Succeeded;
@ -123,9 +153,6 @@ namespace XenAdmin.Core
lock (downloadedUpdatesLock)
{
ClientVersions = action.ClientVersions;
XenServerVersionsForAutoCheck = action.XenServerVersionsForAutoCheck;
XenServerVersions = action.XenServerVersions;
XenServerPatches = action.XenServerPatches;
}
}
@ -137,7 +164,46 @@ namespace XenAdmin.Core
{
var clientUpdateAlerts = NewClientUpdateAlerts(ClientVersions, Program.Version);
updateAlerts.AddRange(clientUpdateAlerts.Where(a => !a.IsDismissed()));
}
var xenServerUpdateAlerts = NewXenServerVersionAlerts(XenServerVersionsForAutoCheck);
updateAlerts.AddRange(xenServerUpdateAlerts.Where(a => !a.CanIgnore));
var xenServerPatchAlerts = NewXenServerPatchAlerts(XenServerVersions, XenServerPatches);
updateAlerts.AddRange(xenServerPatchAlerts.Where(a => !a.CanIgnore));
}
UpdateAlertCollectionChanged?.Invoke(new CollectionChangeEventArgs(CollectionChangeAction.Refresh, UpdateAlerts));
CheckForClientUpdatesCompleted?.Invoke();
}
private static void DownloadCfuAction_Completed(ActionBase sender)
{
if (!(sender is DownloadCfuAction action))
return;
bool succeeded = action.Succeeded;
if (succeeded)
{
lock (downloadedUpdatesLock)
{
XenServerVersionsForAutoCheck = action.XenServerVersionsForAutoCheck;
XenServerVersions = action.XenServerVersions;
XenServerPatches = action.XenServerPatches;
}
}
lock (updateAlertsLock)
{
updateAlerts.Clear();
var clientUpdateAlerts = NewClientUpdateAlerts(ClientVersions, Program.Version);
updateAlerts.AddRange(clientUpdateAlerts.Where(a => !a.IsDismissed()));
if (succeeded)
{
var xenServerUpdateAlerts = NewXenServerVersionAlerts(XenServerVersionsForAutoCheck);
updateAlerts.AddRange(xenServerUpdateAlerts.Where(a => !a.CanIgnore));
@ -148,7 +214,9 @@ namespace XenAdmin.Core
UpdateAlertCollectionChanged?.Invoke(new CollectionChangeEventArgs(CollectionChangeAction.Refresh, UpdateAlerts));
CheckForUpdatesCompleted?.Invoke();
CheckForServerUpdatesCompleted?.Invoke();
CheckHotfixEligibility();
}
public static List<ClientUpdateAlert> NewClientUpdateAlerts(List<ClientVersion> clientVersions,
@ -766,7 +834,7 @@ namespace XenAdmin.Core
Alert.RefreshAlertAt(alertIndex);
}
public static void CheckHotfixEligibility()
private static void CheckHotfixEligibility()
{
var alerts = new List<HotfixEligibilityAlert>();

View File

@ -30,46 +30,94 @@ namespace XenAdmin.Dialogs.OptionsPages
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UpdatesOptionsPage));
this.UpdatesTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
this.UpdatesBlurb = new System.Windows.Forms.Label();
this.AllowXenCenterUpdatesCheckBox = new System.Windows.Forms.CheckBox();
this.groupBoxClientId = new System.Windows.Forms.GroupBox();
this.groupBoxServer = new System.Windows.Forms.GroupBox();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.labelServerUpdates = new System.Windows.Forms.Label();
this.clientIdControl1 = new XenAdmin.Controls.ClientIdControl();
this._checkBoxServerVersions = new System.Windows.Forms.CheckBox();
this._checkBoxServerUpdates = new System.Windows.Forms.CheckBox();
this.groupBoxClient = new System.Windows.Forms.GroupBox();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.labelClientUpdates = new System.Windows.Forms.Label();
this._checkBoxClientUpdates = new System.Windows.Forms.CheckBox();
this.UpdatesTableLayoutPanel.SuspendLayout();
this.groupBoxClientId.SuspendLayout();
this.groupBoxServer.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.groupBoxClient.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout();
this.SuspendLayout();
//
// UpdatesTableLayoutPanel
//
resources.ApplyResources(this.UpdatesTableLayoutPanel, "UpdatesTableLayoutPanel");
this.UpdatesTableLayoutPanel.BackColor = System.Drawing.Color.Transparent;
this.UpdatesTableLayoutPanel.Controls.Add(this.UpdatesBlurb, 0, 0);
this.UpdatesTableLayoutPanel.Controls.Add(this.AllowXenCenterUpdatesCheckBox, 0, 1);
this.UpdatesTableLayoutPanel.Controls.Add(this.groupBoxClientId, 0, 2);
this.UpdatesTableLayoutPanel.Controls.Add(this.groupBoxServer, 0, 1);
this.UpdatesTableLayoutPanel.Controls.Add(this.groupBoxClient, 0, 0);
this.UpdatesTableLayoutPanel.Name = "UpdatesTableLayoutPanel";
//
// UpdatesBlurb
// groupBoxServer
//
resources.ApplyResources(this.UpdatesBlurb, "UpdatesBlurb");
this.UpdatesBlurb.Name = "UpdatesBlurb";
this.groupBoxServer.Controls.Add(this.tableLayoutPanel1);
resources.ApplyResources(this.groupBoxServer, "groupBoxServer");
this.groupBoxServer.Name = "groupBoxServer";
this.groupBoxServer.TabStop = false;
//
// AllowXenCenterUpdatesCheckBox
// tableLayoutPanel1
//
resources.ApplyResources(this.AllowXenCenterUpdatesCheckBox, "AllowXenCenterUpdatesCheckBox");
this.AllowXenCenterUpdatesCheckBox.Name = "AllowXenCenterUpdatesCheckBox";
this.AllowXenCenterUpdatesCheckBox.UseVisualStyleBackColor = true;
resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1");
this.tableLayoutPanel1.Controls.Add(this.labelServerUpdates, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.clientIdControl1, 0, 3);
this.tableLayoutPanel1.Controls.Add(this._checkBoxServerVersions, 0, 2);
this.tableLayoutPanel1.Controls.Add(this._checkBoxServerUpdates, 0, 1);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
//
// groupBoxClientId
// labelServerUpdates
//
resources.ApplyResources(this.groupBoxClientId, "groupBoxClientId");
this.groupBoxClientId.Controls.Add(this.clientIdControl1);
this.groupBoxClientId.Name = "groupBoxClientId";
this.groupBoxClientId.TabStop = false;
resources.ApplyResources(this.labelServerUpdates, "labelServerUpdates");
this.labelServerUpdates.Name = "labelServerUpdates";
//
// clientIdControl1
//
resources.ApplyResources(this.clientIdControl1, "clientIdControl1");
this.clientIdControl1.Name = "clientIdControl1";
//
// _checkBoxServerVersions
//
resources.ApplyResources(this._checkBoxServerVersions, "_checkBoxServerVersions");
this._checkBoxServerVersions.Name = "_checkBoxServerVersions";
this._checkBoxServerVersions.UseVisualStyleBackColor = true;
//
// _checkBoxServerUpdates
//
resources.ApplyResources(this._checkBoxServerUpdates, "_checkBoxServerUpdates");
this._checkBoxServerUpdates.Name = "_checkBoxServerUpdates";
this._checkBoxServerUpdates.UseVisualStyleBackColor = true;
//
// groupBoxClient
//
this.groupBoxClient.Controls.Add(this.tableLayoutPanel2);
resources.ApplyResources(this.groupBoxClient, "groupBoxClient");
this.groupBoxClient.Name = "groupBoxClient";
this.groupBoxClient.TabStop = false;
//
// tableLayoutPanel2
//
resources.ApplyResources(this.tableLayoutPanel2, "tableLayoutPanel2");
this.tableLayoutPanel2.Controls.Add(this.labelClientUpdates, 0, 0);
this.tableLayoutPanel2.Controls.Add(this._checkBoxClientUpdates, 0, 1);
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
//
// labelClientUpdates
//
resources.ApplyResources(this.labelClientUpdates, "labelClientUpdates");
this.labelClientUpdates.Name = "labelClientUpdates";
//
// _checkBoxClientUpdates
//
resources.ApplyResources(this._checkBoxClientUpdates, "_checkBoxClientUpdates");
this._checkBoxClientUpdates.Name = "_checkBoxClientUpdates";
this._checkBoxClientUpdates.UseVisualStyleBackColor = true;
//
// UpdatesOptionsPage
//
resources.ApplyResources(this, "$this");
@ -77,8 +125,12 @@ namespace XenAdmin.Dialogs.OptionsPages
this.Controls.Add(this.UpdatesTableLayoutPanel);
this.Name = "UpdatesOptionsPage";
this.UpdatesTableLayoutPanel.ResumeLayout(false);
this.UpdatesTableLayoutPanel.PerformLayout();
this.groupBoxClientId.ResumeLayout(false);
this.groupBoxServer.ResumeLayout(false);
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.groupBoxClient.ResumeLayout(false);
this.tableLayoutPanel2.ResumeLayout(false);
this.tableLayoutPanel2.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@ -87,9 +139,15 @@ namespace XenAdmin.Dialogs.OptionsPages
#endregion
private System.Windows.Forms.TableLayoutPanel UpdatesTableLayoutPanel;
private System.Windows.Forms.Label UpdatesBlurb;
private System.Windows.Forms.CheckBox AllowXenCenterUpdatesCheckBox;
private System.Windows.Forms.GroupBox groupBoxClientId;
private System.Windows.Forms.Label labelClientUpdates;
private System.Windows.Forms.CheckBox _checkBoxClientUpdates;
private System.Windows.Forms.GroupBox groupBoxServer;
private Controls.ClientIdControl clientIdControl1;
private System.Windows.Forms.CheckBox _checkBoxServerUpdates;
private System.Windows.Forms.CheckBox _checkBoxServerVersions;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Label labelServerUpdates;
private System.Windows.Forms.GroupBox groupBoxClient;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
}
}

View File

@ -30,7 +30,6 @@
using System.Drawing;
using System.Windows.Forms;
using XenAdmin.Controls;
using XenAdmin.Core;
using XenCenterLib;
@ -42,16 +41,24 @@ namespace XenAdmin.Dialogs.OptionsPages
public UpdatesOptionsPage()
{
InitializeComponent();
UpdatesBlurb.Text = string.Format(UpdatesBlurb.Text, BrandManager.BrandConsole);
AllowXenCenterUpdatesCheckBox.Text = string.Format(AllowXenCenterUpdatesCheckBox.Text, BrandManager.BrandConsole);
groupBoxClient.Text = string.Format(groupBoxClient.Text, BrandManager.BrandConsole);
labelClientUpdates.Text = string.Format(labelClientUpdates.Text, BrandManager.BrandConsole);
_checkBoxClientUpdates.Text = string.Format(_checkBoxClientUpdates.Text, BrandManager.BrandConsole);
groupBoxServer.Text = string.Format(groupBoxServer.Text, BrandManager.ProductVersion821);
labelServerUpdates.Text = string.Format(labelServerUpdates.Text, BrandManager.BrandConsole, BrandManager.ProductBrand);
_checkBoxServerUpdates.Text = string.Format(_checkBoxServerUpdates.Text, BrandManager.ProductBrand);
_checkBoxServerVersions.Text = string.Format(_checkBoxServerVersions.Text, BrandManager.ProductBrand);
}
#region IOptionsPage Members
public void Build()
{
// XenCenter updates
AllowXenCenterUpdatesCheckBox.Checked = Properties.Settings.Default.AllowXenCenterUpdates;
_checkBoxServerVersions.Checked = Properties.Settings.Default.AllowXenServerUpdates;
_checkBoxServerUpdates.Checked = Properties.Settings.Default.AllowPatchesUpdates;
_checkBoxClientUpdates.Checked = Properties.Settings.Default.AllowXenCenterUpdates;
clientIdControl1.Build();
}
@ -78,15 +85,22 @@ namespace XenAdmin.Dialogs.OptionsPages
if (!string.IsNullOrEmpty(clientIdControl1.FileServiceClientId))
Properties.Settings.Default.FileServiceClientId = EncryptionUtils.Protect(clientIdControl1.FileServiceClientId);
bool checkXenCenterUpdatesChanged = AllowXenCenterUpdatesCheckBox.Checked != Properties.Settings.Default.AllowXenCenterUpdates;
if (checkXenCenterUpdatesChanged)
if (_checkBoxClientUpdates.Checked != Properties.Settings.Default.AllowXenCenterUpdates)
{
Properties.Settings.Default.AllowXenCenterUpdates = AllowXenCenterUpdatesCheckBox.Checked;
Properties.Settings.Default.AllowXenCenterUpdates = _checkBoxClientUpdates.Checked;
if (Properties.Settings.Default.AllowXenCenterUpdates)
Updates.CheckForUpdates(true);
Updates.CheckForClientUpdates(true);
}
if (_checkBoxServerUpdates.Checked != Properties.Settings.Default.AllowPatchesUpdates ||
_checkBoxServerVersions.Checked != Properties.Settings.Default.AllowXenServerUpdates)
{
Properties.Settings.Default.AllowPatchesUpdates = _checkBoxServerUpdates.Checked;
Properties.Settings.Default.AllowXenServerUpdates = _checkBoxServerVersions.Checked;
if (Properties.Settings.Default.AllowPatchesUpdates || Properties.Settings.Default.AllowXenServerUpdates)
Updates.CheckForServerUpdates(true);
}
}

View File

@ -128,102 +128,63 @@
<data name="UpdatesTableLayoutPanel.ColumnCount" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="UpdatesBlurb.AutoSize" type="System.Boolean, mscorlib">
<data name="tableLayoutPanel1.ColumnCount" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="labelServerUpdates.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="UpdatesBlurb.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<data name="labelServerUpdates.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="UpdatesBlurb.Font" type="System.Drawing.Font, System.Drawing">
<data name="labelServerUpdates.Font" type="System.Drawing.Font, System.Drawing">
<value>Tahoma, 8pt</value>
</data>
<data name="UpdatesBlurb.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<data name="labelServerUpdates.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="UpdatesBlurb.Location" type="System.Drawing.Point, System.Drawing">
<data name="labelServerUpdates.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 0</value>
</data>
<data name="UpdatesBlurb.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 0, 3, 12</value>
<data name="labelServerUpdates.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 0, 3, 10</value>
</data>
<data name="UpdatesBlurb.Size" type="System.Drawing.Size, System.Drawing">
<value>583, 26</value>
<data name="labelServerUpdates.Size" type="System.Drawing.Size, System.Drawing">
<value>571, 26</value>
</data>
<data name="UpdatesBlurb.TabIndex" type="System.Int32, mscorlib">
<data name="labelServerUpdates.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="UpdatesBlurb.Text" xml:space="preserve">
<value>You can configure {0} to periodically check for available updates and prompt you when a new version of the application is available for download.</value>
<data name="labelServerUpdates.Text" xml:space="preserve">
<value>You can configure {0} to periodically check for available updates and prompt you when a {1} update or new version is available.</value>
</data>
<data name="&gt;&gt;UpdatesBlurb.Name" xml:space="preserve">
<value>UpdatesBlurb</value>
<data name="&gt;&gt;labelServerUpdates.Name" xml:space="preserve">
<value>labelServerUpdates</value>
</data>
<data name="&gt;&gt;UpdatesBlurb.Type" xml:space="preserve">
<data name="&gt;&gt;labelServerUpdates.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;UpdatesBlurb.Parent" xml:space="preserve">
<value>UpdatesTableLayoutPanel</value>
<data name="&gt;&gt;labelServerUpdates.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;UpdatesBlurb.ZOrder" xml:space="preserve">
<data name="&gt;&gt;labelServerUpdates.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="AllowXenCenterUpdatesCheckBox.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="AllowXenCenterUpdatesCheckBox.Font" type="System.Drawing.Font, System.Drawing">
<value>Tahoma, 8pt</value>
</data>
<data name="AllowXenCenterUpdatesCheckBox.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="AllowXenCenterUpdatesCheckBox.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 41</value>
</data>
<data name="AllowXenCenterUpdatesCheckBox.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 0, 0, 0</value>
</data>
<data name="AllowXenCenterUpdatesCheckBox.Size" type="System.Drawing.Size, System.Drawing">
<value>173, 17</value>
</data>
<data name="AllowXenCenterUpdatesCheckBox.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="AllowXenCenterUpdatesCheckBox.Text" xml:space="preserve">
<value>Check for &amp;new versions of {0}</value>
</data>
<data name="&gt;&gt;AllowXenCenterUpdatesCheckBox.Name" xml:space="preserve">
<value>AllowXenCenterUpdatesCheckBox</value>
</data>
<data name="&gt;&gt;AllowXenCenterUpdatesCheckBox.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;AllowXenCenterUpdatesCheckBox.Parent" xml:space="preserve">
<value>UpdatesTableLayoutPanel</value>
</data>
<data name="&gt;&gt;AllowXenCenterUpdatesCheckBox.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="groupBoxClientId.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="groupBoxClientId.AutoSizeMode" type="System.Windows.Forms.AutoSizeMode, System.Windows.Forms">
<value>GrowAndShrink</value>
</data>
<data name="clientIdControl1.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Left, Right</value>
<data name="clientIdControl1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="clientIdControl1.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 22</value>
<value>0, 92</value>
</data>
<data name="clientIdControl1.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 6, 6, 3</value>
<value>0, 10, 3, 3</value>
</data>
<data name="clientIdControl1.Size" type="System.Drawing.Size, System.Drawing">
<value>577, 139</value>
<value>574, 158</value>
</data>
<data name="clientIdControl1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
<value>3</value>
</data>
<data name="&gt;&gt;clientIdControl1.Name" xml:space="preserve">
<value>clientIdControl1</value>
@ -232,38 +193,278 @@
<value>XenAdmin.Controls.ClientIdControl, [XenCenter_No_Space], Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;clientIdControl1.Parent" xml:space="preserve">
<value>groupBoxClientId</value>
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;clientIdControl1.ZOrder" xml:space="preserve">
<value>0</value>
<value>1</value>
</data>
<data name="groupBoxClientId.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<data name="_checkBoxServerVersions.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="_checkBoxServerVersions.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="_checkBoxServerVersions.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 62</value>
</data>
<data name="_checkBoxServerVersions.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 0, 0, 0</value>
</data>
<data name="_checkBoxServerVersions.Size" type="System.Drawing.Size, System.Drawing">
<value>173, 17</value>
</data>
<data name="_checkBoxServerVersions.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="_checkBoxServerVersions.Text" xml:space="preserve">
<value>Check for new &amp;versions of {0}</value>
</data>
<data name="&gt;&gt;_checkBoxServerVersions.Name" xml:space="preserve">
<value>_checkBoxServerVersions</value>
</data>
<data name="&gt;&gt;_checkBoxServerVersions.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;_checkBoxServerVersions.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;_checkBoxServerVersions.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="_checkBoxServerUpdates.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="_checkBoxServerUpdates.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="_checkBoxServerUpdates.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 39</value>
</data>
<data name="_checkBoxServerUpdates.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 0, 0, 0</value>
</data>
<data name="_checkBoxServerUpdates.Size" type="System.Drawing.Size, System.Drawing">
<value>136, 17</value>
</data>
<data name="_checkBoxServerUpdates.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="_checkBoxServerUpdates.Text" xml:space="preserve">
<value>Check for {0} &amp;updates</value>
</data>
<data name="&gt;&gt;_checkBoxServerUpdates.Name" xml:space="preserve">
<value>_checkBoxServerUpdates</value>
</data>
<data name="&gt;&gt;_checkBoxServerUpdates.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;_checkBoxServerUpdates.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;_checkBoxServerUpdates.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="tableLayoutPanel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="groupBoxClientId.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 64</value>
<data name="tableLayoutPanel1.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 19</value>
</data>
<data name="groupBoxClientId.Size" type="System.Drawing.Size, System.Drawing">
<value>583, 180</value>
<data name="tableLayoutPanel1.RowCount" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="groupBoxClientId.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
<data name="tableLayoutPanel1.Size" type="System.Drawing.Size, System.Drawing">
<value>577, 253</value>
</data>
<data name="groupBoxClientId.Text" xml:space="preserve">
<value>Client ID</value>
<data name="tableLayoutPanel1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;groupBoxClientId.Name" xml:space="preserve">
<value>groupBoxClientId</value>
<data name="&gt;&gt;tableLayoutPanel1.Name" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;groupBoxClientId.Type" xml:space="preserve">
<data name="&gt;&gt;tableLayoutPanel1.Type" xml:space="preserve">
<value>System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tableLayoutPanel1.Parent" xml:space="preserve">
<value>groupBoxServer</value>
</data>
<data name="&gt;&gt;tableLayoutPanel1.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="tableLayoutPanel1.LayoutSettings" type="System.Windows.Forms.TableLayoutSettings, System.Windows.Forms">
<value>&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;TableLayoutSettings&gt;&lt;Controls&gt;&lt;Control Name="labelServerUpdates" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="clientIdControl1" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="_checkBoxServerVersions" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="_checkBoxServerUpdates" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;/Controls&gt;&lt;Columns Styles="Percent,100" /&gt;&lt;Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0" /&gt;&lt;/TableLayoutSettings&gt;</value>
</data>
<data name="groupBoxServer.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="groupBoxServer.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 121</value>
</data>
<data name="groupBoxServer.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 6, 3, 3</value>
</data>
<data name="groupBoxServer.Size" type="System.Drawing.Size, System.Drawing">
<value>583, 275</value>
</data>
<data name="groupBoxServer.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="groupBoxServer.Text" xml:space="preserve">
<value>Updates for {0} or earlier</value>
</data>
<data name="&gt;&gt;groupBoxServer.Name" xml:space="preserve">
<value>groupBoxServer</value>
</data>
<data name="&gt;&gt;groupBoxServer.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;groupBoxClientId.Parent" xml:space="preserve">
<data name="&gt;&gt;groupBoxServer.Parent" xml:space="preserve">
<value>UpdatesTableLayoutPanel</value>
</data>
<data name="&gt;&gt;groupBoxClientId.ZOrder" xml:space="preserve">
<data name="&gt;&gt;groupBoxServer.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="tableLayoutPanel2.ColumnCount" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="labelClientUpdates.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="labelClientUpdates.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="labelClientUpdates.Font" type="System.Drawing.Font, System.Drawing">
<value>Tahoma, 8pt</value>
</data>
<data name="labelClientUpdates.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="labelClientUpdates.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 0</value>
</data>
<data name="labelClientUpdates.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 0, 3, 10</value>
</data>
<data name="labelClientUpdates.Size" type="System.Drawing.Size, System.Drawing">
<value>571, 26</value>
</data>
<data name="labelClientUpdates.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="labelClientUpdates.Text" xml:space="preserve">
<value>You can configure {0} to periodically check for available updates and prompt you when a new version of the application is available for download.</value>
</data>
<data name="&gt;&gt;labelClientUpdates.Name" xml:space="preserve">
<value>labelClientUpdates</value>
</data>
<data name="&gt;&gt;labelClientUpdates.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;labelClientUpdates.Parent" xml:space="preserve">
<value>tableLayoutPanel2</value>
</data>
<data name="&gt;&gt;labelClientUpdates.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="_checkBoxClientUpdates.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="_checkBoxClientUpdates.Font" type="System.Drawing.Font, System.Drawing">
<value>Tahoma, 8pt</value>
</data>
<data name="_checkBoxClientUpdates.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="_checkBoxClientUpdates.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 39</value>
</data>
<data name="_checkBoxClientUpdates.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 0, 0, 0</value>
</data>
<data name="_checkBoxClientUpdates.Size" type="System.Drawing.Size, System.Drawing">
<value>173, 17</value>
</data>
<data name="_checkBoxClientUpdates.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="_checkBoxClientUpdates.Text" xml:space="preserve">
<value>Check for &amp;new versions of {0}</value>
</data>
<data name="&gt;&gt;_checkBoxClientUpdates.Name" xml:space="preserve">
<value>_checkBoxClientUpdates</value>
</data>
<data name="&gt;&gt;_checkBoxClientUpdates.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;_checkBoxClientUpdates.Parent" xml:space="preserve">
<value>tableLayoutPanel2</value>
</data>
<data name="&gt;&gt;_checkBoxClientUpdates.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="tableLayoutPanel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="tableLayoutPanel2.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 19</value>
</data>
<data name="tableLayoutPanel2.RowCount" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="tableLayoutPanel2.Size" type="System.Drawing.Size, System.Drawing">
<value>577, 78</value>
</data>
<data name="tableLayoutPanel2.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;tableLayoutPanel2.Name" xml:space="preserve">
<value>tableLayoutPanel2</value>
</data>
<data name="&gt;&gt;tableLayoutPanel2.Type" xml:space="preserve">
<value>System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tableLayoutPanel2.Parent" xml:space="preserve">
<value>groupBoxClient</value>
</data>
<data name="&gt;&gt;tableLayoutPanel2.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="tableLayoutPanel2.LayoutSettings" type="System.Windows.Forms.TableLayoutSettings, System.Windows.Forms">
<value>&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;TableLayoutSettings&gt;&lt;Controls&gt;&lt;Control Name="labelClientUpdates" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="_checkBoxClientUpdates" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;/Controls&gt;&lt;Columns Styles="Percent,100" /&gt;&lt;Rows Styles="AutoSize,0,Percent,100" /&gt;&lt;/TableLayoutSettings&gt;</value>
</data>
<data name="groupBoxClient.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="groupBoxClient.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 3</value>
</data>
<data name="groupBoxClient.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 3, 3, 15</value>
</data>
<data name="groupBoxClient.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 6, 3, 3</value>
</data>
<data name="groupBoxClient.Size" type="System.Drawing.Size, System.Drawing">
<value>583, 100</value>
</data>
<data name="groupBoxClient.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="groupBoxClient.Text" xml:space="preserve">
<value>{0} Updates</value>
</data>
<data name="&gt;&gt;groupBoxClient.Name" xml:space="preserve">
<value>groupBoxClient</value>
</data>
<data name="&gt;&gt;groupBoxClient.Type" xml:space="preserve">
<value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;groupBoxClient.Parent" xml:space="preserve">
<value>UpdatesTableLayoutPanel</value>
</data>
<data name="&gt;&gt;groupBoxClient.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="UpdatesTableLayoutPanel.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
@ -274,7 +475,7 @@
<value>0, 0</value>
</data>
<data name="UpdatesTableLayoutPanel.RowCount" type="System.Int32, mscorlib">
<value>4</value>
<value>3</value>
</data>
<data name="UpdatesTableLayoutPanel.Size" type="System.Drawing.Size, System.Drawing">
<value>589, 412</value>
@ -295,7 +496,7 @@
<value>0</value>
</data>
<data name="UpdatesTableLayoutPanel.LayoutSettings" type="System.Windows.Forms.TableLayoutSettings, System.Windows.Forms">
<value>&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;TableLayoutSettings&gt;&lt;Controls&gt;&lt;Control Name="UpdatesBlurb" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="AllowXenCenterUpdatesCheckBox" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="groupBoxClientId" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;/Controls&gt;&lt;Columns Styles="Percent,100" /&gt;&lt;Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,Percent,100" /&gt;&lt;/TableLayoutSettings&gt;</value>
<value>&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;TableLayoutSettings&gt;&lt;Controls&gt;&lt;Control Name="groupBoxServer" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="groupBoxClient" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;/Controls&gt;&lt;Columns Styles="Percent,100" /&gt;&lt;Rows Styles="AutoSize,0,AutoSize,0,Percent,100,Absolute,20,Absolute,20" /&gt;&lt;/TableLayoutSettings&gt;</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>

View File

@ -245,6 +245,7 @@ namespace XenAdmin
aboutXenSourceAdminToolStripMenuItem.Text = string.Format(aboutXenSourceAdminToolStripMenuItem.Text, BrandManager.BrandConsole);
templatesToolStripMenuItem1.Text = string.Format(templatesToolStripMenuItem1.Text, BrandManager.ProductBrand);
updateClientToolStripMenuItem.Text = string.Format(updateClientToolStripMenuItem.Text, BrandManager.BrandConsole);
toolStripMenuItemCfu.Text = string.Format(toolStripMenuItemCfu.Text, BrandManager.BrandConsole);
toolStripSeparator7.Visible = xenSourceOnTheWebToolStripMenuItem.Visible = xenCenterPluginsOnlineToolStripMenuItem.Visible = !HiddenFeatures.ToolStripMenuItemHidden;
@ -257,8 +258,8 @@ namespace XenAdmin
OtherConfigAndTagsWatcher.RegisterEventHandlers();
Alert.RegisterAlertCollectionChanged(XenCenterAlerts_CollectionChanged);
Updates.UpdateAlertCollectionChanged += Updates_CollectionChanged;
Updates.CheckForUpdatesStarted += UpdatesCheck_Started;
Updates.CheckForUpdatesCompleted += UpdatesCheck_Completed;
Updates.CheckForClientUpdatesStarted += ClientUpdatesCheck_Started;
Updates.CheckForClientUpdatesCompleted += ClientUpdatesCheck_Completed;
ConnectionsManager.History.CollectionChanged += History_CollectionChanged;
//ConnectionsManager.XenConnections.CollectionChanged is registered in OnShown
Properties.Settings.Default.SettingChanging += Default_SettingChanging;
@ -272,8 +273,8 @@ namespace XenAdmin
OtherConfigAndTagsWatcher.DeregisterEventHandlers();
Alert.DeregisterAlertCollectionChanged(XenCenterAlerts_CollectionChanged);
Updates.UpdateAlertCollectionChanged -= Updates_CollectionChanged;
Updates.CheckForUpdatesStarted -= UpdatesCheck_Started;
Updates.CheckForUpdatesCompleted -= UpdatesCheck_Completed;
Updates.CheckForClientUpdatesStarted -= ClientUpdatesCheck_Started;
Updates.CheckForClientUpdatesCompleted -= ClientUpdatesCheck_Completed;
ConnectionsManager.History.CollectionChanged -= History_CollectionChanged;
ConnectionsManager.XenConnections.CollectionChanged -= XenConnection_CollectionChanged;
Properties.Settings.Default.SettingChanging -= Default_SettingChanging;
@ -604,7 +605,7 @@ namespace XenAdmin
if (!Program.RunInAutomatedTestMode && !Helpers.CommonCriteriaCertificationRelease)
{
if (!Properties.Settings.Default.SeenAllowUpdatesDialog)
using (var dlg = new NoIconDialog(string.Format(Messages.ALLOWED_UPDATES_DIALOG_MESSAGE, BrandManager.BrandConsole),
using (var dlg = new NoIconDialog(string.Format(Messages.ALLOWED_UPDATES_DIALOG_MESSAGE, BrandManager.BrandConsole, BrandManager.ProductBrand),
ThreeButtonDialog.ButtonYes, ThreeButtonDialog.ButtonNo)
{
HelpButton = true,
@ -616,6 +617,8 @@ namespace XenAdmin
var result = dlg.ShowDialog(this) == DialogResult.Yes;
Properties.Settings.Default.AllowXenCenterUpdates = result;
Properties.Settings.Default.AllowPatchesUpdates = result;
Properties.Settings.Default.AllowXenServerUpdates = result;
Properties.Settings.Default.SeenAllowUpdatesDialog = true;
if (result && dlg.IsCheckBoxChecked)
@ -634,7 +637,8 @@ namespace XenAdmin
CheckForUpdatesTimer.Interval = 1000 * 60 * 60 * 24; // 24 hours
CheckForUpdatesTimer.Tick += CheckForUpdatesTimer_Tick;
CheckForUpdatesTimer.Start();
Updates.CheckForUpdates();
Updates.CheckForClientUpdates();
Updates.CheckForServerUpdates();
}
ProcessCommand(_commandLineArgs);
@ -642,7 +646,8 @@ namespace XenAdmin
private void CheckForUpdatesTimer_Tick(object sender, EventArgs e)
{
Updates.CheckForUpdates();
Updates.CheckForClientUpdates();
Updates.CheckForServerUpdates();
}
private void LoadTasksAsMeddlingActions(IXenConnection connection)
@ -2605,7 +2610,7 @@ namespace XenAdmin
Program.Invoke(this, SetUpdateAlert);
}
private void UpdatesCheck_Completed()
private void ClientUpdatesCheck_Completed()
{
Program.Invoke(this, () =>
{
@ -2622,7 +2627,7 @@ namespace XenAdmin
updateClientToolStripMenuItem.Visible = updateAlert != null;
}
private void UpdatesCheck_Started()
private void ClientUpdatesCheck_Started()
{
Program.Invoke(this, () =>
{
@ -3275,7 +3280,7 @@ namespace XenAdmin
private void toolStripMenuItemCfu_Click(object sender, EventArgs e)
{
Updates.CheckForUpdates(true);
Updates.CheckForClientUpdates(true);
}
}
}

View File

@ -2716,7 +2716,7 @@
<value>186, 22</value>
</data>
<data name="toolStripMenuItemCfu.Text" xml:space="preserve">
<value>Check for &amp;Updates</value>
<value>Check for {0} &amp;Updates</value>
</data>
<data name="xenSourceOnTheWebToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>186, 22</value>

View File

@ -891,5 +891,31 @@ namespace XenAdmin.Properties {
this["FileServiceClientId"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
[global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)]
public bool AllowXenServerUpdates {
get {
return ((bool)(this["AllowXenServerUpdates"]));
}
set {
this["AllowXenServerUpdates"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
[global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)]
public bool AllowPatchesUpdates {
get {
return ((bool)(this["AllowPatchesUpdates"]));
}
set {
this["AllowPatchesUpdates"] = value;
}
}
}
}

View File

@ -206,5 +206,11 @@
<Setting Name="FileServiceClientId" Roaming="true" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="AllowXenServerUpdates" Roaming="true" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="AllowPatchesUpdates" Roaming="true" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>

View File

@ -716,6 +716,8 @@ namespace XenAdmin
{
//do not log Fileservice settings
log.Info($"=== AllowXenCenterUpdates: {Properties.Settings.Default.AllowXenCenterUpdates}");
log.Info($"=== AllowPatchesUpdates: {Properties.Settings.Default.AllowPatchesUpdates}");
log.Info($"=== AllowXenServerUpdates: {Properties.Settings.Default.AllowXenServerUpdates}");
}
log.Info($"=== FillAreaUnderGraphs: {Properties.Settings.Default.FillAreaUnderGraphs}");

View File

@ -16,7 +16,6 @@ namespace XenAdmin.TabPages
if (disposing)
{
DeregisterEventHandlers();
DeregisterCheckForUpdatesEvents();
if (components != null)
components.Dispose();

View File

@ -68,7 +68,6 @@ namespace XenAdmin.TabPages
UpdateActionEnablement();
m_alertCollectionChangedWithInvoke = Program.ProgramInvokeHandler(AlertsCollectionChanged);
RegisterCheckForUpdatesEvents();
toolStripSplitButtonDismiss.DefaultItem = tsmiDismissAll;
toolStripSplitButtonDismiss.Text = tsmiDismissAll.Text;
@ -830,22 +829,5 @@ namespace XenAdmin.TabPages
Clip.SetClipboardText(alert.GetUpdateDetailsCSVQuotes());
}
#region CheckForUpdates events
private void RegisterCheckForUpdatesEvents()
{
Updates.CheckForUpdatesCompleted += CheckForUpdatesCompleted;
}
private void DeregisterCheckForUpdatesEvents()
{
Updates.CheckForUpdatesCompleted -= CheckForUpdatesCompleted;
}
private void CheckForUpdatesCompleted()
{
Updates.CheckHotfixEligibility();
}
#endregion
}
}

View File

@ -219,9 +219,14 @@ namespace XenAdmin
return Metadata.Generate(PluginManager);
}
public string GetCustomUpdatesXmlLocation()
public string GetCustomXcUpdatesXmlLocation()
{
return Registry.GetCustomUpdatesXmlLocation();
return Registry.GetCustomXcUpdatesXmlLocation();
}
public string GetCustomCfuLocation()
{
return Registry.GetCustomCfuLocation();
}
public string GetInternalStageAuthToken()

View File

@ -201,6 +201,12 @@
<setting name="FileServiceClientId" serializeAs="String">
<value />
</setting>
<setting name="AllowXenServerUpdates" serializeAs="String">
<value>False</value>
</setting>
<setting name="AllowPatchesUpdates" serializeAs="String">
<value>False</value>
</setting>
</XenAdmin.Properties.Settings>
</userSettings>

View File

@ -41,42 +41,21 @@ using System.Net.Cache;
namespace XenAdmin.Actions
{
public class DownloadUpdatesXmlAction : AsyncAction
public class DownloadXcUpdatesXmlAction : DownloadUpdatesXmlAction
{
private const string ClientVersionsNode = "versions";
private const string XenServerVersionsNode = "serverversions";
private const string PatchesNode = "patches";
private const string ConflictingPatchesNode = "conflictingpatches";
private const string RequiredPatchesNode = "requiredpatches";
private const string ConflictingPatchNode = "conflictingpatch";
private const string RequiredPatchNode = "requiredpatch";
public List<ClientVersion> ClientVersions { get; } = new List<ClientVersion>();
public List<XenServerVersion> XenServerVersions { get; } = new List<XenServerVersion>();
public List<XenServerPatch> XenServerPatches { get; } = new List<XenServerPatch>();
public List<XenServerVersion> XenServerVersionsForAutoCheck => _checkForServerVersion ? XenServerVersions : new List<XenServerVersion>();
private readonly bool _checkForXenCenter;
private readonly bool _checkForServerVersion;
private readonly bool _checkForPatches;
private readonly string _userAgent;
public DownloadUpdatesXmlAction(bool checkForXenCenter, bool checkForServerVersion, bool checkForPatches, string userAgent, bool suppressHistory)
: base(null, string.Empty, string.Empty, suppressHistory)
public DownloadXcUpdatesXmlAction(bool checkForXenCenter, string userAgent, string xmlLocationUrl, bool suppressHistory)
: base(userAgent, xmlLocationUrl, suppressHistory)
{
Debug.Assert(!string.IsNullOrWhiteSpace(userAgent));
_checkForXenCenter = checkForXenCenter;
_checkForServerVersion = checkForServerVersion;
_checkForPatches = checkForPatches;
_userAgent = userAgent;
Title = Description = string.Format(Messages.AVAILABLE_UPDATES_CHECKING, BrandManager.BrandConsole);
}
public List<ClientVersion> ClientVersions { get; } = new List<ClientVersion>();
protected override void Run()
{
try
@ -84,8 +63,6 @@ namespace XenAdmin.Actions
XmlDocument xdoc = FetchCheckForUpdatesXml();
GetXenCenterVersions(xdoc);
GetXenServerPatches(xdoc);
GetXenServerVersions(xdoc);
Description = Messages.COMPLETED;
}
@ -153,6 +130,70 @@ namespace XenAdmin.Actions
}
}
}
}
public class DownloadCfuAction : DownloadUpdatesXmlAction
{
private const string XenServerVersionsNode = "serverversions";
private const string PatchesNode = "patches";
private const string ConflictingPatchesNode = "conflictingpatches";
private const string RequiredPatchesNode = "requiredpatches";
private const string ConflictingPatchNode = "conflictingpatch";
private const string RequiredPatchNode = "requiredpatch";
private readonly bool _checkForServerVersion;
private readonly bool _checkForPatches;
public DownloadCfuAction(bool checkForServerVersion, bool checkForPatches, string userAgent, string xmlLocationUrl, bool suppressHistory)
: base(userAgent, xmlLocationUrl, suppressHistory)
{
_checkForServerVersion = checkForServerVersion;
_checkForPatches = checkForPatches;
Title = Description = string.Format(Messages.AVAILABLE_UPDATES_CHECKING, BrandManager.ProductBrand);
}
public List<XenServerVersion> XenServerVersions { get; } = new List<XenServerVersion>();
public List<XenServerPatch> XenServerPatches { get; } = new List<XenServerPatch>();
public List<XenServerVersion> XenServerVersionsForAutoCheck =>
_checkForServerVersion ? XenServerVersions : new List<XenServerVersion>();
protected override void Run()
{
try
{
XmlDocument xdoc = FetchCheckForUpdatesXml();
GetXenServerPatches(xdoc);
GetXenServerVersions(xdoc);
Description = Messages.COMPLETED;
}
catch (Exception e)
{
if (e is System.Net.Sockets.SocketException)
{
Description = Messages.AVAILABLE_UPDATES_NETWORK_ERROR;
}
else if (!string.IsNullOrWhiteSpace(e.Message))
{
string errorText = e.Message.Trim();
errorText = System.Text.RegularExpressions.Regex.Replace(errorText, @"\r\n+", "");
Description = string.Format(Messages.AVAILABLE_UPDATES_ERROR, errorText);
}
else
{
Description = Messages.AVAILABLE_UPDATES_INTERNAL_ERROR;
}
//if we had originally wanted it to be hidden, make it visible now so the error is shown
if (SuppressHistory)
SuppressHistory = false;
throw;
}
}
private void GetXenServerPatches(XmlDocument xdoc)
{
@ -210,7 +251,7 @@ namespace XenAdmin.Actions
var conflictingPatches = GetPatchDependencies(version, ConflictingPatchesNode, ConflictingPatchNode);
var requiredPatches = GetPatchDependencies(version, RequiredPatchesNode, RequiredPatchNode);
XenServerPatches.Add(new XenServerPatch(uuid, name, description, guidance, guidance_mandatory, patchVersion, url,
XenServerPatches.Add(new XenServerPatch(uuid, name, description, guidance, guidance_mandatory, patchVersion, url,
patchUrl, timestamp, priority, installationSize, downloadSize, containsLivepatch, conflictingPatches, requiredPatches));
}
}
@ -226,7 +267,7 @@ namespace XenAdmin.Actions
// </requiredgpatch>
// </requiredpatches>
private static List<string> GetPatchDependencies(XmlNode patchsNode, string dependenciesNodeName, string dependencyNodeName)
{
{
var dependenciesNode = patchsNode.ChildNodes.Cast<XmlNode>().FirstOrDefault(childNode => childNode.Name == dependenciesNodeName);
if (dependenciesNode == null)
@ -336,17 +377,31 @@ namespace XenAdmin.Actions
}
}
}
}
public abstract class DownloadUpdatesXmlAction : AsyncAction
{
private readonly string _userAgent;
private readonly string _checkForUpdatesUrl;
protected DownloadUpdatesXmlAction(string userAgent, string xmlLocationUrl, bool suppressHistory)
: base(null, string.Empty, string.Empty, suppressHistory)
{
Debug.Assert(!string.IsNullOrWhiteSpace(userAgent));
_userAgent = userAgent;
_checkForUpdatesUrl = xmlLocationUrl;
}
protected virtual XmlDocument FetchCheckForUpdatesXml()
{
var checkForUpdatesXml = new XmlDocument();
var checkForUpdatesUrl = XenAdminConfigManager.Provider.GetCustomUpdatesXmlLocation() ?? BrandManager.UpdatesUrl;
var uriBuilder = new UriBuilder(checkForUpdatesUrl);
var uriBuilder = new UriBuilder(_checkForUpdatesUrl);
var uri = uriBuilder.Uri;
if (uri.IsFile)
{
checkForUpdatesXml.Load(checkForUpdatesUrl);
checkForUpdatesXml.Load(_checkForUpdatesUrl);
}
else
{

View File

@ -51,7 +51,8 @@ namespace XenAdmin.Core
CompanyNameShort = customBranding.CompanyNameShort;
ProductBrand = customBranding.ProductBrand;
ProductVersionPost82 = customBranding.ProductVersionText;
UpdatesUrl = customBranding.UpdatesUrl;
XcUpdatesUrl = customBranding.XcUpdatesUrl;
CfuUrl = customBranding.CfuUrl;
VmTools = customBranding.VmTools;
XenHost = customBranding.XenHost;
}
@ -105,7 +106,9 @@ namespace XenAdmin.Core
public static readonly string Trademarks = Get("TRADEMARKS");
public static readonly string UpdatesUrl;
public static readonly string XcUpdatesUrl;
public static readonly string CfuUrl;
public static readonly string VmTools;

View File

@ -5351,7 +5351,7 @@ namespace XenAdmin {
}
/// <summary>
/// Looks up a localized string similar to Would you like {0} to periodically check the internet for new versions of the application?.
/// Looks up a localized string similar to Would you like {0} to periodically check the internet for {1} updates and new versions of the application?.
/// </summary>
public static string ALLOWED_UPDATES_DIALOG_MESSAGE {
get {

View File

@ -1958,7 +1958,7 @@ Note that if RBAC is enabled, only alerts which you have privileges to dismiss w
<value>&amp;Show internet proxy settings</value>
</data>
<data name="ALLOWED_UPDATES_DIALOG_MESSAGE" xml:space="preserve">
<value>Would you like {0} to periodically check the internet for new versions of the application?</value>
<value>Would you like {0} to periodically check the internet for {1} updates and new versions of the application?</value>
</data>
<data name="ALREADY_ATTACHED_ELSEWHERE" xml:space="preserve">
<value>The SR '{0}' is currently attached elsewhere. Do you want to attach it to '{1}'?

View File

@ -59,7 +59,8 @@ using XenAdmin.Properties;
"[Vendor]",
"[XenServerProduct]",
"[XenServer version]",
"[Updates url]",
"[Xc updates url]",
"[Cfu url]",
"[Guest Tools]",
"[XenServer host]")]
@ -74,7 +75,8 @@ namespace XenAdmin.Properties
string companyNameShort,
string productBrand,
string productVersionText,
string updatesUrl,
string xcUpdatesUrl,
string cfuUrl,
string vmTools,
string xenHost)
{
@ -83,7 +85,8 @@ namespace XenAdmin.Properties
CompanyNameShort = companyNameShort;
ProductBrand = productBrand;
ProductVersionText = productVersionText;
UpdatesUrl = updatesUrl;
XcUpdatesUrl = xcUpdatesUrl;
CfuUrl = cfuUrl;
VmTools = vmTools;
XenHost = xenHost;
}
@ -94,7 +97,8 @@ namespace XenAdmin.Properties
public string ProductBrand { get; }
public string ProductVersionText { get; }
public string VmTools { get; }
public string UpdatesUrl { get; }
public string XcUpdatesUrl { get; }
public string CfuUrl { get; }
public string XenHost { get; }
}
}

View File

@ -60,7 +60,8 @@ namespace XenAdmin
void SaveSettingsIfRequired();
bool ShowHiddenVMs { get; }
string GetXenCenterMetadata();
string GetCustomUpdatesXmlLocation();
string GetCustomXcUpdatesXmlLocation();
string GetCustomCfuLocation();
string GetInternalStageAuthToken();
string GetCustomFileServicePrefix();
}

View File

@ -48,7 +48,8 @@ rebranding_global()
-e "s#\[XenCenter\]#${BRANDING_BRAND_CONSOLE}#g" \
-e "s#\[XenCenter_No_Space\]#${BRANDING_BRAND_CONSOLE_NO_SPACE}#g" \
-e "s#xencenter\/current-release\/#${BRANDING_HELP_PATH}#g" \
-e "s#\[Updates url\]#${UPDATES_URL}#g" \
-e "s#\[Xc updates url\]#${XC_UPDATES_URL}#g" \
-e "s#\[Cfu url\]#${CFU_URL}#g" \
$1
}