diff --git a/NTMakefile b/NTMakefile
index a22e7d308..00c5a54f0 100644
--- a/NTMakefile
+++ b/NTMakefile
@@ -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
index 000000000..52fc0f24a
--- /dev/null
+++ b/packages/windows/installer/NTMakefile
@@ -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
index 000000000..faedf2135
--- /dev/null
+++ b/packages/windows/installer/heimdal-assemblies.wxs
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ 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
index 000000000..0d5dc69ab
--- /dev/null
+++ b/packages/windows/installer/heimdal-installer.wxs
@@ -0,0 +1,157 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/windows/NTMakefile.w32 b/windows/NTMakefile.w32
index 86b73debb..291417da5 100644
--- a/windows/NTMakefile.w32
+++ b/windows/NTMakefile.w32
@@ -72,19 +72,20 @@ MCPU=amd64
#----------------------------------------------------------------
# Directory macros
-DESTDIR=$(SRC)\out\dest_$(OUTDIR)
-OBJDIR =$(SRC)\out\obj_$(OUTDIR)
+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
+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 \