diff --git a/Translations/EarlyUpdateCheck.de.language.xml b/Translations/EarlyUpdateCheck.de.language.xml
index cdf9a85..5c1fc0e 100644
--- a/Translations/EarlyUpdateCheck.de.language.xml
+++ b/Translations/EarlyUpdateCheck.de.language.xml
@@ -4,7 +4,7 @@
Increment the TranslationVersion every time the translation file is updated
Also update the version.info file
-->
- 8
+ 9
-
Active
Aktiv
@@ -144,4 +144,11 @@ KeePass bietet folgende Installationsmethoden:
- MSI: KeePass-<Version>.msi
- Portabel: KeePass-<Version>.zip
+ -
+ SecureDesktopMode
+ EarlyUpdateCheck hat verfügbare Updates von Plugins und/oder KeePass erkannt.
+
+Da die Option '{0}' aktiv ist, kann das Updatefenster jetzt nicht angezeigt werden.
+Es wird angezeigt NACHDEM das '{1}' Fenster geschlossen wurde.
+
\ No newline at end of file
diff --git a/Translations/EarlyUpdateCheck.template.language.xml b/Translations/EarlyUpdateCheck.template.language.xml
index 9ab3bd4..d012f85 100644
--- a/Translations/EarlyUpdateCheck.template.language.xml
+++ b/Translations/EarlyUpdateCheck.template.language.xml
@@ -143,4 +143,11 @@ Different installation types offered:
- MSI: KeePass-<Version>.msi is used to install KeePass
- Portable: KeePass-<Version>.zip is used to download and extract KeePass
+ -
+ SecureDesktopMode
+ EarlyUpdateCheck detected available updates of plugins and/or KeePass.
+
+As option '{0}' is active, the update form cannot be displayed now.
+It will be shown AFTER you close the '{1}' form.
+
\ No newline at end of file
diff --git a/src/EarlyUpdateCheck.cs b/src/EarlyUpdateCheck.cs
index 7a8cf49..9c313da 100644
--- a/src/EarlyUpdateCheck.cs
+++ b/src/EarlyUpdateCheck.cs
@@ -39,7 +39,7 @@ public override bool Initialize(IPluginHost host)
{
m_host = host;
- PluginTranslate.TranslationChanged += delegate (object sender, TranslationChangedEventArgs e)
+ PluginTranslate.TranslationChanged += delegate (object sender, TranslationChangedEventArgs e)
{
if (!string.IsNullOrEmpty(KeePass.Program.Translation.Properties.Iso6391Code))
PluginUpdateHandler.LanguageIso = KeePass.Program.Translation.Properties.Iso6391Code;
@@ -123,8 +123,8 @@ private void MainWindow_FormLoadPost(object sender, EventArgs e)
else if (!m_bRestartTriggered)
{
//Only load plugins, do NOT check for new translations
- ThreadPool.QueueUserWorkItem(new WaitCallback((object o) =>
- {
+ ThreadPool.QueueUserWorkItem(new WaitCallback((object o) =>
+ {
PluginUpdateHandler.LoadPlugins(false);
CheckExternalPluginUpdate();
}));
@@ -180,7 +180,7 @@ private void LanguageFormAdded(object sender, EventArgs e)
private void WindowRemoved(object sender, GwmWindowEventArgs e)
{
- if ((m_kpf != null) && (e.Form is KeyPromptForm)) m_kpf = null;
+ if ((m_kpf != null) && (e.Form is KeyPromptForm)) m_kpf = null;
}
#region Check for updates
@@ -281,7 +281,8 @@ private void UpdateCheckBackground()
if (m_slUpdateCheck != null)
{
- m_host.MainWindow.Invoke(new KeePassLib.Delegates.GAction(() => { m_slUpdateCheck.EndLogging(); }));
+ if (bUpdAvail) UpdateStatusLogger();
+ EndLogging();
m_slUpdateCheck = null;
}
@@ -313,8 +314,8 @@ private void UpdateCheckBackground()
}
finally
{
- try { if (m_slUpdateCheck != null) m_slUpdateCheck.EndLogging(); }
- catch (Exception) { }
+ try { if (m_slUpdateCheck != null) EndLogging(); }
+ catch (Exception ex) { lMsg.Add(ex.Message); }
if (bOK)
lock (m_lock) { m_UpdateCheckStatus = UpdateCheckStatus.Checked; }
else
@@ -336,14 +337,14 @@ private void UpdateCheckBackground()
}
while (true)
{
- if ((m_slUpdateCheck != null) && !m_slUpdateCheck.ContinueWork()) break;
+ if ((m_slUpdateCheck != null) && !ContinueWork()) break;
lock (m_lock)
{
if (m_UpdateCheckStatus == UpdateCheckStatus.Checked) break;
if (m_UpdateCheckStatus == UpdateCheckStatus.Error) break;
}
}
- if (m_slUpdateCheck != null) m_slUpdateCheck.EndLogging();
+ if (m_slUpdateCheck != null) EndLogging();
if (bOK) return;
}
catch (Exception ex)
@@ -359,6 +360,61 @@ private void UpdateCheckBackground()
}
}
+ private bool ContinueWork()
+ {
+ try
+ {
+ var c = UIThread(() =>
+ {
+ bool cw = false;
+ lock (m_slUpdateCheck)
+ {
+ if (m_slUpdateCheck == null) cw = false;
+ else cw = m_slUpdateCheck.ContinueWork();
+ }
+ return cw;
+ });
+ if (c != null) return (bool)c;
+ }
+ catch { }
+ return true;
+ }
+
+ private void EndLogging()
+ {
+ UIThread(() =>
+ {
+ lock (m_slUpdateCheck)
+ {
+ if (m_slUpdateCheck != null) m_slUpdateCheck.EndLogging();
+ m_slUpdateCheck = null;
+ }
+ return null;
+ });
+ }
+
+ private object UIThread(KeePassLib.Delegates.GFunc