2003-07-30 21:38:59 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
# $Id$
|
|
|
|
# update resource.rc with version numbers.
|
|
|
|
|
2003-09-10 18:28:38 +00:00
|
|
|
import boinc_path_config
|
|
|
|
from Boinc.version import *
|
2003-07-30 21:38:59 +00:00
|
|
|
import os, re
|
|
|
|
|
|
|
|
fn_rc_old = 'resource.rc.old'
|
|
|
|
fn_rc = 'resource.rc'
|
|
|
|
|
|
|
|
os.rename(fn_rc, fn_rc_old)
|
|
|
|
rc_old = open(fn_rc_old)
|
|
|
|
rc = open(fn_rc, 'w')
|
|
|
|
|
|
|
|
version_string = '%d,0,%d,0' % (MAJOR_VERSION, MINOR_VERSION)
|
|
|
|
version_string_spaces = '"%d, 0, %d, 0\\\\0"' % (MAJOR_VERSION, MINOR_VERSION)
|
|
|
|
|
|
|
|
for line in rc_old:
|
|
|
|
line = re.sub('( +(FILEVERSION|PRODUDUCTVERSION) +).*', '\\1'+version_string, line)
|
|
|
|
line = re.sub('( +VALUE "(FileVersion|ProductVersion)", +).*', '\\1'+version_string_spaces, line)
|
|
|
|
rc.write(line)
|
|
|
|
|
|
|
|
print "Updated resource.rc to version %d.%02d" %(MAJOR_VERSION, MINOR_VERSION)
|