Skip to content

Update other plugins

Rookiestyle edited this page Sep 18, 2021 · 14 revisions

Starting with version 3.0, EarlyUpdatecheck offers the ability to update other author's plugins as well.

General
How to update other plugins
How to add additional plugins

General

Updating a plugin requires knowledge about where to download the newest version and - if applicable - how to process the downloaded file.

In some cases, it is possible to download the plgx file right away.
In other cases, it could be a dll file instead of a plgx or it could be a zip file that needs to be extracted, ...

EarlyUpdateCheck has been designed in a way that can support various update procedures.
Example use case: WebAutotype is downloaded as a zip file which contains the file WebAutoType.plgx.

How to update other plugins

In order to update a plugin, EarlyUpdateCheck needs to know the following:

  • Information about a new version => This relies on the already existing KeePass update check
  • Place to download the new version from => This depends on the respective plugin and EarlyUpdatecheck needs to be informed explicitly
  • Update procedures to use => This depends on the respective plugin and EarlyUpdatecheck needs to be informed explicitly

All required information is read from a file named ExternalPluginUpdates.xml which has to be placed in the plugin folder.
Please have a look at the KeePass plugin security section section to learn why this location is used.

There is no special handling required beside making this file available to EarlyUpdateCheck. You can update other author's pluins in exactly the same way as you can update my plugins.
For details please read the wiki page describing the one click update

To get started, you might want to use ExternalPluginUpdates.xml located in folder ExternalPluginUpdates of this repository. Download it here

How to add additional plugins

Please enhance ExternalPluginUpdates.xml by adding an UpdateInfoExtern section.

  • PluginName - Name of plugin as shown in KeePass' update check
  • PluginURL - Link to the plugin's homepage, doublicking the entry in the update check will open this page
  • PluginUpdateURL - Link to the plugin file itself / the zip file containing the plugin
  • UpdateMode - This informs EarlyUpdateCheck how to process the downloaded file, currently supported modes are listed in the table below
  • AllowVersionStripping - see below

If you make EarlyUpdateCheck aware of additional plugins, I would appreciate if you create an issue / a pull request so that other users can benefit from that as well.

UpdateMode overview

UpdateMode Description
PlgxDirect Downloaded file is already the required plgx file
ZipExtractPlgx Downloaded file is a zip file which contains the required plgx file
DllDirect Plugin is shipped as dll instead of plgx, downloaded file is already the required dll file
ZipExtractDll Plugin is shipped as dll instead of plgx, downloaded file is a zip file containing the required dll file
ZipExtractAll Downloaded file is a zip file and the complete content will be extracted.

Existing files will be overwritten.
Files that no longer exist in the target folder will not be removed.

If required, additional update procedures can be implemented

AllowVersionStripping

In case the PluginUpdateURL contains the plugin's version, following placeholders are suported: {MAJOR}, {MINOR}, {BUILD} and {MINORREVISION}.
A new plugin version of 1.2.3.4 and an PluginUpdateURL of https://www.example.com/MyPlugin-{MAJOR}.{MINOR}.{BUILD}.plgx will download https://www.example.com/MyPlugin-1.2.3.plgx
The target filename is expected to be MyPlugin.plgx.

A new plugin version of 1.0.2.0 and an PluginUpdateURL of https://www.example.com/MyPlugin-{MAJOR}{.MINOR}{.BUILD}{REVISION}.plgx will download https://www.example.com/MyPlugin-1.0.2.plgx if AllowVersionStripping is true and https://www.example.com/MyPlugin-1.0.2.0.plgx otherwise.
The target filename is expected to be MyPlugin.plgx.