Skip to content

Commit 719ed25

Browse files
committed
Improve one-click plugin update
Better detection of other plugins Use default update URL for own plugins if not specified differently Close #76
1 parent 7cb4444 commit 719ed25

5 files changed

Lines changed: 11 additions & 3 deletions

File tree

src/EarlyUpdateCheck.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ private void UpdateCheckBackground()
307307
try
308308
{
309309
lock (m_lock) { m_UpdateCheckStatus = UpdateCheckStatus.Checking; }
310+
PluginUpdateHandler.LoadPlugins(PluginUpdateHandler.Plugins.Count == 0);
310311
List<UpdateComponentInfo> lInst = (List<UpdateComponentInfo>)miGetInstalledComponents.Invoke(null, null);
311312
List<string> lUrls = (List<string>)miGetUrls.Invoke(null, new object[] { lInst });
312313
Dictionary<string, List<UpdateComponentInfo>> dictAvail =
@@ -1131,6 +1132,7 @@ private bool UpdatePlugin(PluginUpdate upd, string sPluginFolder, UpdateFlags uf
11311132
bool bOK = true;
11321133
if (m_slUpdatePlugins != null)
11331134
m_slUpdatePlugins.SetText(string.Format(PluginTranslate.PluginUpdating, upd.Title), LogStatusType.Info);
1135+
11341136
if (UpdateFlagSet(uf, UpdateFlags.Plugin)) bOK = upd.Download(sPluginFolder);
11351137

11361138
if (upd is OwnPluginUpdate && UpdateFlagSet(uf, UpdateFlags.Translations))

src/PluginUpdateInfo.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,11 @@ private void GetOwnPluginURL()
895895
if (fURL == null) return;
896896
URL = (string)fURL.GetValue(p);
897897
if (URL == null) URL = string.Empty;
898+
if (string.IsNullOrEmpty(URL))
899+
{
900+
URL = PluginTools.Tools.PluginURL;
901+
URL = URL.Replace("earlyupdatecheck", Name.ToLowerInvariant());
902+
}
898903
URL = UrlUtil.EnsureTerminatingSeparator(URL, true) + "releases/";
899904
}
900905
catch { URL = Tools.PluginURL.ToLowerInvariant().Replace("earlyupdatecheck", Name.ToLowerInvariant()); }

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")]
30-
[assembly: AssemblyFileVersion("4.4")]
29+
[assembly: AssemblyVersion("4.4.1")]
30+
[assembly: AssemblyFileVersion("4.4.1")]
3131
[assembly: Guid("672570AF-CC57-4980-86F9-D48FD1CC707D")]

src/Utilities/Tools_Main.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ static Tools()
2222
KeePassLanguageIso6391 = KeePass.Program.Translation.Properties.Iso6391Code;
2323
if (string.IsNullOrEmpty(KeePassLanguageIso6391)) KeePassLanguageIso6391 = "en";
2424
m_sPluginClassname = typeof(Tools).Assembly.GetName().Name + "Ext";
25+
PluginURL = "https://github.com/rookiestyle/" + typeof(Tools).Assembly.GetName().Name.ToLowerInvariant() + "/ ";
2526
}
2627

2728
public static void OpenUrl(string sURL)

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
2+
Early update check:4.4.1
33
Early update check!de:9
44
Early update check!ru:2
55
Early update check!fr:1

0 commit comments

Comments
 (0)