custom action skeleton (without actions) - help welcome ...

This commit is contained in:
vletoux 2015-04-24 15:58:54 +02:00 committed by Viktor Tarasov
parent 017d98f87f
commit 5a1ca44c11
6 changed files with 110 additions and 6 deletions

View File

@ -6,10 +6,26 @@ 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"
!IF "$(BUILD_FOR)" == "WIN64"
WIX_LIB = "C:\Program Files (x86)\Windows Installer XML v3.6\SDK\VS2010\lib\x64"
!ELSE
WIX_LIB = "C:\Program Files (x86)\Windows Installer XML v3.6\SDK\VS2010\lib\x86"
!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"
!IF "$(BUILD_FOR)" == "WIN64"
WIX_LIB = "C:\Program Files\Windows Installer XML v3.6\SDK\VS2010\lib\x64"
!ELSE
WIX_LIB = "C:\Program Files\Windows Installer XML v3.6\SDK\VS2010\lib\x86"
!ENDIF
!ENDIF
#Include support for Secure Messaging
SM_DEF = /DENABLE_SM
@ -67,7 +83,7 @@ CNGSDK_INCL_DIR = "/IC:\Program Files\Microsoft CNG Development Kit\Include"
# O1 - minimal code size
CODE_OPTIMIZATION = /O1
ALL_INCLUDES = /I$(TOPDIR)\win32 /I$(TOPDIR)\src $(OPENSSL_INCL_DIR) $(ZLIB_INCL_DIR) $(LIBLTDL_INCL) $(INTTYPES_INCL_DIR) $(CNGSDK_INCL_DIR)
ALL_INCLUDES = /I$(TOPDIR)\win32 /I$(TOPDIR)\src $(OPENSSL_INCL_DIR) $(ZLIB_INCL_DIR) $(LIBLTDL_INCL) $(INTTYPES_INCL_DIR) $(CNGSDK_INCL_DIR) $(WIX_INCL_DIR)
!IF "$(DEBUG_DEF)" == "/DDEBUG"
LINKDEBUGFLAGS = /NODEFAULTLIB:LIBCMT /DEBUG

View File

@ -1,9 +1,27 @@
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in $(srcdir)/versioninfo.rc $(srcdir)/winconfig.h \
$(srcdir)/OpenSC.iss $(srcdir)/OpenSC.wxs $(srcdir)/OpenSC.ico $(srcdir)/license.rtf
$(srcdir)/OpenSC.iss $(srcdir)/OpenSC.wxs $(srcdir)/OpenSC.ico $(srcdir)/license.rtf \
$(srcdir)/dlgbmp.bmp $(srcdir)/bannrbmp.bmp
EXTRA_DIST = ltrc.inc Makefile.mak Make.rules.mak opensc-install.bat \
versioninfo.rc.in winconfig.h.in OpenSC.iss.in OpenSC.wxs.in
dist_noinst_HEADERS = versioninfo.rc winconfig.h OpenSC.iss OpenSC.wxs license.rtf OpenSC.ico
dist_noinst_HEADERS = versioninfo.rc winconfig.h OpenSC.iss OpenSC.wxs license.rtf OpenSC.ico dlgbmp.bmp bannrbmp.bmp
if WIN32
sbin_SCRIPTS = opensc-install.bat
endif
if ENABLE_MINIDRIVER
lib_LTLIBRARIES = customactions@LIBRARY_BITNESS@.la
AM_CPPFLAGS = -I$(top_srcdir)
customactions@LIBRARY_BITNESS@_la_SOURCES = customactions.c customactions.exports
customactions@LIBRARY_BITNESS@_la_LIBADD = \
$(top_builddir)/win32/customactions.la
customactions@LIBRARY_BITNESS@_la_LDFLAGS = $(AM_LDFLAGS) \
-export-symbols "$(srcdir)/customactions.exports" \
-module -avoid-version -no-undefined
install-exec-hook:
mv "$(DESTDIR)$(libdir)/customactions@LIBRARY_BITNESS@.dll" "$(DESTDIR)$(bindir)/"
endif

View File

@ -7,10 +7,17 @@ all: config.h
config.h: winconfig.h
copy /y winconfig.h config.h
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
OpenSC.msi: OpenSC.wixobj
$(WIX_PATH)\bin\light.exe -sh -ext WixUIExtension -ext WiXUtilExtension $?
OpenSC.wixobj: OpenSC.wxs
OpenSC.wixobj: OpenSC.wxs customactions.dll
$(WIX_PATH)\bin\candle.exe -ext WiXUtilExtension -dSOURCE_DIR=$(TOPDIR) $(CANDLEFLAGS) $?
clean::

View File

@ -33,8 +33,8 @@
<!-- OpenSC is covered by LGPL. Extend the license as required with other EULA notes -->
<WixVariable Id="WixUILicenseRtf" Value="license.rtf"/>
<!-- Setup background images -->
<WixVariable Id="WixUIBannerBmp" Value="$(var.SOURCE_DIR)\win32\bannrbmp.bmp"/>
<WixVariable Id="WixUIDialogBmp" Value="$(var.SOURCE_DIR)\win32\dlgbmp.bmp"/>
<WixVariable Id="WixUIBannerBmp" Value="bannrbmp.bmp"/>
<WixVariable Id="WixUIDialogBmp" Value="dlgbmp.bmp"/>
<!-- Links in info -->
<Property Id="ARPHELPLINK" Value="http://www.opensc-project.org/opensc/wiki/ReportingBugs"/>
<Property Id="ARPURLINFOABOUT" Value="http://www.opensc-project.org/"/>

63
win32/customactions.c Normal file
View File

@ -0,0 +1,63 @@
/*
* opensc-setup-custom-action.c: OpenSC setup custom action
*
* Copyright (C) 2015 vincent.letoux@mysmartlogon.com
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*
* This module requires the WIX SDK to build.
*/
#include "config.h"
#ifdef ENABLE_MINIDRIVER
#ifdef _MANAGED
#pragma managed(push, off)
#endif
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
// WiX Header Files:
#include <wcautil.h>
// first version - do nothing - see if it can compile
// DllMain - Initialize and cleanup WiX custom action utils.
BOOL APIENTRY DllMain(
__in HINSTANCE hInst,
__in ULONG ulReason,
__in LPVOID
)
{
switch(ulReason)
{
case DLL_PROCESS_ATTACH:
WcaGlobalInitialize(hInst);
break;
case DLL_PROCESS_DETACH:
WcaGlobalFinalize();
break;
}
return TRUE;
}
#endif

View File