Windows: Build installers
authorAsanka C. Herath <asanka@secure-endpoints.com>
Thu, 23 Sep 2010 18:59:41 +0000 (14:59 -0400)
committerAsanka C. Herath <asanka@secure-endpoints.com>
Wed, 24 Nov 2010 20:32:09 +0000 (15:32 -0500)
NTMakefile
packages/windows/installer/NTMakefile [new file with mode: 0644]
packages/windows/installer/heimdal-assemblies.wxs [new file with mode: 0644]
packages/windows/installer/heimdal-installer.wxs [new file with mode: 0644]
windows/NTMakefile.w32

index a22e7d30828220b2e53aca06b088825331f2e7ff..00c5a54f03a017e8c4cd494525c2502bd37d21ce 100644 (file)
@@ -34,7 +34,7 @@ thirdparty=thirdparty
 !endif
 
 SUBDIRS = include lib kuser kdc admin kadmin kpasswd appl doc \
-       tools tests packages etc $(thirdparty)
+       tools tests packages etc $(thirdparty) packages\windows\installer
 
 !include windows/NTMakefile.w32
 
diff --git a/packages/windows/installer/NTMakefile b/packages/windows/installer/NTMakefile
new file mode 100644 (file)
index 0000000..52fc0f2
--- /dev/null
@@ -0,0 +1,88 @@
+########################################################################
+#
+# Copyright (c) 2010, Secure Endpoints Inc.
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 
+# - Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# 
+# - Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+# 
+
+RELDIR=packages\windows\installer
+
+!include ../../../windows/NTMakefile.w32
+
+VERSIOND=$(VER_PRODUCT_MAJOR)-$(VER_PRODUCT_MINOR)-$(VER_PRODUCT_AUX)-$(VER_PRODUCT_PATCH)
+VERSION=$(VER_PRODUCT_MAJOR).$(VER_PRODUCT_MINOR).$(VER_PRODUCT_AUX).$(VER_PRODUCT_PATCH)
+
+!if "$(CPU)"=="AMD64"
+PLATFORM=x64
+!else
+PLATFORM=x86
+!endif
+
+MERGEMOD=$(INSTDIR)\Heimdal.msm
+
+$(MERGEMOD): $(OBJ)\heimdal-assemblies.wixobj
+       $(LIGHT) -out $@ $**
+
+$(OBJ)\heimdal-assemblies.wixobj: heimdal-assemblies.wxs
+       $(CANDLE) -arch $(PLATFORM) -o $@ $** \
+               -dVersion=$(VERSION)    \
+               -dBinDir=$(BINDIR)      \
+               -dPlatform=$(PLATFORM)
+
+all:: $(MERGEMOD)
+
+clean::
+       -$(RM) $(MERGEMOD)
+
+!if exist($(SRC)\thirdparty)
+THIRDPARTYOBJS=$(INSTDIR)\apicache.wixobj $(INSTDIR)\lsacache.wixobj
+THIRDPARTYDEPS=$(INSTDIR)\Heimdal-krbcompat.msm
+THIRDPARTYOPT=-dApiCache=1 -dLsaCache=1 -dKrbCompat=1
+!endif
+
+INSTALLER=$(INSTDIR)\Heimdal.msi
+
+RUNTIMEMODULE="$(MSSDK)\Redist\VC\microsoft.vcxx.crt.$(PLATFORM)_msm.msm"
+
+$(INSTALLER): $(OBJ)\heimdal-installer.wixobj $(MERGEMOD) $(THIRDPARTYOBJS) $(THIRDPARTYDEPS)
+       $(LIGHT) -out $@ $(OBJ)\heimdal-installer.wixobj $(THIRDPARTYOBJS) -sval
+       $(_CODESIGN)
+
+$(OBJ)\heimdal-installer.wixobj: heimdal-installer.wxs
+       $(CANDLE) -arch $(PLATFORM) -o $@ $** \
+               -dVersion=$(VERSION)    \
+               -dBinDir=$(BINDIR)      \
+               -dInstDir=$(INSTDIR)    \
+               -dSrcDir=$(SRC)         \
+               -dPlatform=$(PLATFORM)  \
+               -dRuntimeModule=$(RUNTIMEMODULE) \
+               $(THIRDPARTYOPT)
+
+all:: $(INSTALLER)
+
+clean::
+       -$(RM) $(INSTALLER)
\ No newline at end of file
diff --git a/packages/windows/installer/heimdal-assemblies.wxs b/packages/windows/installer/heimdal-assemblies.wxs
new file mode 100644 (file)
index 0000000..faedf21
--- /dev/null
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="windows-1252"?>
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+
+  <?if $(var.Platform)=x64 ?>
+
+  <?define Win64=yes ?>
+  <?define GuidKerberos=78905402-0F4B-48E1-924C-B0E18657C5C5 ?>
+  <?define GuidGSSAPI=6EDFA308-6825-4395-9C9E-362C890F1343 ?>
+
+  <?else?>
+
+  <?define Win64=no ?>
+  <?define GuidKerberos=C5919968-FEC4-4D17-89A4-8697B95F115E ?>
+  <?define GuidGSSAPI=F1EEAB94-ACF3-425E-85BE-4761A0634F46 ?>
+
+  <?endif?>
+
+  <Module Id="Heimdal" Language="0" Version="$(var.Version)">
+
+    <Package Id="A064012D-F3C3-4059-9AC0-00D8A5283D6D"
+             InstallerVersion="200"
+             Languages="1033" Manufacturer="Secure Endpoints Inc."
+             SummaryCodepage="1252" AdminImage="no"
+             Platform="$(var.Platform)" />
+
+    <Directory Id='TARGETDIR' Name='SourceDir'>
+      <Directory Id="dir.Heimdal.Kerberos" Name="Heimdal.Kerberos"
+                 FileSource="$(var.BinDir)\Heimdal.Kerberos">
+        <Component Id="comp.Heimdal.Kerberos"
+                   Guid="$(var.GuidKerberos)"
+                   Win64="$(var.Win64)">
+          <File Name="heimdal.dll" KeyPath="yes" Assembly="win32"
+                AssemblyManifest="id.Heimdal.Kerberos.manifest" />
+          <File Name="com_err.dll" />
+          <File Name="heimdal.pdb" />
+          <File Name="com_err.pdb" />
+          <File Name="Heimdal.Kerberos.cat" />
+          <File Name="Heimdal.Kerberos.manifest" Id="id.Heimdal.Kerberos.manifest" />
+        </Component>
+      </Directory>
+
+      <Directory Id="dir.Heimdal.GSSAPI" Name="Heimdal.GSSAPI"
+                 FileSource="$(var.BinDir)\Heimdal.GSSAPI">
+        <Component Id="comp.Heimdal.GSSAPI"
+                   Guid="$(var.GuidGSSAPI)"
+                   Win64="$(var.Win64)">
+          <File Name="gssapi.dll" KeyPath="yes" Assembly="win32"
+                AssemblyManifest="id.Heimdal.GSSAPI.manifest" />
+          <File Name="gssapi.pdb" />
+          <File Name="Heimdal.GSSAPI.cat" />
+          <File Name="Heimdal.GSSAPI.manifest" Id="id.Heimdal.GSSAPI.manifest" />
+        </Component>
+
+      </Directory>
+    </Directory>
+
+  </Module>
+</Wix>
\ No newline at end of file
diff --git a/packages/windows/installer/heimdal-installer.wxs b/packages/windows/installer/heimdal-installer.wxs
new file mode 100644 (file)
index 0000000..0d5dc69
--- /dev/null
@@ -0,0 +1,157 @@
+<?xml version='1.0' encoding='windows-1252'?>
+<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
+
+  <?if $(var.Platform)=x64 ?>
+
+  <?define Win64=yes ?>
+  <?define PIProgramFilesFolder=ProgramFiles64Folder ?>
+  <?define GuidKinit=BAA5BD92-163E-4AA5-8C99-EA2100F3D9DE ?>
+  <?define GuidKlist=60E82A9D-2CD4-4DE5-8DCA-F3A010BE8A19 ?>
+  <?define GuidKswitch=7320C75F-80C5-4AA3-B133-2AB7F496B291 ?>
+  <?define GuidKdestroy=289C2C0D-F41D-4E46-9819-6B9B63F83418 ?>
+  <?define GuidKtutil=28B09087-4731-41F4-B734-C71E84EC31FC ?>
+  <?define GuidKdigest=D13DA4C0-B1BB-4C02-8ED2-5DFC7D16B19D ?>
+
+  <?else?>
+
+  <?define Win64=no ?>
+  <?define PIProgramFilesFolder=ProgramFilesFolder ?>
+  <?define GuidKinit=038F19D7-F7C9-4B6A-8359-321CD1FAD347 ?>
+  <?define GuidKlist=36BF8C4E-B0C4-42AF-9F3F-3D6F8CFEBB49 ?>
+  <?define GuidKswitch=3A4438E7-BBC0-47B4-9146-E0CDCBBE6C86 ?>
+  <?define GuidKdestroy=07D96FBC-2251-4EBC-AA68-12C6C52F44E6 ?>
+  <?define GuidKtutil=CE082458-E2C5-4744-A423-88C23AD3C81C ?>
+  <?define GuidKdigest=3FFBFAB0-FB37-411C-AF4E-53BCC468D7D1 ?>
+
+  <?endif?>
+
+  <Product Name='Heimdal'
+           Id='*' UpgradeCode='81E64C32-1D09-4E3D-9EA2-EECD9C4D16CE'
+           Language='1033' Codepage='1252' Version='$(var.Version)'
+           Manufacturer='Secure Endpoints Inc.'>
+
+    <Package Id='*' Description="Heimdal"
+      Comments='Heimdal Kerberos tools and libraries'
+      Manufacturer='Secure Endpoints Inc.'
+      InstallerVersion='300' Languages='1033' Compressed='yes' SummaryCodepage='1252' />
+
+    <Directory Id='TARGETDIR' Name='SourceDir' DiskId='1'>
+      <Directory Id='$(var.PIProgramFilesFolder)' Name='PFiles'>
+        <Directory Id='INSTALLDIR' Name='Heimdal'>
+          <Directory Id='dirBin' Name='bin' FileSource='$(var.BinDir)'>
+
+            <Component Id='comp.kinit'
+                       Guid='$(var.GuidKinit)'
+                       Win64='$(var.Win64)'>
+              <File Name='kinit.exe' KeyPath='yes' />
+            </Component>
+
+            <Component Id='comp.klist'
+                       Guid='$(var.GuidKlist)'
+                       Win64='$(var.Win64)'>
+              <File Name='klist.exe' KeyPath='yes' />
+            </Component>
+
+            <Component Id='comp.kswitch'
+                       Guid='$(var.GuidKswitch)'
+                       Win64='$(var.Win64)'>
+              <File Name='kswitch.exe' KeyPath='yes' />
+            </Component>
+
+            <Component Id='comp.ktutil'
+                       Guid='$(var.GuidKtutil)'
+                       Win64='$(var.Win64)'>
+              <File Name='ktutil.exe' KeyPath='yes' />
+            </Component>
+
+            <Component Id='comp.kdestroy'
+                       Guid='$(var.GuidKdestroy)'
+                       Win64='$(var.Win64)'>
+              <File Name='kdestroy.exe' KeyPath='yes' />
+            </Component>
+
+            <Component Id='comp.kdigest'
+                       Guid='$(var.GuidKdigest)'
+                       Win64='$(var.Win64)'>
+              <File Name='kdigest.exe' KeyPath='yes' />
+            </Component>
+
+            <Merge Id='Heimdal.Assemblies' Language='0'
+                   SourceFile='$(var.InstDir)\Heimdal.msm' />
+
+            <Merge Id='Runtime' Language='0'
+                   SourceFile='$(var.RuntimeModule)' />
+
+            <?ifdef KrbCompat?>
+            <Merge Id='Heimdal.Compatibility' Language='0'
+                   SourceFile='$(var.InstDir)\Heimdal-krbcompat.msm' />
+            <?endif?>
+
+            <Directory Id='dirPlugin' Name='plugin'>
+              <Directory Id='PLUGINDIR' Name='krb5'>
+
+                <Component Id='comp.Plugin.Reg'
+                           Guid='4BC44234-70A4-4CC1-A5AF-4CA76E9F9487'>
+                  <RegistryKey Action='createAndRemoveOnUninstall' Root='HKLM'
+                               Key='Software\Heimdal'>
+                    <RegistryValue Name='plugin_dir' Type='multiString' Action='append'
+                                   Value='"[PLUGINDIR]"' KeyPath='yes' />
+                  </RegistryKey>
+                </Component>
+
+              </Directory>
+            </Directory>
+
+          </Directory>
+        </Directory>
+      </Directory>
+      <Directory Id='CommonAppDataFolder' Name='ProgramData'>
+        <Directory Id='dirCommonHeimdal' Name='Heimdal' FileSource='$(var.SrcDir)'>
+
+            <Component Id='comp.krb5.conf'
+                       Guid='ED28951F-7B17-4DF5-91D7-4DC11C810E66' >
+              <File Name='krb5.conf' KeyPath='yes' />
+            </Component>
+
+        </Directory>
+      </Directory>
+    </Directory>
+
+    <Media Id='1' Cabinet='Disk1' CompressionLevel='high' EmbedCab='yes' />
+
+    <Feature Id='feature.Main' ConfigurableDirectory='INSTALLDIR'
+             Title='Heimdal'
+             Description='Command line tools and libraries for Heimdal Kerberos'
+             Level='1' TypicalDefault='install' InstallDefault='local'>
+
+      <ComponentRef Id='comp.kinit' />
+      <ComponentRef Id='comp.klist' />
+      <ComponentRef Id='comp.kdestroy' />
+      <ComponentRef Id='comp.kswitch' />
+      <ComponentRef Id='comp.kdigest' />
+      <ComponentRef Id='comp.ktutil' />
+      <ComponentRef Id='comp.krb5.conf' />
+      <?ifdef LsaCache ?>
+      <ComponentRef Id='comp.LSACache' />
+      <?endif?>
+      <?ifdef ApiCache ?>
+      <ComponentRef Id='comp.APICache' />
+      <?endif?>
+      <ComponentRef Id='comp.Plugin.Reg' />
+
+      <MergeRef Id='Heimdal.Assemblies' />
+      <MergeRef Id='Runtime' />
+      <?ifdef KrbCompat?>
+      <MergeRef Id='Heimdal.Compatibility' />
+      <?endif?>
+
+      <?ifdef Thirdparty ?>
+      <ComponentGroupRef Id='comp.Heimdal.Thirdparty' />
+      <?endif?>
+
+    </Feature>
+
+    <Property Id='ALLUSERS' Value='1' Secure='yes' />
+
+  </Product>
+</Wix>
index 86b73debb09e364fb31d2004f9792440e3e78602..291417da511c38dbc1218d3d436ff007095eec13 100644 (file)
@@ -72,19 +72,20 @@ MCPU=amd64
 #----------------------------------------------------------------
 # Directory macros
 
