Skip to content

Commit 8fca375

Browse files
committed
Prepare for KeePass 2.61
If the option 'Check for update at KeePass startup' is activated, KeePass 2.61 will initiate the update check before trying to open a database (asynchronously). If an update is found while a master key prompt dialog is displayed, the availability of the update is now indicated by a banner in the dialog. As preparation for that, this part has been removed from EarlyUpdateCheck if KeePass >= 2.61 is used. One-Click plugin update and the enhancements to the plugins form are still available
1 parent 719ed25 commit 8fca375

6 files changed

Lines changed: 29 additions & 9 deletions

File tree

readme.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
[![Downloads](https://img.shields.io/github/downloads/rookiestyle/earlyupdatecheck/total?color=%2300cc00)](https://github.com/rookiestyle/earlyupdatecheck/releases/latest/download/EarlyUpdateCheck.plgx)\
55
[![License: GPL v3](https://img.shields.io/github/license/rookiestyle/earlyupdatecheck)](https://www.gnu.org/licenses/gpl-3.0)
66

7-
Keepass performs its update check only after all initialization is done and - if configured - the most recently used database has been opened.
8-
7+
Keepass performs its update check only after all initialization is done and - if configured - the most recently used database has been opened.
98
EarlyUpdateCheck helps to run this checks for updates of KeePass and installed plugins BEFORE a database is opened.
10-
Additionally, it offers a handy one click update mode for all of my plugins integrated in KeePass' update check and also supports updating KeePass itself.
11-
This will invoke Windows UAC if required to copy the downloaded files into KeePass' plugin folder.
9+
This feature will become part of the next KeePass release 2.61. EarlyUpdateCheck will check the KeePass version and and only use its early update check for KeePass < 2.61.
10+
11+
Additionally, it offers a handy one click update mode for all of my plugins integrated in KeePass' update check and also supports updating KeePass itself.
12+
This will invoke Windows UAC if required to copy the downloaded files into KeePass' plugin folder.
1213
Details can be found in the configuration settings.
1314

1415
EarlyUpdateCheck can update other author's plugins as well.

src/EarlyUpdateCheck.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ private void WindowAdded(object sender, GwmWindowEventArgs e)
151151
}
152152
return;
153153
}
154-
if (e.Form is KeyPromptForm) KeyPromptFormAdded();
154+
if (e.Form is KeyPromptForm && Tools.KeePassVersion < PluginConfig.KeePass_2_61) KeyPromptFormAdded();
155155
if (e.Form is LanguageForm) e.Form.Shown += LanguageFormAdded;
156156
if (e.Form is PluginsForm) e.Form.Shown += PluginsFormShown;
157157
}
@@ -320,6 +320,18 @@ private void UpdateCheckBackground()
320320
foreach (UpdateComponentInfo uc in lInst)
321321
{
322322
var mypu = PluginUpdateHandler.Plugins.Find(xyz => xyz.Title == uc.Name);
323+
if (uc.Name == "KeePass")
324+
{
325+
if (uc.Status == UpdateComponentStatus.NewVerAvailable && PluginConfig.KeePassUpdateActive)
326+
{
327+
Version v = null;
328+
try { v = new Version(StrUtil.VersionToString(uc.VerAvailable, 2)); }
329+
catch { }
330+
bUpdAvail = true;
331+
}
332+
continue;
333+
}
334+
323335
if (uc.Status == UpdateComponentStatus.NewVerAvailable && mypu != null)
324336
{
325337
mypu.VersionAvailable = new Version(StrUtil.VersionToString(uc.VerAvailable, 2));
@@ -481,7 +493,6 @@ private UpdateCheckType UpdateCheckRequired()
481493
{
482494
UpdateCheckType result = UpdateCheckType.NotRequired;
483495
if (m_bUpdateCheckDone) return result;
484-
485496
m_bUpdateCheckDone = true;
486497
if (!KeePass.Program.Config.Application.Start.CheckForUpdate) return result;
487498
if (!KeePass.Program.Config.Application.Start.OpenLastFile) return result;

src/Options.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ public Options()
6060
var t = typeof(KPRes).GetProperty("Type");
6161
if (t != null) lKeePassInstallType.Text = t.GetValue(null, null) + ":";
6262
else lKeePassInstallType.Text = "Type:";
63+
64+
if (PluginTools.Tools.KeePassVersion >= PluginConfig.KeePass_2_61)
65+
{
66+
cbCheckSync.Visible = false;// PluginTools.Tools.KeePassVersion < PluginConfig.KeePass_2_61;
67+
tbCheckSyncDesc.Visible = false;// PluginTools.Tools.KeePassVersion < PluginConfig.KeePass_2_61;
68+
gCheckSync.Height -= cbCheckSync.Height + tbCheckSyncDesc.Height;
69+
}
6370
}
6471

6572
private void bUpdateTranslations_Click(object sender, EventArgs e)

src/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@
2626
//
2727
// You can specify all the values or you can use the default the Revision and
2828
// Build Numbers by using the '*' as shown below:
29-
[assembly: AssemblyVersion("4.4.1")]
30-
[assembly: AssemblyFileVersion("4.4.1")]
29+
[assembly: AssemblyVersion("4.4.2")]
30+
[assembly: AssemblyFileVersion("4.4.2")]
3131
[assembly: Guid("672570AF-CC57-4980-86F9-D48FD1CC707D")]

src/Utilities/Util.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ internal static class PluginConfig
3131
internal static bool CheckSync = true;
3232
internal static bool OneClickUpdate = true;
3333
internal static bool DownloadActiveLanguage = true;
34+
internal static Version KeePass_2_61 = new Version(2, 61);
3435

3536
private static List<PluginUpdateSerialized> m_lKnownPlugins = new List<PluginUpdateSerialized>();
3637
internal static List<PluginUpdateSerialized> KnownPluginVersions

version.info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
:
2-
Early update check:4.4.1
2+
Early update check:4.4.2
33
Early update check!de:9
44
Early update check!ru:2
55
Early update check!fr:1

0 commit comments

Comments
 (0)