Try harder to generate a usable version string

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7186 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2020-06-06 14:14:02 +00:00
parent 7bad4de01a
commit 04541d1955
2 changed files with 20 additions and 2 deletions

View file

@ -285,7 +285,7 @@ if defenv.get('VERSION','') == '' and 'VER_MAJOR' in defenv:
if 'VER_REVISION' in defenv:
defenv['VERSION'] += '.' + defenv['VER_REVISION']
if defenv.get('VERSION','') == '' and int(defenv['VER_PACKED'], 0) > int('0x02000000', 0):
defenv['VERSION'] = '%i' % int(defenv['VER_PACKED'][2:][:2]) # Default to major version
defenv['VERSION'] = '%i.%i.%i' % (int(defenv['VER_PACKED'][2:][:2]), int(defenv['VER_PACKED'][4:][:3]), int(defenv['VER_PACKED'][7:][:2]))
print('WARNING: VERSION not set, defaulting to %s!' % defenv['VERSION'])
f.write('#define NSIS_VERSION _T("v%s")\n' % defenv['VERSION'])