Permalink
Browse files

Provide programmatic version information in all of our executables an…

…d dlls.

Provide proper version information in all executables and dlls: year, major, minor, build. Build is conveyed to scons via a version_build argument. AppVeyor uses its own build number for this.
Issue #6204. PR #6205.
  • Loading branch information...
1 parent 7654d37 commit 438d0221e981650d153953b9bcdcc2c9c948f24f @michaelDCurran michaelDCurran committed with jcsteh Sep 1, 2016
View
@@ -63,6 +63,7 @@ build_script:
}
$sconsArgs += ' publisher="NV Access"'
$sconsArgs += " certFile=appveyor\authenticode.pfx certTimestampServer=http://timestamp.digicert.com"
+ $sconsArgs += " version_build=$env:APPVEYOR_BUILD_NUMBER"
# We use cmd to run scons because PowerShell throws exceptions if warnings get dumped to stderr.
# It's possible to work around this, but the workarounds have annoying side effects.
Set-AppveyorBuildVariable "sconsArgs" $sconsArgs
@@ -13,7 +13,7 @@ ReserveFile "${NSISDIR}\Plugins\banner.dll"
ReserveFile "..\miscDeps\launcher\nvda_logo.wav"
Name "NVDA"
-VIProductVersion "0.0.0.0" ;Needs to be here so other version info shows up
+VIProductVersion "${VERSION_YEAR}.${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_BUILD}" ;Needs to be here so other version info shows up
VIAddVersionKey "ProductName" "NVDA"
VIAddVersionKey "LegalCopyright" "${COPYRIGHT}"
VIAddVersionKey "FileDescription" "NVDA launcher file"
@@ -65,6 +65,19 @@ env.Append(LINKFLAGS='/OPT:REF') #having symbols usually turns this off but we h
Export('env')
+import versionInfo
+projectRCSubstDict={
+ '%version_year%':env['version_year'],
+ '%version_major%':env['version_major'],
+ '%version_minor%':env['version_minor'],
+ '%version_build%':env['version_build'],
+ '%copyright%':env['copyright'],
+ '%publisher%':env['publisher'],
+ '%version%':env['version'],
+ '%productName%':"%s (%s)"%(versionInfo.name,versionInfo.longName),
+}
+env['projectResFile']=env.RES(env.Substfile('nvda.rc.subst',SUBST_DICT=projectRCSubstDict))
+
acrobatAccessRPCStubs=env.SConscript('acrobatAccess_sconscript')
Export('acrobatAccessRPCStubs')
if TARGET_ARCH=='x86':
@@ -33,6 +33,7 @@ clientLibName="nvdaControllerClient%s"%('64' if env['TARGET_ARCH']=='x86_64' els
clientLib=env.SharedLibrary(
target=clientLibName,
source=[
+ env['projectResFile'],
"client.cpp",
winIPCUtilsObj,
controllerRPCClientSource,
@@ -70,6 +70,7 @@ displayModelRPCHeader,displayModelRPCClientSource=env.MSRPCStubs(
localLib=env.SharedLibrary(
target="nvdaHelperLocal",
source=[
+ env['projectResFile'],
"nvdaHelperLocal.cpp",
"beeps.cpp",
vbufRPCClientSource,
@@ -0,0 +1,19 @@
+1 VERSIONINFO
+ FILEVERSION %version_year%,%version_major%,%version_minor%,%version_build%
+ PRODUCTVERSION %version_year%,%version_major%,%version_minor%,%version_build%
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "CompanyName", "%publisher%"
+ VALUE "LegalCopyright", "%copyright%"
+ VALUE "ProductName", "%productName%"
+ VALUE "ProductVersion", "%version%"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
@@ -75,6 +75,7 @@ ia2utilsObj=env.Object("./ia2utils","../common/ia2utils.cpp")
remoteLib=env.SharedLibrary(
target="nvdaHelperRemote",
source=[
+ env['projectResFile'],
"injection.cpp",
"log.cpp",
"inProcess.cpp",
@@ -19,7 +19,7 @@ env.Append(LINKFLAGS='/subsystem:windows')
remoteLoaderProgram=env.Program(
target='nvdaHelperRemoteLoader',
- source=['loader.cpp'],
+ source=[env['projectResFile'],'loader.cpp'],
LIBS=[remoteLib[2],'kernel32'],
)
@@ -21,6 +21,7 @@ Import([
adobeAcrobatBackendLib=env.SharedLibrary(
target="VBufBackend_adobeAcrobat",
source=[
+ env['projectResFile'],
"adobeAcrobat.cpp",
env.Object('_acrobatAccess_i',acrobatAccessRPCStubs[2]),
],
@@ -20,6 +20,7 @@ Import([
adobeFlashBackendLib=env.SharedLibrary(
target="VBufBackend_adobeFlash",
source=[
+ env['projectResFile'],
"adobeFlash.cpp",
],
LIBS=[
@@ -23,6 +23,7 @@ ia2utilsObj=env.Object("./ia2utils","../../common/ia2utils.cpp")
geckoBackendLib=env.SharedLibrary(
target="VBufBackend_gecko_ia2",
source=[
+ env['projectResFile'],
"gecko_ia2.cpp",
ia2utilsObj,
env.Object('_ia2_i',ia2RPCStubs[3]),
@@ -20,6 +20,7 @@ Import([
lotusNotesRichTextBackendLib=env.SharedLibrary(
target="VBufBackend_lotusNotesRichText",
source=[
+ env['projectResFile'],
"lotusNotesRichText.cpp",
],
LIBS=[
@@ -20,6 +20,7 @@ Import([
mshtmlBackendLib=env.SharedLibrary(
target="VBufBackend_mshtml",
source=[
+ env['projectResFile'],
"mshtml.cpp",
"node.cpp",
],
@@ -20,6 +20,7 @@ Import([
webKitBackendLib=env.SharedLibrary(
target="VBufBackend_webKit",
source=[
+ env['projectResFile'],
"webKit.cpp",
],
LIBS=[
View
@@ -61,6 +61,7 @@ keyCommandsLangBlacklist=set([])
vars = Variables()
vars.Add("version", "The version of this build", versionInfo.version)
+vars.Add("version_build", "A unique number for this build.", "0")
vars.Add(BoolVariable("release", "Whether this is a release version", False))
vars.Add("publisher", "The publisher of this build", versionInfo.publisher)
vars.Add("updateVersionType", "The version type for which to check for updates", versionInfo.updateVersionType or "")
@@ -91,7 +92,11 @@ if len(unknown)>0:
env['ENV']['PYTHONPATH']=Dir('#miscDeps/python').abspath
env["copyright"]=versionInfo.copyright
+env['version_year']=versionInfo.version_year
+env['version_major']=versionInfo.version_major
+env['version_minor']=versionInfo.version_minor
version = env["version"]
+version_build = env["version_build"]
release = env["release"]
publisher = env["publisher"]
certFile = env["certFile"]
@@ -195,7 +200,8 @@ def NVDADistGenerator(target, source, env, for_signature):
'version = {version!r}\r\n'
'publisher = {publisher!r}\r\n'
'updateVersionType = {updateVersionType!r}\r\n'
- .format(version=version, publisher=publisher, updateVersionType=updateVersionType))]
+ 'version_build = {version_build!r}\r\n'
+ .format(version=version, publisher=publisher, updateVersionType=updateVersionType,version_build=version_build))]
buildCmd = ["cd", source[0].path, "&&",
sys.executable]
@@ -265,7 +271,7 @@ env["BUILDERS"]["ZipArchive"] = Builder(action=ZipArchiveAction)
uninstFile=File("dist/uninstall.exe")
uninstGen = env.Command(File("uninstaller/uninstGen.exe"), "uninstaller/uninst.nsi",
[[makensis, "/V2",
- "/DVERSION=$version", '/DPUBLISHER="$publisher"','/DCOPYRIGHT="$copyright"',
+ "/DVERSION=$version", '/DPUBLISHER="$publisher"','/DCOPYRIGHT="$copyright"','/DVERSION_YEAR="$version_year"','/DVERSION_MAJOR="$version_major"','/DVERSION_MINOR="$version_minor"','/DVERSION_BUILD="$version_build"',
"/DUNINSTEXE=%s"%uninstFile.abspath,
"/DINSTEXE=${TARGET.abspath}",
"$SOURCE"]])
@@ -282,7 +288,7 @@ env.Clean([dist], buildDir)
launcher = env.Command(outputDir.File("%s.exe" % outFilePrefix), ["launcher/nvdaLauncher.nsi", dist],
[[makensis, "/V2",
- "/DVERSION=$version", '/DPUBLISHER="$publisher"','/DCOPYRIGHT="$copyright"',
+ "/DVERSION=$version", '/DPUBLISHER="$publisher"','/DCOPYRIGHT="$copyright"','/DVERSION_YEAR="$version_year"','/DVERSION_MAJOR="$version_major"','/DVERSION_MINOR="$version_minor"','/DVERSION_BUILD="$version_build"',
"/DNVDADistDir=${SOURCES[1].abspath}", "/DLAUNCHEREXE=${TARGET.abspath}",
"$SOURCE"]])
if certFile:
View
@@ -171,7 +171,7 @@ def getRecursiveDataFiles(dest,source,excludes=()):
"dest_base":"nvda_noUIAccess",
"uac_info": ("asInvoker", False),
"icon_resources":[(1,"images/nvda.ico")],
- "version":"0.0.0.0",
+ "version":"%s.%s.%s.%s"%(version_year,version_major,version_minor,version_build),
"description":"NVDA application",
"product_version":version,
"copyright":copyright,
@@ -181,7 +181,7 @@ def getRecursiveDataFiles(dest,source,excludes=()):
{
"script": "nvda_slave.pyw",
"icon_resources": [(1,"images/nvda.ico")],
- "version": "0.0.0.0",
+ "version":"%s.%s.%s.%s"%(version_year,version_major,version_minor,version_build),
"description": name,
"product_version": version,
"copyright": copyright,
@@ -192,7 +192,7 @@ def getRecursiveDataFiles(dest,source,excludes=()):
# uiAccess will be enabled at runtime if appropriate.
"uac_info": ("asInvoker", False),
"icon_resources": [(1,"images/nvda.ico")],
- "version": "0.0.0.0",
+ "version":"%s.%s.%s.%s"%(version_year,version_major,version_minor,version_build),
"description": "NVDA Ease of Access proxy",
"product_version": version,
"copyright": copyright,
@@ -202,7 +202,7 @@ def getRecursiveDataFiles(dest,source,excludes=()):
service=[{
"modules": ["nvda_service"],
"icon_resources": [(1, "images/nvda.ico")],
- "version": "0.0.0.0",
+ "version":"%s.%s.%s.%s"%(version_year,version_major,version_minor,version_build),
"description": "NVDA service",
"product_version": version,
"copyright": copyright,
@@ -31,11 +31,15 @@ def _updateVersionFromVCS():
# Otherwise, py2exe will break.
name="NVDA"
longName=_("NonVisual Desktop Access")
-version="2016.4dev"
+version_year=2016
+version_major=4
+version_minor=0
+version_build=0
+version="%s.%s.%sdev"%(version_year,version_major,version_minor)
publisher="unknown"
updateVersionType=None
try:
- from _buildVersion import version, publisher, updateVersionType
+ from _buildVersion import version, publisher, updateVersionType, version_build
except ImportError:
_updateVersionFromVCS()
description=_("A free and open source screen reader for Microsoft Windows")
@@ -16,10 +16,10 @@ RequestExecutionLevel user
ReserveFile "..\miscDeps\uninstaller\UAC.dll"
Name "${appName}"
-VIProductVersion "0.0.0.0" ;Needs to be here so other version info shows up
+VIProductVersion "${VERSION_YEAR}.${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_BUILD}" ;Needs to be here so other version info shows up
VIAddVersionKey "ProductName" "${appName}"
VIAddVersionKey "LegalCopyright" "${COPYRIGHT}"
-VIAddVersionKey "FileDescription" "${appName} installer"
+VIAddVersionKey "FileDescription" "${appName} uninstaller"
VIAddVersionKey "ProductVersion" "${VERSION}"
;Minimal installer to generate uninstaller

0 comments on commit 438d022

Please sign in to comment.