Skip to content

Commit 113e7f8

Browse files
committed
Improvements & enhancements when updating plugins
Technical improvements to allow updating more plugins Added some more plugins that can be updated: - KeePassWinHello - KPEntryTemplates - KPSimpleBackup Closes #51
1 parent 60ca260 commit 113e7f8

4 files changed

Lines changed: 40 additions & 11 deletions

File tree

ExternalPluginUpdates/ExternalPluginUpdates.xml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ can use ExternalPluginUpdatesUser.xml to remove certain plugins
1010
from one-click update
1111
-->
1212
<UpdateInfoExternList>
13-
<Version>12</Version>
13+
<Version>13</Version>
1414
<UpdateInfoExtern>
1515
<PluginName>WebAutoType</PluginName>
1616
<PluginURL>https://sourceforge.net/projects/webautotype/</PluginURL>
@@ -85,7 +85,7 @@ from one-click update
8585
<UpdateInfoExtern>
8686
<PluginName>KPSync For Google Drive</PluginName>
8787
<PluginURL>https://github.com/walterpg/google-drive-sync/releases</PluginURL>
88-
<PluginUpdateURL>https://github.com/walterpg/google-drive-sync/releases/latest/download/KPSyncForDrive-{major}.{minor}.{build}.plgx</PluginUpdateURL>
88+
<PluginUpdateURL>https://github.com/walterpg/google-drive-sync/releases/latest/download/KPSyncForDrive-{major}.{minor}.{build!}.plgx</PluginUpdateURL>
8989
<UpdateMode>PlgxDirect</UpdateMode>
9090
<AllowVersionStripping>False</AllowVersionStripping>
9191
</UpdateInfoExtern>
@@ -159,4 +159,28 @@ from one-click update
159159
<UpdateMode>PlgxDirect</UpdateMode>
160160
<AllowVersionStripping>False</AllowVersionStripping>
161161
</UpdateInfoExtern>
162+
<!-- KPEntry Templates by Mitch Capper -->
163+
<UpdateInfoExtern>
164+
<PluginName>Entry Templates for KeePass</PluginName>
165+
<PluginURL>https://keepass.info/plugins.html#kpentrytemplates</PluginURL>
166+
<PluginUpdateURL>https://github.com/mitchcapper/KPEntryTemplates/releases/latest/download/KPEntryTemplates.plgx</PluginUpdateURL>
167+
<UpdateMode>PlgxDirect</UpdateMode>
168+
<AllowVersionStripping>False</AllowVersionStripping>
169+
</UpdateInfoExtern>
170+
<!-- KeePass Windows Hello by sirAndros -->
171+
<UpdateInfoExtern>
172+
<PluginName>KeePassWinHello</PluginName>
173+
<PluginURL>https://github.com/sirAndros/KeePassWinHello/</PluginURL>
174+
<PluginUpdateURL>https://github.com/sirAndros/KeePassWinHello/releases/latest/download/KeePassWinHelloPlugin.plgx</PluginUpdateURL>
175+
<UpdateMode>PlgxDirect</UpdateMode>
176+
<AllowVersionStripping>False</AllowVersionStripping>
177+
</UpdateInfoExtern>
178+
<!-- KPSimple Backup by Marvin Weber -->
179+
<UpdateInfoExtern>
180+
<PluginName>KPSimpleBackup</PluginName>
181+
<PluginURL>https://github.com/marvinweber/KPSimpleBackup/</PluginURL>
182+
<PluginUpdateURL>https://github.com/marvinweber/KPSimpleBackup/releases/latest/download/KPSimpleBackup-v{major}.{minor}.{build!}.zip</PluginUpdateURL>
183+
<UpdateMode>ZipExtractPlgx</UpdateMode>
184+
<AllowVersionStripping>False</AllowVersionStripping>
185+
</UpdateInfoExtern>
162186
</UpdateInfoExternList>

src/PluginUpdateInfo.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -440,12 +440,17 @@ protected virtual string MergeInVersion(bool bUseAvailableVersion)
440440
Regex r = new Regex(@"\{([^}]*)REVISION\}", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
441441
if (bStripping) sResult = r.Replace(sResult, string.Empty);
442442
else sResult = r.Replace(sResult, "$1\n" + v.Revision.ToString());
443-
444443

445444
bStripping &= v.Build < 1;
446445
r = new Regex(@"\{([^}]*)BUILD\}", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
447446
if (bStripping) sResult = r.Replace(sResult, string.Empty);
448-
else sResult = r.Replace(sResult, "$1\n" + v.Build.ToString());
447+
else
448+
{
449+
sResult = r.Replace(sResult, "$1\n" + v.Build.ToString());
450+
//Special handling for plugins that ALWAYS include the build
451+
r = new Regex(@"\{([^}]*)BUILD!\}", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
452+
sResult = r.Replace(sResult, "$1\n0");
453+
}
449454

450455
bStripping &= v.Minor < 1;
451456
r = new Regex(@"\{([^}]*)MINOR\}", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
@@ -1038,16 +1043,16 @@ internal static PluginUpdate Factory(string sPluginNamespace)
10381043
{
10391044
switch (sPluginNamespace.ToLowerInvariant())
10401045
{
1041-
case "kpsyncfordrive": return new OPU_KPSyncForDrive(sPluginNamespace);
1046+
//case "kpsyncfordrive": return new OPU_EnforceBuild(sPluginNamespace);
10421047
default: return new OtherPluginUpdate(sPluginNamespace);
10431048
}
10441049
throw new NotImplementedException();
10451050
}
10461051
}
10471052

1048-
internal class OPU_KPSyncForDrive : OtherPluginUpdate
1053+
internal class OPU_EnforceBuild : OtherPluginUpdate
10491054
{
1050-
internal OPU_KPSyncForDrive(string PluginName) : base(PluginName) { }
1055+
internal OPU_EnforceBuild(string PluginName) : base(PluginName) { }
10511056
protected override string MergeInVersion(bool bUseAvailableVersion)
10521057
{
10531058
//KPSyn for Drive always uses major, minor and revision

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

version.info

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
:
2-
Early update check:4.1.4
2+
Early update check:4.2
33
Early update check!de:9
44
Early update check!ru:2
55
Early update check!fr:1
66
Early update check!pt:3
77
Early update check!it:1
88
Early update check!zh:1
99
Early update check!ja:1
10-
ExternalPluginUpdates:12
10+
ExternalPluginUpdates:13
1111
:

0 commit comments

Comments
 (0)