summaryrefslogtreecommitdiffstats
path: root/packaging/wix/version.py
blob: 46968c90ce826881ce73c23d0337467bafce3302 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/python

import os

version = ''

# retrieve the version information from the inkscape.rc file
#             VALUE "ProductVersion", "0.48+devel"
with open('..\..\src\inkscape.rc', 'r') as rc:
	for line in rc.readlines():
		if 'productversion' in line.lower() and 'value' in line.lower():
			items = line.split()
			version = items[2]
			version = version.replace('"', '')
			version = version.replace("'", "")
			# version = version.replace("+", "_")
			print version
			

with open('version.wxi', 'w') as wxi:
	wxi.write("<?xml version='1.0' encoding='utf-8'?>\n")
	wxi.write("<!-- do not edit, this file is created by version.py tool any changes will be lost -->\n")
	wxi.write("<Include>\n")
	wxi.write("<?define ProductVersion='" + version + "' ?>\n")
	wxi.write("<?define FullProductName='Inkscape " + version + "' ?>\n")
	wxi.write("</Include>\n")