Skip to content

Commit

Permalink
Convert to Wix 5
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 4, 2024
1 parent d464599 commit 250f40c
Show file tree
Hide file tree
Showing 5 changed files with 214 additions and 420 deletions.
19 changes: 8 additions & 11 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,12 @@ environment:
OPENPACE_VER: 1.1.3
ZLIB_VER_DOT: 1.2.12
matrix:
# not compatible with OpenSSL 1.1.1:
# - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
# VCVARSALL: "%VS120COMNTOOLS%/../../VC/vcvarsall.bat"
#- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
#VCVARSALL: "%VS140COMNTOOLS%/../../VC/vcvarsall.bat"
#DO_PUSH_ARTIFACT: yes
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
VCVARSALL: "%ProgramFiles(x86)%/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvarsall.bat"
#- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# VCVARSALL: "%ProgramFiles(x86)%/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvarsall.bat"
# DO_PUSH_ARTIFACT: yes
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
VCVARSALL: "%ProgramFiles(x86)%/Microsoft Visual Studio/2019/Community/VC/Auxiliary/Build/vcvarsall.bat"
DO_PUSH_ARTIFACT: yes
# not compatible with WiX 3.11.2:
# - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
# VCVARSALL: "%ProgramFiles(x86)%/Microsoft Visual Studio/2019/Community/VC/Auxiliary/Build/vcvarsall.bat"

install:
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
Expand Down Expand Up @@ -68,6 +62,9 @@ install:
- cpdksetup.exe /quiet
- uname -a
- set
- 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

build_script:
- ps: >-
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ jobs:
vcpkgArguments: zlib openssl
vcpkgGitCommitId: 511d74f695bd45959d12b50b00f1b68f69e8f0b0
vcpkgTriplet: ${{ matrix.platform }}-windows-static
- name: Install WIX
run: |
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
- name: Restore Cache
if: matrix.configuration == 'Release'
uses: actions/cache@v4
Expand Down
24 changes: 13 additions & 11 deletions win32/Make.rules.mak
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,25 @@ OPENSSL_STATIC_DIR = static
!IF "$(OPENSSL_LIB)" == ""
!IF "$(DEBUG_DEF)" == "/DDEBUG"
!IF "$(PLATFORM)" == "x86"
OPENSSL_LIB = $(OPENSSL_DIR)\lib\VC\$(OPENSSL_STATIC_DIR)\libcrypto32MTd.lib
OPENSSL_LIB = libcrypto32MTd.lib
!ELSE
OPENSSL_LIB = $(OPENSSL_DIR)\lib\VC\$(OPENSSL_STATIC_DIR)\libcrypto64MTd.lib
OPENSSL_LIB = libcrypto64MTd.lib
!ENDIF
!ELSE
!IF "$(PLATFORM)" == "x86"
OPENSSL_LIB = $(OPENSSL_DIR)\lib\VC\$(OPENSSL_STATIC_DIR)\libcrypto32MT.lib
OPENSSL_LIB = libcrypto32MT.lib
!ELSE
OPENSSL_LIB = $(OPENSSL_DIR)\lib\VC\$(OPENSSL_STATIC_DIR)\libcrypto64MT.lib
OPENSSL_LIB = libcrypto64MT.lib
!ENDIF
!ENDIF
OPENSSL_LIB = $(OPENSSL_DIR)\lib\VC\$(OPENSSL_STATIC_DIR)\$(OPENSSL_LIB)
!ENDIF
OPENSSL_LIB = $(OPENSSL_LIB) user32.lib advapi32.lib crypt32.lib ws2_32.lib

PROGRAMS_OPENSSL = cryptoflex-tool.exe pkcs15-init.exe netkey-tool.exe piv-tool.exe \
westcos-tool.exe sc-hsm-tool.exe dnie-tool.exe gids-tool.exe
OPENSC_FEATURES = $(OPENSC_FEATURES) openssl
CANDLEFLAGS = -dOpenSSL="$(OPENSSL_DIR)" $(CANDLEFLAGS)
WIXFLAGS = -d OpenSSL="$(OPENSSL_DIR)" $(WIXFLAGS)
!ENDIF


