aboutsummaryrefslogtreecommitdiff
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
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.
-rw-r--r--makefile.after11
-rw-r--r--runtime.debug.manifest15
-rw-r--r--runtime.manifest15
-rw-r--r--tools/genruntimemanifest.py49
-rw-r--r--xorg-server/installer/genruntimeinclude.py51
-rw-r--r--xorg-server/installer/packageall.bat5
-rw-r--r--xorg-server/installer/vcxsrv.nsi15
7 files changed, 116 insertions, 45 deletions
diff --git a/makefile.after b/makefile.after
index d024b3456..18b1d6f25 100644
--- a/makefile.after
+++ b/makefile.after
@@ -3,12 +3,6 @@ OBJS:=$(OBJS:%.cc=$(OBJDIR)$/%$(OBJEXT))
RESOBJS:=$(RESOURCES:%.rc=$(OBJDIR)$/%.res)
-ifeq ($(DEBUG),1)
-MANIFESTFILE:=$(MHMAKECONF)\runtime.debug.manifest
-else
-MANIFESTFILE:=$(MHMAKECONF)\runtime.manifest
-endif
-
ifdef SUBDIRS
load_makefile $(SUBDIRS:%=%\makefile MAKESERVER=$(MAKESERVER) DEBUG=$(DEBUG);)
all: $(SUBDIRS:%=%\all)
@@ -34,8 +28,13 @@ PDB := $(EXE:%.exe=%.pdb)
#LINKFLAGS += /SUBSYSTEM:WINDOWS
+MANIFESTFILE:=$(OBJDIR)\runtime.manifest
+
all: $(EXE)
+$(MANIFESTFILE):
+ $(MHMAKECONF)/tools/genruntimemanifest $@ $(DEBUG)
+
$(EXE) : $(OBJS) $(INCLUDELIBFILES) $(RESOBJS) $(MANIFESTFILE)
$(LINK) $(LINKFLAGS) /MANIFEST:NO /OUT:$(relpath $@) $(INCLUDELIBFILES) $(SYSTEMLIBS) $(LINKLIBS) $(OBJS) $(RESOBJS)
mt -nologo -manifest $(MANIFESTFILE) -outputresource:$(relpath $@);\#1
diff --git a/runtime.debug.manifest b/runtime.debug.manifest
deleted file mode 100644
index dcc64c2a3..000000000
--- a/runtime.debug.manifest
+++ /dev/null
@@ -1,15 +0,0 @@
-<?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.DebugCRT" version="9.0.30729.1" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b" />
- </dependentAssembly>
- </dependency>
-</assembly>
diff --git a/runtime.manifest b/runtime.manifest
deleted file mode 100644
index e1888927c..000000000
--- a/runtime.manifest
+++ /dev/null
@@ -1,15 +0,0 @@
-<?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.CRT" version="9.0.30729.1" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b" />
- </dependentAssembly>
- </dependency>
-</assembly>
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)
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 "<PUBLICTOKEN>"
+!define MSVC_VERSION "<VERSION>"
+!define MSVCR90_DLL "<WINSXSDIR>\x86_Microsoft.VC90.CRT_${MSVC_PUBLICTOKEN}_9.0.${MSVC_VERSION}_<SUFFIX>\msvcr90.dll"
+!define MSVCM90_DLL "<WINSXSDIR>\x86_Microsoft.VC90.CRT_${MSVC_PUBLICTOKEN}_9.0.${MSVC_VERSION}_<SUFFIX>\msvcm90.dll"
+!define MSVCP90_DLL "<WINSXSDIR>\x86_Microsoft.VC90.CRT_${MSVC_PUBLICTOKEN}_9.0.${MSVC_VERSION}_<SUFFIX>\msvcp90.dll"
+!define MSVC_CAT "<WINSXSDIR>\manifests\x86_Microsoft.VC90.CRT_${MSVC_PUBLICTOKEN}_9.0.${MSVC_VERSION}_<SUFFIX>.cat"
+!define MSVC_MANIFEST_PART "x86_Microsoft.VC90.CRT_${MSVC_PUBLICTOKEN}_9.0.${MSVC_VERSION}_<SUFFIX>.manifest"
+!define MSVC_MANIFEST "<WINSXSDIR>\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("<VERSION>","%d.%d"%(MajorVersion,MinorVersion),Template)
+Template=re.sub("<PUBLICTOKEN>",PublicToken,Template)
+Template=re.sub("<SUFFIX>",Suffix,Template)
+
+WinSxsDir=os.path.join(os.getenv("systemroot"),"WinSxS")
+Template=re.sub("<WINSXSDIR>",WinSxsDir,Template)
+
+if len(sys.argv)==3 and sys.argv[2]=="1":
+ Template=re.sub("<DEBUG>","Debug",Template)
+else:
+ Template=re.sub("<DEBUG>","",Template)
+
+open("runtime","w").write(Template)
diff --git a/xorg-server/installer/packageall.bat b/xorg-server/installer/packageall.bat
index 80295c682..b68ffdfa1 100644
--- a/xorg-server/installer/packageall.bat
+++ b/xorg-server/installer/packageall.bat
@@ -1,2 +1,3 @@
-del vcxsrv.*.installer.exe
-"C:\Program Files\NSIS\makensis.exe" ..\installer\vcxsrv.nsi \ No newline at end of file
+if exist vcxsrv.*.installer.exe del vcxsrv.*.installer.exe
+python genruntimeinclude.py
+"C:\Program Files\NSIS\makensis.exe" vcxsrv.nsi \ No newline at end of file
diff --git a/xorg-server/installer/vcxsrv.nsi b/xorg-server/installer/vcxsrv.nsi
index 66cd3db5b..85c005576 100644
--- a/xorg-server/installer/vcxsrv.nsi
+++ b/xorg-server/installer/vcxsrv.nsi
@@ -42,6 +42,7 @@ XPStyle on
!define FUSION_REFCOUNT_UNINSTALL_SUBKEY_GUID {8cedc215-ac4b-488b-93c0-a50a49cb2fb8}
+!include runtime
;--------------------------------
@@ -80,11 +81,11 @@ Section "VcXsrv (required)"
InitPluginsDir
SetOutPath $PLUGINSDIR
- File "C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.1_none_e163563597edeada\msvcr90.dll"
- File "C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.1_none_e163563597edeada\msvcm90.dll"
- File "C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.1_none_e163563597edeada\msvcp90.dll"
- File "C:\Windows\winsxs\manifests\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.1_none_e163563597edeada.cat"
- File "C:\Windows\winsxs\manifests\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.1_none_e163563597edeada.manifest"
+ File "${MSVCR90_DLL}"
+ File "${MSVCM90_DLL}"
+ File "${MSVCP90_DLL}"
+ File "${MSVC_CAT}"
+ File "${MSVC_MANIFEST}"
DetailPrint "Installing CRT assembly..."
System::Call "sxs::CreateAssemblyCache(*i .r0, i 0) i.r1"
StrCmp $1 0 0 fail
@@ -97,7 +98,7 @@ Section "VcXsrv (required)"
System::Call "*(i 32, i 0, i 2364391957, i 1217113163, i 178634899, i 3090139977, w 'nsissxs', w '') i.s"
Pop $2
# IAssemblyCache::InstallAssembly(0, manifestPath, fir)
- System::Call "$0->7(i 0, w '$PLUGINSDIR\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.1_none_e163563597edeada.manifest', i r2) i.r1"
+ System::Call "$0->7(i 0, w '$PLUGINSDIR\${MSVC_MANIFEST_PART}', i r2) i.r1"
System::Free $2
StrCmp $1 0 0 fail2
System::Call "$0->2()"
@@ -174,7 +175,7 @@ Section "Uninstall"
StrCmp $1 0 0 fail
System::Call "*(i 32, i 0, i 2364391957, i 1217113163, i 178634899, i 3090139977, w 'nsissxs', w '') i.s"
Pop $2
- System::Call "$0->3(i 0, w 'Microsoft.VC90.CRT,version=$\"9.0.21022.8$\",type=$\"win32$\",processorArchitecture=$\"x86$\",publicKeyToken=$\"1fc8b3b9a1e18e3b$\"', i r2, *i . r3) i.r1"
+ System::Call "$0->3(i 0, w 'Microsoft.VC90.CRT,version=$\"9.0.${MSVC_VERSION}$\",type=$\"win32$\",processorArchitecture=$\"x86$\",publicKeyToken=$\"${MSVC_PUBLICTOKEN}$\"', i r2, *i . r3) i.r1"
StrCmp $1 0 0 fail2
DetailPrint "Disposition returned is $3"
System::Call "$0->2()"