-DESTDIR=$(SRC)\out\dest_$(OUTDIR)
-OBJDIR =$(SRC)\out\obj_$(OUTDIR)
-
-INCDIR =$(DESTDIR)\inc
-LIBDIR =$(DESTDIR)\lib
-BINDIR =$(DESTDIR)\bin
-SBINDIR=$(BINDIR)
-LIBEXECDIR=$(BINDIR)
-ASMDIR=$(BINDIR)
-SDKDIR=$(SRC)\out
-SDKINCDIR=$(SRC)\out\inc
-SDKLIBDIR=$(SRC)\out\lib\$(CPU)
-SDKSRCDIR=$(SRC)\out\src
+DESTDIR                =$(SRC)\out\dest_$(OUTDIR)
+OBJDIR         =$(SRC)\out\obj_$(OUTDIR)
+
+INCDIR         =$(DESTDIR)\inc
+LIBDIR         =$(DESTDIR)\lib
+BINDIR         =$(DESTDIR)\bin
+SBINDIR                =$(BINDIR)
+LIBEXECDIR     =$(BINDIR)
+ASMDIR         =$(BINDIR)
+INSTDIR                =$(DESTDIR)\install
+SDKDIR         =$(SRC)\out
+SDKINCDIR      =$(SRC)\out\inc
+SDKLIBDIR      =$(SRC)\out\lib\$(CPU)
+SDKSRCDIR      =$(SRC)\out\src
 
 !ifdef RELDIR
 SRCDIR =$(SRC)\$(RELDIR)