Expand All @@ -82,7 +83,7 @@ ZLIB_INCL_DIR = /IC:\zlib-dll\include
ZLIB_LIB = C:\zlib-dll\lib\zdll.lib
!ENDIF
OPENSC_FEATURES = $(OPENSC_FEATURES) zlib
CANDLEFLAGS = -dzlib="C:\zlib-dll" $(CANDLEFLAGS)
WIXFLAGS = -d zlib="C:\zlib-dll" $(WIXFLAGS)
!ENDIF


Expand All @@ -102,19 +103,20 @@ OPENPACE_LIB = $(OPENPACE_DIR)\src\libeac.lib
# Build only when OpenPACE and OpenSSL are available
PROGRAMS_OPENPACE = npa-tool.exe
!ENDIF
CANDLEFLAGS = -dOpenPACE="$(OPENPACE_DIR)" $(CANDLEFLAGS)
WIXFLAGS = -d OpenPACE="$(OPENPACE_DIR)" $(WIXFLAGS)
!ENDIF


# Used for MiniDriver
CPDK_INCL_DIR = "/IC:\Program Files (x86)\Windows Kits\10\Cryptographic Provider Development Kit\Include"

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)\""
COPTS = $(COPTS) $(DEBUG_DEF) $(OPENPACE_DEF) $(OPENSSL_DEF) $(ZLIB_DEF) $(MINIDRIVER_DEF) $(SM_DEF) $(TESTS_DEF) $(OPENSSL_EXTRA_CFLAGS)
COPTS = $(COPTS) /I$(TOPDIR)\win32 /I$(TOPDIR)\src $(OPENPACE_INCL_DIR) $(OPENSSL_INCL_DIR) $(ZLIB_INCL_DIR) $(CPDK_INCL_DIR) $(WIX_INCL_DIR)
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) \
$(COPTS) /I$(TOPDIR)\win32 /I$(TOPDIR)\src $(OPENPACE_INCL_DIR) $(OPENSSL_INCL_DIR) $(ZLIB_INCL_DIR) $(CPDK_INCL_DIR) $(WIX_INCL_DIR)
LINKFLAGS = /nologo /machine:$(PLATFORM) /INCREMENTAL:NO /NXCOMPAT /DYNAMICBASE /DEBUG /NODEFAULTLIB:MSVCRT /NODEFAULTLIB:MSVCRTD
LIBFLAGS = /nologo /machine:$(PLATFORM)
CANDLEFLAGS = -arch $(PLATFORM) $(CANDLEFLAGS)
WIXFLAGS = -arch $(PLATFORM) $(WIXFLAGS)

!IF "$(DEBUG_DEF)" == "/DDEBUG"
LINKFLAGS = $(LINKFLAGS) /NODEFAULTLIB:LIBCMT
Expand Down
7 changes: 2 additions & 5 deletions win32/Makefile.mak
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@ customactions.dll: versioninfo-customactions.res customactions.obj
type customactions.exports >> $*.def
link /dll $(LINKFLAGS) /def:$*.def /out:customactions.dll versioninfo-customactions.res customactions.obj msi.lib $(WIX_LIBS) Advapi32.lib User32.lib Version.lib Shell32.lib

OpenSC.msi: OpenSC.wixobj
"$(WIX)\bin\light.exe" -ext WixUIExtension -ext WiXUtilExtension $?

OpenSC.wixobj: OpenSC.wxs customactions.dll
"$(WIX)\bin\candle.exe" -ext WiXUtilExtension -dSOURCE_DIR=$(TOPDIR) $(CANDLEFLAGS) OpenSC.wxs
OpenSC.msi: OpenSC.wxs customactions.dll
wix build -ext WixToolset.UI.wixext -ext WixToolset.Util.wixext -d SOURCE_DIR=$(TOPDIR) $(WIXFLAGS) OpenSC.wxs

clean::
del /Q config.h *.msi *.wixobj *.wixpdb
Loading

0 comments on commit 250f40c

Please sign in to comment.