From dd6d5a0e2cf13f3051113b356ea158f5e65bdb46 Mon Sep 17 00:00:00 2001 From: "Asanka C. Herath" Date: Thu, 2 Dec 2010 21:36:50 -0500 Subject: [PATCH] Windows: Build multiplatform installer When building the x64 installer, we can optionally include 32-bit components as well. This requires that the 32-bit build to be already completed. The resulting multiplatform installer will install both sets of components. This is enabled by the environment variable MULTIPLATFORM_INSTALLER. --- packages/windows/installer/NTMakefile | 95 +++-- .../windows/installer/heimdal-installer.wxs | 374 +++++++++++------- windows/NTMakefile.w32 | 4 +- 3 files changed, 278 insertions(+), 195 deletions(-) diff --git a/packages/windows/installer/NTMakefile b/packages/windows/installer/NTMakefile index bd87a0e1c..54af6064b 100644 --- a/packages/windows/installer/NTMakefile +++ b/packages/windows/installer/NTMakefile @@ -93,19 +93,6 @@ clean:: -$(RM) $(SDKREDISTDIR)\Heimdal.msm -$(RM) $(SDKREDISTDIR)\Heimdal.Policy.msm -# Locate 32-bit assembly merge modules - -!if "$(CPU)"=="AMD64" -ASSEMBLYDIR32=$(SDKREDISTDIR:AMD64=i386) - -!if !exist( $(ASSEMBLYDIR32)\Heimdal.msm ) - -!message 32-bit assembly not found. Skipping 32-bit components -!undef ASSEMBLYDIR32 -!endif - -!endif - ###################################################################### # Runtime modules @@ -117,12 +104,6 @@ VCVER=VC80 ! error Cant determine Visual C compiler version !endif -!if "$(CPU)"=="AMD64" -CPUSUFFIX=_x64 -!else -CPUSUFFIX= -!endif - !if "$(BUILD)"=="rel" CRTNAME=CRT !else @@ -136,11 +117,13 @@ MMDIR=$(SystemDrive)\Program Files (x86)\Common Files\Merge Modules !if exist("$(MMDIR)") -RUNTIMEMODULE="$(MMDIR)\Microsoft_$(VCVER)_$(CRTNAME)_x86$(CPUSUFFIX).msm" +RUNTIMEMODULE32="$(MMDIR)\Microsoft_$(VCVER)_$(CRTNAME)_x86.msm" +RUNTIMEMODULE64="$(MMDIR)\Microsoft_$(VCVER)_$(CRTNAME)_x86_x64.msm" !else -RUNTIMEMODULE="$(MSSDK)\Redist\VC\microsoft.vcxx.crt.$(PLATFORM)_msm.msm" +RUNTIMEMODULE32="$(MSSDK)\Redist\VC\microsoft.vcxx.crt.x86_msm.msm" +RUNTIMEMODULE64="$(MSSDK)\Redist\VC\microsoft.vcxx.crt.x64_msm.msm" !endif @@ -148,44 +131,72 @@ RUNTIMEMODULE="$(MSSDK)\Redist\VC\microsoft.vcxx.crt.$(PLATFORM)_msm.msm" ###################################################################### # Heimdal installer +CANDLEOPTS= \ + -dVersion=$(VERSION) \ + -dBinDir=$(BINDIR) \ + -dDocDir=$(DOCDIR) \ + -dSrcDir=$(SRC) \ + -dPlatform=$(PLATFORM) \ + -dPolPrefix=$(POLPREFIX) \ + +!if "$(CPU)"=="AMD64" + +INSTDIR32=$(INSTDIR:AMD64=i386) + +CANDLEOPTS=$(CANDLEOPTS) -dTarget64 \ + -dInstDir32=$(INSTDIR32) \ + -dInstDir64=$(INSTDIR) \ + -dRuntimeModule32=$(RUNTIMEMODULE32) \ + -dRuntimeModule64=$(RUNTIMEMODULE64) \ + +!ifdef MULTIPLATFORM_INSTALLER +CANDLEOPTS=$(CANDLEOPTS) -dTarget32 +!else +! message Excluding 32-bit components from installer +!endif + +INSTDEPS=$(INSTDIR32)\Heimdal.msm \ + $(INSTDIR32)\Heimdal.Policy.msm \ + $(ASSEMBLYMODULE) $(POLICYMODULE) + +!else + +CANDLEOPTS=$(CANDLEOPTS) -dTarget32 \ + -dInstDir32=$(INSTDIR) \ + -dRuntimeModule32=$(RUNTIMEMODULE32) \ + +!endif + !if exist($(SRC)\thirdparty) THIRDPARTYOBJS=$(INSTDIR)\apicache.wixobj $(INSTDIR)\lsacache.wixobj -THIRDPARTYOPT=-dApiCache=1 -dLsaCache=1 +THIRDPARTYOPTS=-dApiCache=1 -dLsaCache=1 + +!if "$(CPU)"=="AMD64" +THIRDPARTYOBJS=$(THIRDPARTYOBJS) $(INSTDIR32)\apicache.wixobj $(INSTDIR32)\lsacache.wixobj +!endif !endif !if exist($(SRC)\thirdparty\MKShim) THIRDPARTYOBJS=$(THIRDPARTYOBJS) $(INSTDIR)\MKShim.wixlib -THIRDPARTYOPT=$(THIRDPARTYOPT) -dMKShim=1 +THIRDPARTYOPTS=$(THIRDPARTYOPTS) -dMKShim=1 + +!if "$(CPU)"=="AMD64" +THIRDPARTYOBJS=$(THIRDPARTYOBJS) $(INSTDIR32)\MKShim.wixlib +!endif !endif INSTALLER=$(INSTDIR)\Heimdal-$(CPU)$(DEBUGOPT)-$(VERSIOND).msi -$(INSTALLER): $(OBJ)\heimdal-installer.wixobj $(ASSEMBLYMODULE) $(POLICYMODULE) \ - $(THIRDPARTYOBJS) $(THIRDPARTYDEPS) lang\en-us.wxl +$(INSTALLER): $(OBJ)\heimdal-installer.wixobj $(THIRDPARTYOBJS) $(INSTDEPS) lang\en-us.wxl $(LIGHT) -out $@ $(OBJ)\heimdal-installer.wixobj $(THIRDPARTYOBJS) \ -sval -cultures:en-us -loc lang\en-us.wxl \ -dWixUILicenseRtf=lang\license-en-us.rtf \ -ext WixUIExtension $(_CODESIGN) -!ifdef ASSEMBLYDIR32 -$(INSTALLER): $(ASSEMBLYDIR32)\Heimdal.msm $(ASSEMBLYDIR32)\Heimdal.Policy.msm -!endif - $(OBJ)\heimdal-installer.wixobj: heimdal-installer.wxs - $(CANDLE) -arch $(PLATFORM) -o $@ heimdal-installer.wxs \ - -dVersion=$(VERSION) \ - -dBinDir=$(BINDIR) \ - -dDocDir=$(DOCDIR) \ - -dInstDir=$(INSTDIR) \ -!ifdef ASSEMBLYDIR32 - -dAssemblyDir32=$(ASSEMBLYDIR32) \ -!endif - -dSrcDir=$(SRC) \ - -dPlatform=$(PLATFORM) \ - -dRuntimeModule=$(RUNTIMEMODULE) \ - -dPolPrefix=$(POLPREFIX) \ - $(THIRDPARTYOPT) + $(CANDLE) -arch $(PLATFORM) -o $@ heimdal-installer.wxs \ + $(CANDLEOPTS) $(THIRDPARTYOPTS) all:: $(INSTALLER) diff --git a/packages/windows/installer/heimdal-installer.wxs b/packages/windows/installer/heimdal-installer.wxs index 876cf7267..5139e93ef 100644 --- a/packages/windows/installer/heimdal-installer.wxs +++ b/packages/windows/installer/heimdal-installer.wxs @@ -5,6 +5,8 @@ + + @@ -15,10 +17,14 @@ + + + + @@ -29,6 +35,8 @@ + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -245,7 +303,7 @@ - + @@ -294,14 +352,13 @@ Installed OR Privileged Installed OR NOT EXISTINGINSTALLATION - - @@ -316,27 +373,42 @@ - + + + + + + + - + + - - - - - - - - + + - - - - + + + + + + + + + + + + + + + + + + @@ -353,7 +425,7 @@ - + diff --git a/windows/NTMakefile.w32 b/windows/NTMakefile.w32 index 08f61bba8..b5cff7f6c 100644 --- a/windows/NTMakefile.w32 +++ b/windows/NTMakefile.w32 @@ -72,8 +72,8 @@ MCPU=amd64 #---------------------------------------------------------------- # Directory macros -DESTDIR =$(SRC)\out\dest_$(OUTDIR) -OBJDIR =$(SRC)\out\obj_$(OUTDIR) +DESTDIR =$(SRC)\out\dest_$(CPU) +OBJDIR =$(SRC)\out\obj_$(CPU) INCDIR =$(DESTDIR)\inc LIBDIR =$(DESTDIR)\lib