From 8b7fb34c4a3483aea08ddcc697b2a11c17d2e403 Mon Sep 17 00:00:00 2001 From: marha Date: Thu, 6 Aug 2009 11:43:19 +0000 Subject: 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. --- xorg-server/installer/genruntimeinclude.py | 51 ++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 xorg-server/installer/genruntimeinclude.py (limited to 'xorg-server/installer/genruntimeinclude.py') diff --git a/xorg-server/installer/genruntimeinclude.py b/xorg-server/installer/genruntimeinclude.py new file mode 100644 index 000000000..ffc1c8d9f --- /dev/null +++ b/xorg-server/installer/genruntimeinclude.py @@ -0,0 +1,51 @@ +PublicToken="1fc8b3b9a1e18e3b" + +Template=r"""!define MSVC_PUBLICTOKEN "" +!define MSVC_VERSION "" +!define MSVCR90_DLL "\x86_Microsoft.VC90.CRT_${MSVC_PUBLICTOKEN}_9.0.${MSVC_VERSION}_\msvcr90.dll" +!define MSVCM90_DLL "\x86_Microsoft.VC90.CRT_${MSVC_PUBLICTOKEN}_9.0.${MSVC_VERSION}_\msvcm90.dll" +!define MSVCP90_DLL "\x86_Microsoft.VC90.CRT_${MSVC_PUBLICTOKEN}_9.0.${MSVC_VERSION}_\msvcp90.dll" +!define MSVC_CAT "\manifests\x86_Microsoft.VC90.CRT_${MSVC_PUBLICTOKEN}_9.0.${MSVC_VERSION}_.cat" +!define MSVC_MANIFEST_PART "x86_Microsoft.VC90.CRT_${MSVC_PUBLICTOKEN}_9.0.${MSVC_VERSION}_.manifest" +!define MSVC_MANIFEST "\manifests\${MSVC_MANIFEST_PART}" +""" + +import glob,re,sys,os + +Files=glob.glob(r"c:\windows\winsxs\x86_Microsoft.VC90.CRT_%s_9.0.*"%PublicToken) + +SearchRe=re.compile(r"c:\\windows\\winsxs\\x86_Microsoft\.VC90\.CRT_%s_9\.0\.([0-9]+)\.([0-9]+)_(.*)"%PublicToken,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 + Suffix=Search.group(3) + elif Major==MajorVersion and Minor>MinorVersion: + MinorVersion=Minor + LatestFile=File + Suffix=Search.group(3) + + +Template=re.sub("","%d.%d"%(MajorVersion,MinorVersion),Template) +Template=re.sub("",PublicToken,Template) +Template=re.sub("",Suffix,Template) + +WinSxsDir=os.path.join(os.getenv("systemroot"),"WinSxS") +Template=re.sub("",WinSxsDir,Template) + +if len(sys.argv)==3 and sys.argv[2]=="1": + Template=re.sub("","Debug",Template) +else: + Template=re.sub("","",Template) + +open("runtime","w").write(Template) -- cgit v1.2.3