OSDN Git Service

Set the company field of the version info on executables to the publisher.
authorJames Teh <jamie@jantrid.net>
Tue, 21 Jun 2011 01:40:40 +0000 (11:40 +1000)
committerJames Teh <jamie@jantrid.net>
Tue, 21 Jun 2011 01:40:40 +0000 (11:40 +1000)
This means that the manufacturer field is populated correctly for the NVDA service. There are possibly other cases where this appears as well.
The publisher defaults to "unknown" but can be overridden during build.

sconstruct
source/setup.py
source/versionInfo.py

index 07a6ed4..280ca5b 100755 (executable)
@@ -73,7 +73,7 @@ keyCommandsLangBlacklist=set(['ja'])
 vars = Variables()\r
 vars.Add("version", "The version of this build", versionInfo.version)\r
 vars.Add(BoolVariable("release", "Whether this is a release version", False))\r
-vars.Add("publisher", "The publisher of this build", "unknown")\r
+vars.Add("publisher", "The publisher of this build", versionInfo.publisher)\r
 vars.Add(PathVariable("certFile", "The certificate file with which to sign executables", "",\r
        lambda key, val, env: not val or PathVariable.PathIsFile(key, val, env)))\r
 vars.Add("certPassword", "The password for the private key in the signing certificate", "")\r
@@ -93,6 +93,7 @@ if len(unknown)>0:
 \r
 version = env["version"]\r
 release = env["release"]\r
+publisher = env["publisher"]\r
 certFile = env["certFile"]\r
 certPassword = env["certPassword"]\r
 userDocsDir=Dir('user_docs')\r
@@ -164,7 +165,10 @@ def NVDADistGenerator(target, source, env, for_signature):
        # Make the NVDA build use the specified version.\r
        # We don't do this using normal scons mechanisms because we want it to be cleaned up immediately after this builder\r
        # and py2exe will cause bytecode files to be created for it which scons doesn't know about.\r
-       action = [lambda target, source, env: file(buildVersionFn, "w").write('version = "%s"' % version)]\r
+       action = [lambda target, source, env: file(buildVersionFn, "w").write(\r
+               'version = {version!r}\r\n'\r
+               'publisher = {publisher!r}\r\n'\r
+               .format(version=version, publisher=publisher))]\r
 \r
        buildCmd = ["cd", source[0].path, "&&",\r
                sys.executable]\r
index d8d64b7..a3d8792 100755 (executable)
@@ -141,6 +141,7 @@ setup(
                        "description":"NVDA application",\r
                        "product_version":version,\r
                        "copyright":copyright,\r
+                       "company_name":publisher,\r
                },\r
                {\r
                        "script": "nvda_slave.pyw",\r
@@ -149,6 +150,7 @@ setup(
                        "description": "NVDA slave",\r
                        "product_version": version,\r
                        "copyright": copyright,\r
+                       "company_name": publisher,\r
                },\r
        ],\r
        service=[{\r
@@ -158,6 +160,7 @@ setup(
                "description": "NVDA service",\r
                "product_version": version,\r
                "copyright": copyright,\r
+               "company_name": publisher,\r
                "uac_info": ("requireAdministrator", False),\r
                "cmdline_style": "pywin32",\r
        }],\r
index 5a7fba2..d9318a7 100644 (file)
@@ -31,8 +31,9 @@ def _updateVersionFromVCS():
 name="NVDA"\r
 longName=_("NonVisual Desktop Access")\r
 version="2011.2dev"\r
+publisher="unknown"\r
 try:\r
-       from _buildVersion import version\r
+       from _buildVersion import version, publisher\r
 except ImportError:\r
        _updateVersionFromVCS()\r
 description=_("A free and open source screen reader for Microsoft Windows")\r