summaryrefslogtreecommitdiffstats
path: root/PCbuild/vs9to8.py
diff options
context:
space:
mode:
Diffstat (limited to 'PCbuild/vs9to8.py')
-rw-r--r--PCbuild/vs9to8.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/PCbuild/vs9to8.py b/PCbuild/vs9to8.py
new file mode 100644
index 0000000..0669cfb
--- /dev/null
+++ b/PCbuild/vs9to8.py
@@ -0,0 +1,29 @@
+from __future__ import with_statement
+import os
+
+def vs9to8(src, dest):
+ for name in os.listdir(src):
+ path, ext = os.path.splitext(name)
+ if ext.lower() not in ('.sln', '.vcproj', '.vsprops'):
+ continue
+
+ filename = os.path.normpath(os.path.join(src, name))
+ destname = os.path.normpath(os.path.join(dest, name))
+ print("%s -> %s" % (filename, destname))
+
+ with open(filename, 'r') as fin:
+ lines = fin.read()
+ lines = lines.replace('Version="9,00"', 'Version="8.00"')
+ lines = lines.replace('Version="9.00"', 'Version="8.00"')
+ lines = lines.replace('Format Version 10.00', 'Format Version 9.00')
+ lines = lines.replace('Visual Studio 2008', 'Visual Studio 2005')
+
+ lines = lines.replace('wininst-9.0', 'wininst-8.0')
+ lines = lines.replace('..\\', '..\\..\\')
+ lines = lines.replace('..\\..\\..\\..\\', '..\\..\\..\\')
+
+ with open(destname, 'w') as fout:
+ fout.write(lines)
+
+if __name__ == "__main__":
+ vs9to8(src=".", dest="..\PC\VS8.0")