Skip to content

Commit

Permalink
Build Wix 5 CustomAction
Browse files Browse the repository at this point in the history
Signed-off-by: Raul Metsma <raul@metsma.ee>
  • Loading branch information
metsma committed Dec 13, 2024
1 parent d2126a4 commit 05da9c9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ install:
- dotnet tool install -g --version 5.0.2 wix
- wix extension add -g WixToolset.UI.wixext/5.0.2
- wix extension add -g WixToolset.Util.wixext/5.0.2
- cd win32
- dotnet new console --force --name CustomAction
- dotnet add CustomAction package WixToolset.WcaUtil --version 5.0.2 --package-directory packages
- cd ..

build_script:
- echo "Using %APPVEYOR_BUILD_WORKER_IMAGE% with %VCVARSALL%"
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ jobs:
dotnet tool install -g --version 5.0.2 wix
wix extension add -g WixToolset.UI.wixext/5.0.2
wix extension add -g WixToolset.Util.wixext/5.0.2
cd win32
dotnet new console --force --name CustomAction
dotnet add CustomAction package WixToolset.WcaUtil --version 5.0.2 --package-directory packages
- name: Restore Cache
if: matrix.configuration == 'Release'
uses: actions/cache@v4
Expand Down
20 changes: 15 additions & 5 deletions win32/Make.rules.mak
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,19 @@ OPENSC_FEATURES = pcsc
#Include support for minidriver
MINIDRIVER_DEF = /DENABLE_MINIDRIVER

#Build MSI with the Windows Installer XML (WIX) toolkit, requires WIX >= 3.14
WIX_INCL_DIR = "/I$(WIX)\SDK\VS2017\inc"
WIX_LIBS = "$(WIX)\SDK\VS2017\lib\$(PLATFORM)\dutil.lib" "$(WIX)\SDK\VS2017\lib\$(PLATFORM)\wcautil.lib"
#Build MSI with the Windows Installer XML (WIX) toolkit
#dotnet tool install -g --version 5.0.2 wix
#wix extension add -g WixToolset.UI.wixext/5.0.2
#wix extension add -g WixToolset.Util.wixext/5.0.2
#dotnet new console --force --name CustomAction
#dotnet add CustomAction package WixToolset.WcaUtil --version 5.0.2 --package-directory packages
!IF "$(WIX_PACKAGES)" == ""
WIX_PACKAGES = $(TOPDIR)\win32\packages
!ENDIF
WIX_INCL_DIR = "/I$(WIX_PACKAGES)/wixtoolset.dutil/5.0.2/build/native/include" \
"/I$(WIX_PACKAGES)/wixtoolset.wcautil/5.0.2/build/native/include"
WIX_LIBS = "$(WIX_PACKAGES)/wixtoolset.dutil/5.0.2/build/native/v14/$(PLATFORM)/dutil.lib" \
"$(WIX_PACKAGES)/wixtoolset.wcautil/5.0.2/build/native/v14/$(PLATFORM)/wcautil.lib"

# We do not build tests on windows
#TESTS_DEF = /DENABLE_TESTS
Expand Down Expand Up @@ -113,7 +123,7 @@ CPDK_INCL_DIR = "/IC:\Program Files (x86)\Windows Kits\10\Cryptographic Provider
COPTS = /nologo /Zi /GS /W3 /WX /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_WARNINGS /DHAVE_CONFIG_H \
/DWINVER=0x0601 /D_WIN32_WINNT=0x0601 /DWIN32_LEAN_AND_MEAN /DOPENSC_FEATURES="\"$(OPENSC_FEATURES)\"" \
$(DEBUG_DEF) $(OPENPACE_DEF) $(OPENSSL_DEF) $(ZLIB_DEF) $(MINIDRIVER_DEF) $(SM_DEF) $(TESTS_DEF) $(OPENSSL_EXTRA_CFLAGS) \
/I$(TOPDIR)\win32 /I$(TOPDIR)\src $(OPENPACE_INCL_DIR) $(OPENSSL_INCL_DIR) $(ZLIB_INCL_DIR) $(CPDK_INCL_DIR) $(WIX_INCL_DIR)
/I$(TOPDIR)\win32 /I$(TOPDIR)\src $(OPENPACE_INCL_DIR) $(OPENSSL_INCL_DIR) $(ZLIB_INCL_DIR) $(CPDK_INCL_DIR)
LINKFLAGS = /nologo /machine:$(PLATFORM) /INCREMENTAL:NO /NXCOMPAT /DYNAMICBASE /DEBUG /NODEFAULTLIB:MSVCRT /NODEFAULTLIB:MSVCRTD
LIBFLAGS = /nologo /machine:$(PLATFORM)
WIXFLAGS = -arch $(PLATFORM) $(WIXFLAGS)
Expand All @@ -130,7 +140,7 @@ COPTS = /O1 /$(BUILD_TYPE) $(COPTS)
cl $(COPTS) /c $<

.cpp.obj::
cl $(COPTS) /c $<
cl $(COPTS) $(WIX_INCL_DIR) /c $<

.rc.res::
rc /l 0x0409 $<
Expand Down

0 comments on commit 05da9c9

Please sign in to comment.