From 26b165437efa2b3e272da46062760e3039f5133c Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Sun, 28 Oct 2018 08:45:23 +0000 Subject: [PATCH] Document the product_version() condition function --- docs/metadata/changelog.rst | 3 +++ docs/metadata/conditions.rst | 30 ++++++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/docs/metadata/changelog.rst b/docs/metadata/changelog.rst index f13a8706..d5c811b7 100644 --- a/docs/metadata/changelog.rst +++ b/docs/metadata/changelog.rst @@ -12,6 +12,9 @@ Added - The ``Group`` data structure now has a ``description`` key that takes a string value. +- The condition function ``product_version(file_path path, version + given_version, comparison_operator comparator)``, which checks against the + Product Version field of an executable. Changed ------- diff --git a/docs/metadata/conditions.rst b/docs/metadata/conditions.rst index 04e51ce3..9c21961d 100644 --- a/docs/metadata/conditions.rst +++ b/docs/metadata/conditions.rst @@ -103,9 +103,35 @@ There are several conditions that can be tested for using the functions detailed actual_version comparator given_version - (where ``actual version`` is the version read from ``path``) holds true, and false otherwise. If ``path`` does not exist or does not have a version number, its version is assumed to be ``0``. + (where ``actual version`` is the version read from ``path``) holds true, and + false otherwise. If ``path`` is a plugin, its version is read from its + description field. If ``path`` is not a plugin, it will be assumed to be an + executable (e.g. ``*.exe`` or ``*.dll``), and its version is read from its + File Version field. If ``path`` does not exist or does not have a version + number, its version is assumed to be ``0``. If ``path`` isn't a plugin or an + executable, an error will occur. - The comparison uses the precedence rules defined by `Semantic Versioning `_, extended to allow leading zeroes, an arbitrary number of release version numbers, case-insensitivity and a wider range of separator characters. + The comparison uses the precedence rules defined by `Semantic Versioning + `_, extended to allow leading zeroes, an arbitrary number + of release version numbers, case-insensitivity and a wider range of separator + characters. + +.. describe:: product_version(file_path path, version given_version, comparison_operator comparator) + + Returns true if the boolean expression:: + + actual_version comparator given_version + + (where ``actual version`` is the version read from ``path``) holds true, and + false otherwise. ``path`` must be an executable (e.g. ``*.exe`` or ``*.dll``), + and its version is read from its Product Version field. If ``path`` does not + exist or does not have a version number, its version is assumed to be ``0``. + If ``path`` is not an executable, an error will occur. + + The comparison uses the precedence rules defined by `Semantic Versioning + `_, extended to allow leading zeroes, an arbitrary number + of release version numbers, case-insensitivity and a wider range of separator + characters. Logical Operators =================