From 88d6e2f84e5b8d0ccd0b392eb44b6b7f136ff9bb Mon Sep 17 00:00:00 2001 From: Lior Banai Date: Tue, 5 Sep 2023 17:01:29 +0300 Subject: [PATCH] Disable Updates If Running from Program Data Folder fix #1841 --- Analogy/CommonChangeLog.cs | 1 + Analogy/Forms/UpdateForm.Designer.cs | 7 ++++--- Analogy/Managers/AnalogyNonPersistSettings.cs | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Analogy/CommonChangeLog.cs b/Analogy/CommonChangeLog.cs index 6d596b31f..6787c4d27 100644 --- a/Analogy/CommonChangeLog.cs +++ b/Analogy/CommonChangeLog.cs @@ -9,6 +9,7 @@ public static IEnumerable GetChangeLog() { return new List { + new ("V5.0.0 - Disable Updates If Running from Program Data Folder #1841", AnalogChangeLogType.Improvement,"Lior Banai",new DateTime(2023,09,05),"5.0.0.0"), new ("V5.0.0 - Support running from MSI Installer #1838", AnalogChangeLogType.Improvement,"Lior Banai",new DateTime(2023,09,03),"5.0.0.0"), new ("V5.0.0 - Add Export to Simple File #1815", AnalogChangeLogType.Improvement,"Lior Banai",new DateTime(2023,08,25),"5.0.0.0"), new ("V5.0.0 - Change Time Offset is very slow #1769", AnalogChangeLogType.Bug,"Lior Banai",new DateTime(2023,08,25),"5.0.0.0"), diff --git a/Analogy/Forms/UpdateForm.Designer.cs b/Analogy/Forms/UpdateForm.Designer.cs index 3274ea0a8..246b1abb6 100644 --- a/Analogy/Forms/UpdateForm.Designer.cs +++ b/Analogy/Forms/UpdateForm.Designer.cs @@ -116,11 +116,12 @@ private void InitializeComponent() this.lblDisableUpdates.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.lblDisableUpdates.Appearance.ForeColor = System.Drawing.Color.Red; this.lblDisableUpdates.Appearance.Options.UseForeColor = true; - this.lblDisableUpdates.Location = new System.Drawing.Point(552, 8); + this.lblDisableUpdates.Location = new System.Drawing.Point(322, 8); this.lblDisableUpdates.Name = "lblDisableUpdates"; - this.lblDisableUpdates.Size = new System.Drawing.Size(416, 16); + this.lblDisableUpdates.Size = new System.Drawing.Size(646, 16); this.lblDisableUpdates.TabIndex = 15; - this.lblDisableUpdates.Text = "Updates are disabled due to data provider overrides or Registry Override"; + this.lblDisableUpdates.Text = "Updates are disabled due to data provider overrides or Registry Override Or if Ru" + + "nning from Program Files folder"; this.lblDisableUpdates.Visible = false; // // cePreRelease diff --git a/Analogy/Managers/AnalogyNonPersistSettings.cs b/Analogy/Managers/AnalogyNonPersistSettings.cs index bb91aefca..4e602240d 100644 --- a/Analogy/Managers/AnalogyNonPersistSettings.cs +++ b/Analogy/Managers/AnalogyNonPersistSettings.cs @@ -17,7 +17,7 @@ public class AnalogyNonPersistSettings public bool DisableUpdateFromRegistry { get; set; } public string CurrentLogLayoutFileName { get; } = "AnalogyLogsCurrentLayout.xml"; public string CurrentLogLayoutName { get; } = "Active Layout"; - public bool UpdateAreDisabled => DisableUpdateFromRegistry || DisableUpdatesByDataProvidersOverrides; + public bool UpdateAreDisabled => DisableUpdateFromRegistry || DisableUpdatesByDataProvidersOverrides || Utils.IsRunningFromProgramFileFolder(); public string AnalogyOrganizationName => "Analogy-LogViewer"; public string AnalogyRepositoryName => "Analogy.LogViewer"; public AnalogyNonPersistSettings()