@@ -117,6 +118,9 @@ CMP=cmp.exe
 SIGNTOOL=signtool.exe
 MAKECAT=makecat.exe
 
+CANDLE=candle.exe
+LIGHT=light.exe
+
 # Only used for tests
 SH=sh.exe
 SED=sed.exe
@@ -141,6 +145,8 @@ pthreadinc= -I$(PTHREAD_INC)
 
 cincdirs=$(cincdirs) -I$(INCDIR) -I$(INCDIR)\krb5 $(pthreadinc)
 cdefines=$(cdefines) -DHAVE_CONFIG_H
+cdebug=$(cdebug) /Zi
+ldebug=$(ldebug) /DEBUG
 
 # ---------------------------------------------------------------
 # time_t issues
@@ -220,7 +226,7 @@ RC2RES = $(RC2RES_C) -fo $@ $**
 !ifndef RECURSE
 
 check-utils:
-       @for %%g in ( "$(AWK)" "$(YACC)" "$(LEX)" "$(PYTHON)" "$(PERL)" "$(CMP)" "$(SED)" "$(SIGNTOOL)" "$(MAKECAT)" ) do @( \
+       @for %%g in ( "$(AWK)" "$(YACC)" "$(LEX)" "$(PYTHON)" "$(PERL)" "$(CMP)" "$(SED)" "$(SIGNTOOL)" "$(MAKECAT)" "$(CANDLE)" "$(LIGHT)") do @( \
        for /f %%f in ( "%%g" ) do @( \
                if exist %%f @( \
                        echo Found %%f \