# HG changeset patch
# User Adrian Buehlmann <adr...@cadifra.com>
# Date 1264983704 -3600
# Node ID bc3d1a851fe4962c9777d2212de4422bdb01ff2d
# Parent  96601bd9273e0222f1f611af6461d1f33f70d5e7
setup.py: specify exe file version and copyright for hgtk.exe and thgtaskbar.exe

The "binary" file versions for exe-files on Windows must have the form
99999.99999.99999.99999 (only four groups of digits), as can also be seen by
the warning we get from by py2exe:

warning: py2exe: Version Info will not be included:
  could not parse version number '0.9.2+316-bb7de261c6b7+20100201'

With this patch applied, py2exe now creates version resource info as explicitly
specified for the specific exe's (ignoring the version parameter given to the 
setup
call at the very end).

Before this patch, hgtk.exe and thgtaskbar.exe didn't have any version resource
at all, if the version info could not be parsed by py2exe (e.g. nightly builds).

Regular releases (e.g. 0.9.2) did have file versions, but the copyright info was
missing.

See also http://www.mail-archive.com/python-l...@python.org/msg47210.html

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -15,6 +15,8 @@ from distutils.core import setup
 from distutils.command.build import build
 from distutils.spawn import spawn, find_executable
 
+py2exe_version = '0.10.0.0'
+py2exe_copyright = 'Copyright 2010 Steve Borho and others'
 
 class build_mo(build):
 
@@ -113,13 +115,18 @@ def setup_windows():
     }
     extra['console'] = [
             {'script':'contrib/hg', 'icon_resources':[(0,'icons/hg.ico')]},
-            {'script':'hgtk', 'icon_resources':[(0,'icons/thg_logo.ico')]},
+            {'script':'hgtk',
+             'icon_resources':[(0,'icons/thg_logo.ico')],
+             'version':py2exe_version,
+             'copyright':py2exe_copyright},
             {'script':'contrib/docdiff.py',
              'icon_resources':[(0,'icons/TortoiseMerge.ico')]}
             ]
     extra['windows'] = [
             {'script':'thgtaskbar.py',
-             'icon_resources':[(0,'icons/thg_logo.ico')]}
+             'icon_resources':[(0,'icons/thg_logo.ico')],
+             'version':py2exe_version,
+             'copyright':py2exe_copyright}
             ]
 
     return _scripts, _packages, _data_files, extra

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Tortoisehg-develop mailing list
Tortoisehg-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to