diff --git a/.appveyor.yml b/.appveyor.yml
deleted file mode 100644
index bce960249f..0000000000
--- a/.appveyor.yml
+++ /dev/null
@@ -1,133 +0,0 @@
-version: 0.26.0.{build}
-
-platform:
- - x86
- - x64
-
-configuration:
- - Release
- - Light
-
-environment:
- GH_TOKEN:
- secure: jeReA6BNx/dXVMGfroKadgE9ByKAE/tAGcb2z+dIVZGAN29X1Pu22wi1TuVOy9ZugqBzjvFV4knwHJSGi0+U6Yj1fTfa2CYpeCBym4JOXqPis/GpKfSeBV9IrmJGT/Av
- PATH: C:\cygwin\bin;%PATH%
- 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"
- # 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 `
- https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
- Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
- throw "There are newer queued builds for this pull request, failing early." }
- - date /T & time /T
- - ps: $env:PACKAGE_NAME=(git describe --tags --abbrev=0)
- - ps: >-
- If ($env:Platform -Match "x86") {
- $env:OPENSSL_PF="Win32"
- $env:ARTIFACT="OpenSC-${env:PACKAGE_NAME}_win32"
- } Else {
- $env:OPENSSL_PF="Win64"
- $env:ARTIFACT="OpenSC-${env:PACKAGE_NAME}_win64"
- }
- - ps: >-
- If ($env:Configuration -Like "*Light*") {
- $env:ARTIFACT+="-Light"
- } Else {
- $env:NMAKE_EXTRA+=" OPENSSL_DEF=/DENABLE_OPENSSL OPENSSL_DIR=C:\OpenSSL-v111-${env:OPENSSL_PF}"
- $env:NMAKE_EXTRA+=" OPENSSL_EXTRA_CFLAGS=/DOPENSSL_SECURE_MALLOC_SIZE=65536"
- If (!(Test-Path C:\zlib )) {
- appveyor DownloadFile "https://github.com/madler/zlib/archive/v${env:ZLIB_VER_DOT}.zip" -FileName zlib.zip
- 7z x zlib.zip -oC:\
- Rename-Item -path "c:\zlib-${env:ZLIB_VER_DOT}" -newName "zlib"
- }
- If (!(Test-Path C:\openpace )) {
- appveyor DownloadFile "https://github.com/frankmorgner/openpace/archive/${env:OPENPACE_VER}.zip" -FileName openpace.zip
- 7z x openpace.zip -oC:\
- Rename-Item -path "c:\openpace-${env:OPENPACE_VER}" -newName "openpace"
- }
- }
- If (!(Test-Path cpdksetup.exe )) {
- appveyor DownloadFile "https://download.microsoft.com/download/1/7/6/176909B0-50F2-4DF3-B29B-830A17EA7E38/CPDK_RELEASE_UPDATE/cpdksetup.exe"
- }
- - echo "Using %APPVEYOR_BUILD_WORKER_IMAGE% with %VCVARSALL%"
- - call "%VCVARSALL%" %Platform%
- - cpdksetup.exe /quiet
- - uname -a
- - set
-
-build_script:
- - ps: >-
- if (!($env:Configuration -Like "*Light*")) {
- If (!(Test-Path -Path "C:\zlib-${env:OPENSSL_PF}" )) {
- # build zlib.lib as a static library
- xcopy C:\zlib C:\zlib-${env:OPENSSL_PF} /e /i /y /s
- cd C:\zlib-${env:OPENSSL_PF}
- (Get-Content win32/Makefile.msc).replace('-MD', '-MT') | Set-Content win32/Makefile.msc
- nmake /nologo -f win32/Makefile.msc zlib.lib
- }
- $env:NMAKE_EXTRA+=" ZLIBSTATIC_DEF=/DENABLE_ZLIB_STATIC ZLIB_INCL_DIR=/IC:\zlib-${env:OPENSSL_PF} ZLIB_LIB=C:\zlib-${env:OPENSSL_PF}\zlib.lib"
- If (!(Test-Path -Path "C:\openpace-${env:OPENSSL_PF}" )) {
- # build libeac.lib as a static library
- xcopy C:\openpace C:\openpace-${env:OPENSSL_PF} /e /i /y /s
- cd C:\openpace-${env:OPENSSL_PF}\src
- # OpenSSL 1.1.0
- #cl /nologo /IC:\OpenSSL-v110-${env:OPENSSL_PF}\include /I. /DX509DIR=\`"/\`" /DCVCDIR=\`"/\`" /W3 /D_CRT_SECURE_NO_DEPRECATE /DWIN32_LEAN_AND_MEAN /GS /MT /DHAVE_ASN1_STRING_GET0_DATA=1 /DHAVE_DECL_OPENSSL_ZALLOC=1 /DHAVE_DH_GET0_KEY=1 /DHAVE_DH_GET0_PQG=1 /DHAVE_DH_SET0_KEY=1 /DHAVE_DH_SET0_PQG=1 /DHAVE_ECDSA_SIG_GET0=1 /DHAVE_ECDSA_SIG_SET0=1 /DHAVE_EC_KEY_METHOD=1 /DHAVE_RSA_GET0_KEY=1 /DHAVE_RSA_SET0_KEY=1 /c ca_lib.c cv_cert.c cvc_lookup.c x509_lookup.c eac_asn1.c eac.c eac_ca.c eac_dh.c eac_ecdh.c eac_kdf.c eac_lib.c eac_print.c eac_util.c misc.c pace.c pace_lib.c pace_mappings.c ri.c ri_lib.c ta.c ta_lib.c objects.c ssl_compat.c
- # OpenSSL 1.1.1
- cl /nologo /IC:\OpenSSL-v111-${env:OPENSSL_PF}\include /I. /DX509DIR=\`"/\`" /DCVCDIR=\`"/\`" /W3 /D_CRT_SECURE_NO_DEPRECATE /DWIN32_LEAN_AND_MEAN /GS /MT /DHAVE_ASN1_STRING_GET0_DATA=1 /DHAVE_DECL_OPENSSL_ZALLOC=1 /DHAVE_DH_GET0_KEY=1 /DHAVE_DH_GET0_PQG=1 /DHAVE_DH_SET0_KEY=1 /DHAVE_DH_SET0_PQG=1 /DHAVE_ECDSA_SIG_GET0=1 /DHAVE_ECDSA_SIG_SET0=1 /DHAVE_EC_KEY_METHOD=1 /DHAVE_RSA_GET0_KEY=1 /DHAVE_RSA_SET0_KEY=1 /DHAVE_EC_POINT_GET_AFFINE_COORDINATES=1 /DHAVE_EC_POINT_SET_AFFINE_COORDINATES=1 /c ca_lib.c cv_cert.c cvc_lookup.c x509_lookup.c eac_asn1.c eac.c eac_ca.c eac_dh.c eac_ecdh.c eac_kdf.c eac_lib.c eac_print.c eac_util.c misc.c pace.c pace_lib.c pace_mappings.c ri.c ri_lib.c ta.c ta_lib.c objects.c ssl_compat.c
- # OpenSSL 1.0.2
- #cl /nologo /IC:\OpenSSL-${env:OPENSSL_PF}\include /I. /DX509DIR=\`"/\`" /DCVCDIR=\`"/\`" /W3 /D_CRT_SECURE_NO_DEPRECATE /DWIN32_LEAN_AND_MEAN /GS /MT /c ca_lib.c cv_cert.c cvc_lookup.c x509_lookup.c eac_asn1.c eac.c eac_ca.c eac_dh.c eac_ecdh.c eac_kdf.c eac_lib.c eac_print.c eac_util.c misc.c pace.c pace_lib.c pace_mappings.c ri.c ri_lib.c ta.c ta_lib.c objects.c ssl_compat.c
- lib /nologo /out:libeac.lib ca_lib.obj cv_cert.obj cvc_lookup.obj x509_lookup.obj eac_asn1.obj eac.obj eac_ca.obj eac_dh.obj eac_ecdh.obj eac_kdf.obj eac_lib.obj eac_print.obj eac_util.obj misc.obj pace.obj pace_lib.obj pace_mappings.obj ri.obj ri_lib.obj ta.obj ta_lib.obj objects.obj ssl_compat.obj
- cd ${env:APPVEYOR_BUILD_FOLDER}
- }
- $env:NMAKE_EXTRA+=" OPENPACE_DEF=/DENABLE_OPENPACE OPENPACE_DIR=C:\openpace-${env:OPENSSL_PF}"
- }
- - bash -c "exec 0-
- Get-ChildItem -recurse ${env:APPVEYOR_BUILD_FOLDER} -exclude vc*.pdb *.pdb | % {
- 7z a -tzip ${env:ARTIFACT}-Debug.zip $_.FullName
- }
- - appveyor PushArtifact %ARTIFACT%.msi
- - appveyor PushArtifact %ARTIFACT%-Debug.zip
- # keep in sync with .travis.yml
- - bash -c "git config --global user.email 'no-reply@appveyor.com'"
- - bash -c "git config --global user.name 'AppVeyor'"
- - bash -c "if [ \"$DO_PUSH_ARTIFACT\" = yes -a -z \"$APPVEYOR_PULL_REQUEST_NUMBER\" -a \"$APPVEYOR_REPO_NAME\" = \"OpenSC/OpenSC\" ]; then .github/push_artifacts.sh \"AppVeyor build ${APPVEYOR_BUILD_NUMBER}.${APPVEYOR_JOB_NUMBER}\"; fi"
-
-deploy:
-- provider: Webhook
- url: https://app.signpath.io/API/v1/8d2463fe-39bd-4a41-bb72-f008b4b1fe17/Integrations/AppVeyor?ProjectSlug=OpenSC&SigningPolicySlug=release-signing&ArtifactConfigurationSlug=initial
- authorization:
- secure: 73Qvk9MbD7M7ZcoO6NnSH7zDA+9wSKZqNc602b1UeA5v6GsDyEvpCOlzJ9VvBcUuePTKBRsZ+uGQYKsddABgQA==
-
-cache:
- - C:\zlib -> .appveyor.yml
- - C:\zlib-Win32 -> .appveyor.yml
- - C:\zlib-Win64 -> .appveyor.yml
- - C:\openpace -> .appveyor.yml
- - C:\openpace-Win32 -> .appveyor.yml
- - C:\openpace-Win64 -> .appveyor.yml
- - cpdksetup.exe -> .appveyor.yml
diff --git a/.github/workflows/cifuzz.yml b/.github/workflows/disabled/cifuzz.yml
similarity index 100%
rename from .github/workflows/cifuzz.yml
rename to .github/workflows/disabled/cifuzz.yml
diff --git a/.github/workflows/codeql.yml b/.github/workflows/disabled/codeql.yml
similarity index 100%
rename from .github/workflows/codeql.yml
rename to .github/workflows/disabled/codeql.yml
diff --git a/.github/workflows/codespell.yml b/.github/workflows/disabled/codespell.yml
similarity index 100%
rename from .github/workflows/codespell.yml
rename to .github/workflows/disabled/codespell.yml
diff --git a/.github/workflows/coverity.yml b/.github/workflows/disabled/coverity.yml
similarity index 100%
rename from .github/workflows/coverity.yml
rename to .github/workflows/disabled/coverity.yml
diff --git a/.github/workflows/doc.yml b/.github/workflows/disabled/doc.yml
similarity index 100%
rename from .github/workflows/doc.yml
rename to .github/workflows/disabled/doc.yml
diff --git a/.github/workflows/fedora.yml b/.github/workflows/disabled/fedora.yml
similarity index 100%
rename from .github/workflows/fedora.yml
rename to .github/workflows/disabled/fedora.yml
diff --git a/.github/workflows/formatter.yml b/.github/workflows/disabled/formatter.yml
similarity index 100%
rename from .github/workflows/formatter.yml
rename to .github/workflows/disabled/formatter.yml
diff --git a/.github/workflows/linux-strict.yml b/.github/workflows/disabled/linux-strict.yml
similarity index 100%
rename from .github/workflows/linux-strict.yml
rename to .github/workflows/disabled/linux-strict.yml
diff --git a/.github/workflows/linux.yml b/.github/workflows/disabled/linux.yml
similarity index 100%
rename from .github/workflows/linux.yml
rename to .github/workflows/disabled/linux.yml
diff --git a/.github/workflows/macos.yml b/.github/workflows/disabled/macos.yml
similarity index 100%
rename from .github/workflows/macos.yml
rename to .github/workflows/disabled/macos.yml
diff --git a/.github/workflows/packit.yaml b/.github/workflows/disabled/packit.yaml
similarity index 100%
rename from .github/workflows/packit.yaml
rename to .github/workflows/disabled/packit.yaml
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml
new file mode 100644
index 0000000000..96927a3bf6
--- /dev/null
+++ b/.github/workflows/windows.yml
@@ -0,0 +1,127 @@
+name: Windows
+
+on:
+ pull_request:
+ paths:
+ - '**.c'
+ - '**.h'
+ - '**.sh'
+ - .github/workflows/windows.yml
+ - '**.am'
+ - doc/**
+ - configure.ac
+ push:
+
+permissions:
+ contents: read # to fetch code (actions/checkout)
+
+jobs:
+ build:
+ runs-on: ${{ matrix.image }}
+ strategy:
+ matrix:
+ platform: [x86, x64]
+ configuration: [Light, Release]
+ image: [windows-2022]
+ env:
+ OPENPACE_VER: 1.1.3
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ - name: Git describe
+ id: ghd
+ uses: proudust/gh-describe@v2
+ - name: Package name
+ shell: bash
+ run: |
+ echo PACKAGE_NAME=OpenSC-${{ steps.ghd.outputs.tag }} >> $GITHUB_ENV
+ echo ARTIFACT=OpenSC-${{ steps.ghd.outputs.tag }}_${{ matrix.platform == 'x86' && 'win32' || 'win64' }}${{ matrix.configuration == 'Light' && '-Light' || '' }} >> $GITHUB_ENV
+ - name: Install CPDK
+ run: choco install windows-cryptographic-provider-development-kit -y > $null
+ - name: Install autotools
+ uses: msys2/setup-msys2@v2
+ with:
+ update: true
+ install: autotools mingw-w64-x86_64-pkg-config
+ - name: Bootstrap
+ shell: msys2 {0}
+ run: |
+ if [[ "${{ github.event_name }}" == "push" ]]; then
+ if [[ "${{ github.ref_name }}" == "master" ]]; then
+ ./bootstrap
+ else
+ ./bootstrap.ci -s "-${{ github.ref_name }}"
+ fi
+ elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
+ if [[ "${{ github.base_ref }}" == "master" ]]; then
+ ./bootstrap.ci -s "-pr${{ github.event.number }}"
+ else
+ ./bootstrap.ci -s "-${{ github.base_ref }}-pr${{ github.event.number }}"
+ fi
+ fi
+ - name: Configure
+ shell: bash
+ run: ./configure --disable-openssl --disable-readline --disable-zlib || cat config.log
+ - name: Setup dev env
+ uses: ilammy/msvc-dev-cmd@v1
+ with:
+ arch: ${{ matrix.platform }}
+ - name: Prepare vcpkg
+ if: matrix.configuration == 'Release'
+ uses: lukka/run-vcpkg@v7
+ with:
+ vcpkgArguments: zlib openssl
+ vcpkgGitCommitId: 18b028fe785e707265fa0e35590b7537ae1d12ea
+ vcpkgTriplet: ${{ matrix.platform }}-windows-static
+ - name: Restore Cache
+ if: matrix.configuration == 'Release'
+ uses: actions/cache@v4
+ id: cache
+ with:
+ path: openpace-${{ env.OPENPACE_VER }}
+ key: OpenPACE-${{ env.OPENPACE_VER }}-${{ runner.os }}-${{ matrix.platform }}
+ - name: Build OpenPACE
+ if: matrix.configuration == 'Release' && steps.cache.outputs.cache-hit != 'true'
+ run: |
+ Invoke-WebRequest "https://github.com/frankmorgner/openpace/archive/${env:OPENPACE_VER}.zip" -OutFile openpace.zip
+ tar xf openpace.zip
+ cd openpace-${env:OPENPACE_VER}\src
+ cl /nologo /O1 /Zi /W3 /GS /MT /I${env:RUNVCPKG_VCPKG_ROOT}\installed\${env:RUNVCPKG_VCPKG_TRIPLET}\include /I. `
+ /DX509DIR=`"/`" /DCVCDIR=`"/`" /D_CRT_SECURE_NO_DEPRECATE /DWIN32_LEAN_AND_MEAN `
+ /DHAVE_ASN1_STRING_GET0_DATA /DHAVE_DECL_OPENSSL_ZALLOC /DHAVE_DH_GET0_KEY /DHAVE_DH_GET0_PQG `
+ /DHAVE_DH_SET0_KEY /DHAVE_DH_SET0_PQG /DHAVE_ECDSA_SIG_GET0 /DHAVE_ECDSA_SIG_SET0 `
+ /DHAVE_EC_KEY_METHOD /DHAVE_RSA_GET0_KEY /DHAVE_RSA_SET0_KEY /DHAVE_EC_POINT_GET_AFFINE_COORDINATES `
+ /DHAVE_EC_POINT_SET_AFFINE_COORDINATES /DHAVE_EVP_PKEY_DUP /c `
+ ca_lib.c cv_cert.c cvc_lookup.c x509_lookup.c eac_asn1.c eac.c eac_ca.c eac_dh.c `
+ eac_ecdh.c eac_kdf.c eac_lib.c eac_print.c eac_util.c misc.c pace.c pace_lib.c `
+ pace_mappings.c ri.c ri_lib.c ta.c ta_lib.c objects.c ssl_compat.c
+ lib /nologo /machine:${{ matrix.platform }} /out:libeac.lib `
+ ca_lib.obj cv_cert.obj cvc_lookup.obj x509_lookup.obj eac_asn1.obj eac.obj eac_ca.obj eac_dh.obj `
+ eac_ecdh.obj eac_kdf.obj eac_lib.obj eac_print.obj eac_util.obj misc.obj pace.obj pace_lib.obj `
+ pace_mappings.obj ri.obj ri_lib.obj ta.obj ta_lib.obj objects.obj ssl_compat.obj
+ - name: Set NMake Variables
+ if: matrix.configuration == 'Release'
+ run: |
+ $VCPKG_DIR="${env:RUNVCPKG_VCPKG_ROOT}\installed\${env:RUNVCPKG_VCPKG_TRIPLET}"
+ $NMAKE_EXTRA="ZLIBSTATIC_DEF=/DENABLE_ZLIB_STATIC ZLIB_INCL_DIR=/I${VCPKG_DIR}\include ZLIB_LIB=${VCPKG_DIR}\lib\zlib.lib"
+ $NMAKE_EXTRA+=" OPENSSL_DEF=/DENABLE_OPENSSL OPENSSL_DIR=${VCPKG_DIR} OPENSSL_LIB=${VCPKG_DIR}\lib\libcrypto.lib OPENSSL_EXTRA_CFLAGS=/DOPENSSL_SECURE_MALLOC_SIZE=65536"
+ $NMAKE_EXTRA+=" OPENPACE_DEF=/DENABLE_OPENPACE OPENPACE_DIR=${env:GITHUB_WORKSPACE}\openpace-${env:OPENPACE_VER}"
+ echo "NMAKE_EXTRA=$NMAKE_EXTRA" >> $env:GITHUB_ENV
+ - name: Build OpenSC
+ run: nmake /f Makefile.mak ${{ env.NMAKE_EXTRA }}
+ - name: Build Installer
+ run: |
+ cd win32 && nmake /nologo /f Makefile.mak ${{ env.NMAKE_EXTRA }} OpenSC.msi
+ move OpenSC.msi "..\\OpenSC-${env:ARTIFACT}.msi"
+ - name: Debug symbols
+ run: |
+ Get-ChildItem -recurse . -exclude vc*.pdb *.pdb | % {
+ 7z a -tzip ${env:ARTIFACT}-Debug.zip $_.FullName
+ }
+ - name: Archive artifacts
+ uses: actions/upload-artifact@v4
+ with:
+ name: msi_${{ matrix.platform }}_${{ matrix.configuration }}
+ path: |
+ ./*.msi
+ ./*-Debug.zip
diff --git a/Makefile.mak b/Makefile.mak
index 9489a5ccad..d7ca64e585 100644
--- a/Makefile.mak
+++ b/Makefile.mak
@@ -2,16 +2,6 @@ SUBDIRS = etc win32 src
default: all
-32:
- CALL "C:\Program Files\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
- $(MAKE) /f Makefile.mak opensc.msi PLATFORM=x86 OPENPACE_DIR=C:\openpace-Win32_1.0.2
- MOVE win32\OpenSC.msi OpenSC_win32.msi
-
-64:
- CALL "C:\Program Files\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64
- $(MAKE) /f Makefile.mak opensc.msi OPENPACE_DIR=C:\openpace-Win64_1.0.2
- MOVE win32\OpenSC.msi OpenSC_win64.msi
-
opensc.msi:
$(MAKE) /f Makefile.mak all OPENSSL_DEF=/DENABLE_OPENSSL OPENPACE_DEF=/DENABLE_OPENPACE"
@cmd /c "cd win32 && $(MAKE) /nologo /f Makefile.mak opensc.msi OPENSSL_DEF=/DENABLE_OPENSSL OPENPACE_DEF=/DENABLE_OPENPACE"
diff --git a/win32/Make.rules.mak b/win32/Make.rules.mak
index 5948d9779a..980a2a344f 100644
--- a/win32/Make.rules.mak
+++ b/win32/Make.rules.mak
@@ -3,28 +3,9 @@ OPENSC_FEATURES = pcsc
#Include support for minidriver
MINIDRIVER_DEF = /DENABLE_MINIDRIVER
-#Build MSI with the Windows Installer XML (WIX) toolkit, requires WIX >= 3.9
-!IF "$(WIX)" == ""
-# at least WiX 3.11 sets the WIX environment variable to its path
-WIX = C:\Program Files\WiX Toolset v3.10
-!ENDIF
-!IF "$(DEVENVDIR)" == "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\" || "$(DEVENVDIR)" == "C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\"
-WIXVSVER = VS2010
-!ENDIF
-!IF "$(VISUALSTUDIOVERSION)" == "12.0"
-WIXVSVER = VS2013
-!ENDIF
-!IF "$(VISUALSTUDIOVERSION)" == "14.0"
-WIXVSVER = VS2015
-!ENDIF
-!IF "$(VISUALSTUDIOVERSION)" == "15.0"
-WIXVSVER = VS2017
-!ENDIF
-!IF "$(VISUALSTUDIOVERSION)" == "16.0"
-WIXVSVER = VS2019
-!ENDIF
-WIX_INCL_DIR = "/I$(WIX)\SDK\$(WIXVSVER)\inc"
-WIX_LIBS = "$(WIX)\SDK\$(WIXVSVER)\lib\$(PLATFORM)\dutil.lib" "$(WIX)\SDK\$(WIXVSVER)\lib\$(PLATFORM)\wcautil.lib"
+#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"
# We do not build tests on windows
#TESTS_DEF = /DENABLE_TESTS
@@ -54,31 +35,22 @@ OPENSSL_INCL_DIR = /I$(OPENSSL_DIR)\include
#define OPENSSL_STATIC if you have visual studio compatible with OpenSSL's static binaries
OPENSSL_STATIC_DIR = static
+!IF "$(OPENSSL_LIB)" == ""
!IF "$(DEBUG_DEF)" == "/DDEBUG"
!IF "$(PLATFORM)" == "x86"
-# OpenSSL 1.0.2
-#OPENSSL_LIB = $(OPENSSL_DIR)\lib\VC\$(OPENSSL_STATIC_DIR)\libeay32MTd.lib user32.lib advapi32.lib crypt32.lib ws2_32.lib
-# OpenSSL 1.1.0
-OPENSSL_LIB = $(OPENSSL_DIR)\lib\VC\$(OPENSSL_STATIC_DIR)\libcrypto32MTd.lib user32.lib advapi32.lib crypt32.lib ws2_32.lib
+OPENSSL_LIB = $(OPENSSL_DIR)\lib\VC\$(OPENSSL_STATIC_DIR)\libcrypto32MTd.lib
!ELSE
-# OpenSSL 1.0.2
-#OPENSSL_LIB = $(OPENSSL_DIR)\lib\VC\$(OPENSSL_STATIC_DIR)\libeay32MTd.lib user32.lib advapi32.lib crypt32.lib ws2_32.lib
-# OpenSSL 1.1.0
-OPENSSL_LIB = $(OPENSSL_DIR)\lib\VC\$(OPENSSL_STATIC_DIR)\libcrypto64MTd.lib user32.lib advapi32.lib crypt32.lib ws2_32.lib
+OPENSSL_LIB = $(OPENSSL_DIR)\lib\VC\$(OPENSSL_STATIC_DIR)\libcrypto64MTd.lib
!ENDIF
!ELSE
!IF "$(PLATFORM)" == "x86"
-# OpenSSL 1.0.2
-#OPENSSL_LIB = $(OPENSSL_DIR)\lib\VC\$(OPENSSL_STATIC_DIR)\libeay32MT.lib user32.lib advapi32.lib crypt32.lib ws2_32.lib
-# OpenSSL 1.1.0
-OPENSSL_LIB = $(OPENSSL_DIR)\lib\VC\$(OPENSSL_STATIC_DIR)\libcrypto32MT.lib user32.lib advapi32.lib crypt32.lib ws2_32.lib
+OPENSSL_LIB = $(OPENSSL_DIR)\lib\VC\$(OPENSSL_STATIC_DIR)\libcrypto32MT.lib
!ELSE
-# OpenSSL 1.0.2
-#OPENSSL_LIB = $(OPENSSL_DIR)\lib\VC\$(OPENSSL_STATIC_DIR)\libeay32MT.lib user32.lib advapi32.lib crypt32.lib ws2_32.lib
-# OpenSSL 1.1.0
-OPENSSL_LIB = $(OPENSSL_DIR)\lib\VC\$(OPENSSL_STATIC_DIR)\libcrypto64MT.lib user32.lib advapi32.lib crypt32.lib ws2_32.lib
+OPENSSL_LIB = $(OPENSSL_DIR)\lib\VC\$(OPENSSL_STATIC_DIR)\libcrypto64MT.lib
!ENDIF
!ENDIF
+!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
@@ -135,45 +107,28 @@ CANDLEFLAGS = -dOpenPACE="$(OPENPACE_DIR)" $(CANDLEFLAGS)
# Used for MiniDriver
-CNGSDK_INCL_DIR = "/IC:\Program Files (x86)\Microsoft CNG Development Kit\Include"
-CPDK_INCL_DIR = "/IC:\Program Files (x86)\Windows Kits\10\Cryptographic Provider Development Kit\Include"
-!IF "$(PROCESSOR_ARCHITECTURE)" == "x86" && "$(PROCESSOR_ARCHITEW6432)" == ""
-CNGSDK_INCL_DIR = "/IC:\Program Files\Microsoft CNG Development Kit\Include"
-CPDK_INCL_DIR = "/IC:\Program Files\Windows Kits\10\Cryptographic Provider Development Kit\Include"
-!ENDIF
-# Mandatory path to 'ISO C9x compliant stdint.h and inttypes.h for Microsoft Visual Studio'
-# http://msinttypes.googlecode.com/files/msinttypes-r26.zip
-# INTTYPES_INCL_DIR = /IC:\opensc\dependencies\msys\local
+CPDK_INCL_DIR = "/IC:\Program Files (x86)\Windows Kits\10\Cryptographic Provider Development Kit\Include"
-# Code optimisation
-# O1 - minimal code size
-CODE_OPTIMIZATION = /O1
-
-ALL_INCLUDES = /I$(TOPDIR)\win32 /I$(TOPDIR)\src $(OPENPACE_INCL_DIR) $(OPENSSL_INCL_DIR) $(OPENSSL_EXTRA_CFLAGS) $(ZLIB_INCL_DIR) $(LIBLTDL_INCL) $(INTTYPES_INCL_DIR) $(CPDK_INCL_DIR) $(CNGSDK_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)\""
+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)
+LINKFLAGS = /nologo /machine:$(PLATFORM) /INCREMENTAL:NO /NXCOMPAT /DYNAMICBASE /DEBUG /NODEFAULTLIB:MSVCRT /NODEFAULTLIB:MSVCRTD
+LIBFLAGS = /nologo /machine:$(PLATFORM)
+CANDLEFLAGS = -arch $(PLATFORM) $(CANDLEFLAGS)
!IF "$(DEBUG_DEF)" == "/DDEBUG"
-LINKDEBUGFLAGS = /NODEFAULTLIB:LIBCMT /DEBUG
-CODE_OPTIMIZATION =
-COPTS = /GS /W3 /WX /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_WARNINGS /MTd /nologo /DHAVE_CONFIG_H $(ALL_INCLUDES) /DWINVER=0x0601 /D_WIN32_WINNT=0x0601 /DWIN32_LEAN_AND_MEAN $(OPENPACE_DEF) $(OPENSSL_DEF) $(ZLIB_DEF) $(MINIDRIVER_DEF) $(SM_DEF) $(TESTS_DEF) /DOPENSC_FEATURES="\"$(OPENSC_FEATURES)\"" /DDEBUG /Zi /Od
-!ELSE
-LINKDEBUGFLAGS = /NODEFAULTLIB:LIBCMTD /DEBUG /OPT:REF /OPT:ICF
-COPTS = /GS /W3 /WX /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_WARNINGS /MT /nologo /DHAVE_CONFIG_H $(ALL_INCLUDES) /DWINVER=0x0601 /D_WIN32_WINNT=0x0601 /DWIN32_LEAN_AND_MEAN $(OPENPACE_DEF) $(OPENSSL_DEF) $(ZLIB_DEF) $(MINIDRIVER_DEF) $(SM_DEF) $(TESTS_DEF) /DOPENSC_FEATURES="\"$(OPENSC_FEATURES)\"" /Zi
-!ENDIF
-
-
-LINKFLAGS = /NOLOGO /INCREMENTAL:NO /MACHINE:$(PLATFORM) /NODEFAULTLIB:MSVCRTD /NODEFAULTLIB:MSVCRT /NXCOMPAT /DYNAMICBASE $(LINKDEBUGFLAGS)
-LIBFLAGS = /nologo /machine:$(PLATFORM)
-!IF "$(PLATFORM)" == "x86"
-CANDLEFLAGS = -dPlatform=x86 $(CANDLEFLAGS)
+LINKFLAGS = $(LINKFLAGS) /NODEFAULTLIB:LIBCMT
+COPTS = /Od /MTd $(COPTS)
!ELSE
-CANDLEFLAGS = -dPlatform=x64 $(CANDLEFLAGS)
+LINKFLAGS = $(LINKFLAGS) /NODEFAULTLIB:LIBCMTD /OPT:REF /OPT:ICF
+COPTS = /O1 /MT $(COPTS)
!ENDIF
.c.obj::
- cl $(CODE_OPTIMIZATION) $(COPTS) /c $<
+ cl $(COPTS) /c $<
.cpp.obj::
- cl $(CODE_OPTIMIZATION) $(COPTS) /c $<
+ cl $(COPTS) /c $<
.rc.res::
rc /l 0x0409 $<
diff --git a/win32/Makefile.mak b/win32/Makefile.mak
index 71e43476af..dcebbde933 100644
--- a/win32/Makefile.mak
+++ b/win32/Makefile.mak
@@ -14,7 +14,7 @@ customactions.dll: versioninfo-customactions.res customactions.obj
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" -sh -ext WixUIExtension -ext WiXUtilExtension $?
+ "$(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
diff --git a/win32/OpenSC.wxs.in b/win32/OpenSC.wxs.in
index 9191da43af..545ebfdbe1 100644
--- a/win32/OpenSC.wxs.in
+++ b/win32/OpenSC.wxs.in
@@ -1,11 +1,10 @@
-
+
-
@@ -14,7 +13,6 @@
-
@@ -27,8 +25,7 @@
Codepage="1252"
Version="@OPENSC_VERSION_MAJOR@.@OPENSC_VERSION_MINOR@.@OPENSC_VERSION_FIX@.@OPENSC_VERSION_REVISION@"
Manufacturer="@OPENSC_VS_FF_COMPANY_NAME@">
-
-
-
+
+
@@ -56,7 +53,7 @@
-
+
@@ -68,7 +65,7 @@
-
+
@@ -80,22 +77,22 @@
-
-
+
+
-
+ may have "Provider = OpenSC CSP" so we continue to add it for backward compatibility.
+ Run: "certutil -Silent -store -user My" and look for "Provider = OpenSC CSP". -->
+
-
+
@@ -115,105 +112,107 @@
-
-
+
+
-
-
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
-
-
+
+
+
+
+
+
+
-
+
-
-
+
+
@@ -224,103 +223,103 @@
-
-
-
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
+
@@ -332,7 +331,7 @@