summaryrefslogtreecommitdiffstats
path: root/packaging/wix/version.py
diff options
context:
space:
mode:
Diffstat (limited to 'packaging/wix/version.py')
-rw-r--r--packaging/wix/version.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/packaging/wix/version.py b/packaging/wix/version.py
new file mode 100644
index 000000000..46968c90c
--- /dev/null
+++ b/packaging/wix/version.py
@@ -0,0 +1,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")
+
+
+