diff --git a/configure.ac b/configure.ac index a39e7284..09494768 100644 --- a/configure.ac +++ b/configure.ac @@ -52,6 +52,8 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AC_CANONICAL_HOST AC_PROG_CC +# AC_PROG_CXX is needed to built the win32 custom action. Indeed dutil.h use [extern "C"] definition which fails on pure c compiler +AC_PROG_CXX PKG_PROG_PKG_CONFIG AC_C_BIGENDIAN diff --git a/win32/Make.rules.mak b/win32/Make.rules.mak index 58408dff..84d71fed 100644 --- a/win32/Make.rules.mak +++ b/win32/Make.rules.mak @@ -6,20 +6,20 @@ MINIDRIVER_DEF = /DENABLE_MINIDRIVER #Build MSI with the Windows Installer XML (WIX) toolkit, requires WIX >= 3.6 !IF "$(BUILD_ON)" == "WIN64" WIX_PATH = "C:\Program Files (x86)\Windows Installer XML v3.6" -WIX_INCL_DIR = "/IC:\Program Files (x86)\Windows Installer XML v3.6\SDK\VS2010\inc" +WIX_INCL_DIR = "/IC:\Program Files (x86)\Windows Installer XML v3.6\SDK\inc" !IF "$(BUILD_FOR)" == "WIN64" -WIX_LIB = "C:\Program Files (x86)\Windows Installer XML v3.6\SDK\VS2010\lib\x64" +WIX_LIBS = "C:\Program Files (x86)\Windows Installer XML v3.6\SDK\lib\dutil_2010_x64.lib" "C:\Program Files (x86)\Windows Installer XML v3.6\SDK\lib\wcautil_2010_x64.lib" !ELSE -WIX_LIB = "C:\Program Files (x86)\Windows Installer XML v3.6\SDK\VS2010\lib\x86" +WIX_LIBS = "C:\Program Files (x86)\Windows Installer XML v3.6\SDK\lib\dutil_2010.lib" "C:\Program Files (x86)\Windows Installer XML v3.6\SDK\lib\wcautil_2010.lib" !ENDIF !ELSE WIX_PATH = "C:\Program Files\Windows Installer XML v3.6" -WIX_INCL_DIR = "/IC:\Program Files\Windows Installer XML v3.6\SDK\VS2010\inc" +WIX_INCL_DIR = "/IC:\Program Files\Windows Installer XML v3.6\SDK\inc" !IF "$(BUILD_FOR)" == "WIN64" -WIX_LIB = "C:\Program Files\Windows Installer XML v3.6\SDK\VS2010\lib\x64" +WIX_LIBS = "C:\Program Files\Windows Installer XML v3.6\SDK\lib\dutil_2010_x64.lib" "C:\Program Files\Windows Installer XML v3.6\SDK\lib\wcautil_2010_x64.lib" !ELSE -WIX_LIB = "C:\Program Files\Windows Installer XML v3.6\SDK\VS2010\lib\x86" +WIX_LIBS = "C:\Program Files\Windows Installer XML v3.6\SDK\lib\dutil_2010.lib" "C:\Program Files\Windows Installer XML v3.6\SDK\lib\wcautil_2010.lib" !ENDIF !ENDIF diff --git a/win32/Makefile.am b/win32/Makefile.am index e2fc7397..9723a35a 100644 --- a/win32/Makefile.am +++ b/win32/Makefile.am @@ -15,7 +15,7 @@ lib_LTLIBRARIES = customactions@LIBRARY_BITNESS@.la AM_CPPFLAGS = -I$(top_srcdir) -customactions@LIBRARY_BITNESS@_la_SOURCES = customactions.c customactions.exports +customactions@LIBRARY_BITNESS@_la_SOURCES = customactions.cpp customactions.exports customactions@LIBRARY_BITNESS@_la_LIBADD = \ $(top_builddir)/win32/customactions.la customactions@LIBRARY_BITNESS@_la_LDFLAGS = $(AM_LDFLAGS) \ diff --git a/win32/Makefile.mak b/win32/Makefile.mak index 64645691..c062d5c8 100644 --- a/win32/Makefile.mak +++ b/win32/Makefile.mak @@ -11,14 +11,13 @@ customactions.dll: customactions.obj echo LIBRARY $* > $*.def echo EXPORTS >> $*.def type customactions.exports >> $*.def - link /dll $(LINKFLAGS) /def:$*.def /out:customactions.dll customactions.obj msi.lib $(WIX_LIB)\dutil.lib $(WIX_LIB)\wcautil.lib - + link /dll $(LINKFLAGS) /def:$*.def /out:customactions.dll customactions.obj msi.lib $(WIX_LIBS) OpenSC.msi: OpenSC.wixobj $(WIX_PATH)\bin\light.exe -sh -ext WixUIExtension -ext WiXUtilExtension $? OpenSC.wixobj: OpenSC.wxs customactions.dll - $(WIX_PATH)\bin\candle.exe -ext WiXUtilExtension -dSOURCE_DIR=$(TOPDIR) $(CANDLEFLAGS) $? + $(WIX_PATH)\bin\candle.exe -ext WiXUtilExtension -dSOURCE_DIR=$(TOPDIR) $(CANDLEFLAGS) OpenSC.wxs clean:: del /Q config.h *.msi *.wixobj *.wixpdb diff --git a/win32/customactions.c b/win32/customactions.cpp similarity index 95% rename from win32/customactions.c rename to win32/customactions.cpp index f47aac84..55bda9cb 100644 --- a/win32/customactions.c +++ b/win32/customactions.cpp @@ -33,6 +33,10 @@ #include #include +#include +#include + +#include // WiX Header Files: #include