From 05da9c936238c2c4ad0436f0825b44af9b328b04 Mon Sep 17 00:00:00 2001 From: Raul Metsma Date: Tue, 3 Dec 2024 23:48:45 +0200 Subject: [PATCH] Build Wix 5 CustomAction Signed-off-by: Raul Metsma --- .appveyor.yml | 4 ++++ .github/workflows/windows.yml | 3 +++ win32/Make.rules.mak | 20 +++++++++++++++----- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index bbc0aee6a2..c9eba9dd31 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -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%" diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 2eca9bff47..8ca9521536 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -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 diff --git a/win32/Make.rules.mak b/win32/Make.rules.mak index d9647833a5..bd2d988dd0 100644 --- a/win32/Make.rules.mak +++ b/win32/Make.rules.mak @@ -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 @@ -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) @@ -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 $<