aboutsummaryrefslogtreecommitdiff
path: root/tools/genruntimemanifest.py
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-08-06 11:43:19 +0000
committermarha <marha@users.sourceforge.net>2009-08-06 11:43:19 +0000
commit8b7fb34c4a3483aea08ddcc697b2a11c17d2e403 (patch)
tree7084b8e6f2965c18ef54ab4408dd489ad89cb43c /tools/genruntimemanifest.py
parent5a4d2414ae2ae1c3bcb70b1c7febd1423a19077f (diff)
downloadvcxsrv-8b7fb34c4a3483aea08ddcc697b2a11c17d2e403.tar.gz
vcxsrv-8b7fb34c4a3483aea08ddcc697b2a11c17d2e403.tar.bz2
vcxsrv-8b7fb34c4a3483aea08ddcc697b2a11c17d2e403.zip
Generate the manifest file at run-time (taking the latest version of the runtime installed)
Installer: used the latest version of the run-time installed.
Diffstat (limited to 'tools/genruntimemanifest.py')
-rw-r--r--tools/genruntimemanifest.py49
1 files changed, 49 insertions, 0 deletions
diff --git a/tools/genruntimemanifest.py b/tools/genruntimemanifest.py
new file mode 100644
index 000000000..3ab6b89e7
--- /dev/null
+++ b/tools/genruntimemanifest.py
@@ -0,0 +1,49 @@
+Template=r"""<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
+<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+ <security>
+ <requestedPrivileges>
+ <requestedExecutionLevel level='asInvoker' uiAccess='false' />
+ </requestedPrivileges>
+ </security>
+ </trustInfo>
+ <dependency>
+ <dependentAssembly>
+ <assemblyIdentity type="win32" name="Microsoft.VC90.<DEBUG>CRT" version="9.0.<VERSION>" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b" />
+ </dependentAssembly>
+ </dependency>
+</assembly>
+"""
+
+import glob,re,sys
+
+Files=glob.glob(r"c:\windows\winsxs\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.*")
+
+SearchRe=re.compile(r"c:\\windows\\winsxs\\x86_Microsoft\.VC90\.CRT_1fc8b3b9a1e18e3b_9\.0\.([0-9]+)\.([0-9]+)_",re.I)
+
+MajorVersion=0
+MinorVersion=0
+LatestFile=None
+#Now Select the one with the latest version
+for File in Files:
+ # Extract version
+ Search=SearchRe.search(File)
+ Major=int(Search.group(1))
+ Minor=int(Search.group(2))
+ if Major>MajorVersion:
+ MajorVersion=Major
+ MinorVersion=Minor
+ LatestFile=File
+ elif Major==MajorVersion and Minor>MinorVersion:
+ MinorVersion=Minor
+ LatestFile=File
+
+
+Template=re.sub("<VERSION>","%d.%d"%(MajorVersion,MinorVersion),Template)
+
+if len(sys.argv)==3 and sys.argv[2]=="1":
+ Template=re.sub("<DEBUG>","Debug",Template)
+else:
+ Template=re.sub("<DEBUG>","",Template)
+
+open(sys.argv[1],"w").write(Template)