Skip to content

Commit

Permalink
Use WIX 5
Browse files Browse the repository at this point in the history
IB-8024

Signed-off-by: Raul Metsma <raul@metsma.ee>
  • Loading branch information
metsma committed Apr 12, 2024
1 parent 994a251 commit 7043883
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 111 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jobs:
DEBEMAIL: github-actions@github.com
steps:
- name: Install dependencies
run: apt update -qq && apt install --no-install-recommends -y git lsb-release fakeroot build-essential devscripts debhelper cmake xxd xsdcxx libxml-security-c-dev zlib1g-dev doxygen swig openjdk-8-jdk-headless libpython3-dev python3-distutils libboost-test-dev lintian
run: apt update -qq && apt install --no-install-recommends -y git lsb-release build-essential devscripts debhelper cmake xxd xsdcxx libxml-security-c-dev zlib1g-dev doxygen swig openjdk-8-jdk-headless libpython3-dev python3-distutils libboost-test-dev lintian
- name: Checkout
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -181,12 +181,8 @@ jobs:
run: .\prepare_win_build_environment.ps1 -xsd
- name: Install WiX
run: |
dotnet tool install -g wix
wix extension -g add WixToolset.UI.wixext/4.0.4
- name: Setup dev env
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.platform }}
dotnet tool install -g wix --version 5.0.0
wix extension -g add WixToolset.UI.wixext/5.0.0
- name: Build
run: |
& .\build.ps1 `
Expand Down
16 changes: 2 additions & 14 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ param(
[string]$sign = $null
)

# Hack to fetch heat.exe tool
& dotnet new console -o wix-heat --force
& dotnet add wix-heat package WixToolset.Heat
$heat = Get-ChildItem "$env:USERPROFILE\.nuget\packages\WixToolset.Heat" -Include heat.exe -Recurse

$cmakeext = @()
$wixext = @()
$target = @("all")
Expand All @@ -33,7 +28,7 @@ if($swig) {
}
if($doxygen) {
$cmakeext += "-DDOXYGEN_EXECUTABLE=$doxygen"
$wixext += "-d", "docLocation=$platform/share/doc/libdigidocpp", "DocFilesFragment.wxs"
$wixext += "-d", "docLocation=$platform/share/doc/libdigidocpp"
}
if($boost) {
$cmakeext += "-DVCPKG_MANIFEST_FEATURES=tests"
Expand All @@ -53,21 +48,14 @@ foreach($type in @("Debug", "RelWithDebInfo")) {
$cmakeext "&&" $cmake --build $buildpath --target $target "&&" $cmake --install $buildpath
}

if($doxygen) {
& $heat[0] dir $platform/share/doc/libdigidocpp -nologo -cg Documentation -gg -scom -sreg -sfrag -srd -dr DocumentationFolder -var var.docLocation -out DocFilesFragment.wxs
}

& $heat[0] dir $platform/include -nologo -cg Headers -gg -scom -sreg -sfrag -srd -dr HeadersFolder -var var.headersLocation -out HeadersFragment.wxs
& $wix build -nologo -arch $platform -out $msi_name $wixext `
& $vcvars $platform "&&" $wix build -nologo -arch $platform -out $msi_name $wixext `
-ext WixToolset.UI.wixext `
-bv "WixUIBannerBmp=$libdigidocpp/cmake/modules/banner.bmp" `
-bv "WixUIDialogBmp=$libdigidocpp/cmake/modules/dlgbmp.bmp" `
-d "ICON=$libdigidocpp/cmake/modules/ID.ico" `
-d "MSI_VERSION=$msiversion" `
-d "vcpkg=$vcpkg_installed/vcpkg_installed_$platform/$platform-windows" `
-d "libdigidocpp=$platform" `
-d "headersLocation=$platform/include" `
HeadersFragment.wxs `
$libdigidocpp\libdigidocpp.wxs

if($sign) {
Expand Down
170 changes: 80 additions & 90 deletions libdigidocpp.wxs
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
<?if $(sys.BUILDARCH) = x64 ?>
<?define UpgradeCode = "{93985BBA-6B59-443B-80C8-BA987407F8B8}" ?>
<?define LibrariesGuid = "{57A72AF6-5458-4106-BFC8-A611DAF89A59}" ?>
<?define LibrariesDevGuid = "{9B16F8D1-11AA-4AF4-B8C2-96B4EC7E79CD}" ?>
<?define SchemasGuid = "{C42EE645-286C-4B80-B73E-AF82B8D4D778}" ?>
<?define OpenSSLSuffix = "-x64" ?>
<?elseif $(sys.BUILDARCH) = arm64 ?>
<?define UpgradeCode = "{de2f0796-01fe-4291-bfc1-c01f631d082b}" ?>
<?define LibrariesGuid = "{49ab6a46-423f-4d3a-98ea-1c8d251eac4f}" ?>
<?define LibrariesDevGuid = "{5a6642c3-528e-4394-8ace-3bca16f53d9f}" ?>
<?define SchemasGuid = "{78069c8e-8521-4688-a9d1-1020696ac52d}" ?>
<?define OpenSSLSuffix = "-arm64" ?>
<?else?>
<?define UpgradeCode = "{7f1b1519-b527-4130-998d-233f4d050f14}" ?>
<?define LibrariesGuid = "{f730eb17-fafc-440a-88a8-e8795be746b1}" ?>
<?define LibrariesDevGuid = "{f2e01472-129f-4919-9d0a-5d8f49b4598f}" ?>
<?define SchemasGuid = "{66b852a2-68e1-4722-ab63-8e0625c0b3d7}" ?>
<?define OpenSSLSuffix = "" ?>
<?endif?>

Expand All @@ -23,16 +14,11 @@
<?elseif $(env.VisualStudioVersion) = "16.0" ?>
<?define VCVER = "142" ?>
<?endif?>
<?define VCPATH = "$(env.VCTOOLSREDISTDIR)\$(sys.BUILDARCH)\Microsoft.VC$(var.VCVER).CRT" ?>
<?define VCPATH_D = "$(env.VCTOOLSREDISTDIR)\Debug_NonRedist\$(sys.BUILDARCH)\Microsoft.VC$(var.VCVER).DebugCRT" ?>
<?define VCPKG = "$(var.vcpkg)\bin" ?>
<?define VCPKG_D = "$(var.vcpkg)\debug\bin" ?>

<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
<Package Name="Libdigidocpp $(sys.BUILDARCH)" UpgradeCode="$(var.UpgradeCode)"
Language="1033" Version="$(var.MSI_VERSION)" Manufacturer="RIA" InstallerVersion="500">
<SummaryInformation Keywords="Installer" />
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
<Icon Id="ID.ico" SourceFile="$(var.ICON)" />
<Property Id="ARPPRODUCTICON" Value="ID.ico" />
Expand All @@ -45,94 +31,98 @@
</UI>

<StandardDirectory Id="ProgramFiles6432Folder">
<Directory Id="APPLICATIONFOLDER" Name="libdigidocpp"
FileSource="$(var.libdigidocpp)\bin">
<Component Id="Libraries" Guid="$(var.LibrariesGuid)">
<File Source="$(var.VCPATH)\msvcp140.dll" />
<File Source="$(var.VCPATH)\msvcp140_1.dll" />
<File Source="$(var.VCPATH)\msvcp140_2.dll" />
<File Source="$(var.VCPATH)\vcruntime140.dll" />
<Directory Id="INSTALLFOLDER" Name="libdigidocpp" />
</StandardDirectory>

<ComponentGroup Id="Runtime"
Source="$(env.VCTOOLSREDISTDIR)\$(sys.BUILDARCH)\Microsoft.VC$(var.VCVER).CRT">
<File Name="msvcp140.dll" />
<File Name="msvcp140_1.dll" />
<File Name="msvcp140_2.dll" />
<File Name="vcruntime140.dll" />
<?if $(sys.BUILDARCH) != x86 ?>
<File Source="$(var.VCPATH)\vcruntime140_1.dll" />
<File Name="vcruntime140_1.dll" />
<?endif?>
<File Source="$(var.VCPKG)\libcrypto-3$(var.OpenSSLSuffix).dll" />
<File Source="$(var.VCPKG)\libssl-3$(var.OpenSSLSuffix).dll" />
<File Source="$(var.VCPKG)\legacy.dll" />
<File Source="$(var.VCPKG)\zlib1.dll" />
<File Source="$(var.VCPKG)\xerces-c_3_2.dll" />
<File Source="$(var.VCPKG)\Xalan-C_1_12.dll" />
<File Source="$(var.VCPKG)\XalanMessages_1_12.dll" />
<File Source="$(var.VCPKG)\xsec_2_0.dll" />
<File Name="digidocpp.dll" />
<File Name="digidoc-tool.exe" />
<File Source="$(var.libdigidocpp)\etc\digidocpp\digidocpp.conf" />
</ComponentGroup>

<ComponentGroup Id="Dependencies" Source="$(var.vcpkg)\bin">
<File Name="libcrypto-3$(var.OpenSSLSuffix).dll" />
<File Name="libssl-3$(var.OpenSSLSuffix).dll" />
<File Name="legacy.dll" />
<File Name="zlib1.dll" />
<File Name="xerces-c_3_2.dll" />
<File Name="Xalan-C_1_12.dll" />
<File Name="XalanMessages_1_12.dll" />
<File Name="xsec_2_0.dll" />
</ComponentGroup>

<ComponentGroup Id="Libraries" Source="$(var.libdigidocpp)\bin">
<File Name="digidocpp.dll" />
<File Name="digidoc-tool.exe" />
<File Source="$(var.libdigidocpp)\etc\digidocpp\digidocpp.conf" />
<?ifdef var.swig ?>
<File Name="digidoc_csharp.dll" />
<File Name="digidoc_java.dll" />
<File Name="_digidoc_python.pyd" />
<File Name="digidoc.py" />
<File Name="digidoc_csharp.dll" />
<File Name="digidoc_java.dll" />
<File Name="_digidoc_python.pyd" />
<File Name="digidoc.py" />
<?endif?>
</Component>
<Component Id="LibrariesDev" Guid="$(var.LibrariesDevGuid)">
<File Source="$(var.VCPATH_D)\msvcp140d.dll" />
<File Source="$(var.VCPATH_D)\msvcp140_1d.dll" />
<File Source="$(var.VCPATH_D)\msvcp140_2d.dll" />
<File Source="$(var.VCPATH_D)\vcruntime140d.dll" />
</ComponentGroup>

<ComponentGroup Id="RuntimeDev"
Source="$(env.VCTOOLSREDISTDIR)\Debug_NonRedist\$(sys.BUILDARCH)\Microsoft.VC$(var.VCVER).DebugCRT">
<File Name="msvcp140d.dll" />
<File Name="msvcp140_1d.dll" />
<File Name="msvcp140_2d.dll" />
<File Name="vcruntime140d.dll" />
<?if $(sys.BUILDARCH) != x86 ?>
<File Source="$(var.VCPATH_D)\vcruntime140_1d.dll" />
<File Name="vcruntime140_1d.dll" />
<?endif?>
<File Source="$(var.VCPKG_D)\zlibd1.dll" />
<File Source="$(var.VCPKG_D)\xerces-c_3_2D.dll" />
<File Source="$(var.VCPKG_D)\Xalan-C_1_12D.dll" />
<File Source="$(var.VCPKG_D)\XalanMessages_1_12D.dll" />
<File Source="$(var.VCPKG_D)\xsec_2_0D.dll" />
<File Name="digidoc-tool.pdb" />
<File Name="digidocpp.lib" />
<File Name="digidocpp.pdb" />
<File Name="digidocppd.dll" />
<File Name="digidocppd.lib" />
<File Name="digidocppd.pdb" />
</ComponentGroup>

<ComponentGroup Id="DependenciesDev" Source="$(var.vcpkg)\debug\bin">
<File Name="zlibd1.dll" />
<File Name="xerces-c_3_2D.dll" />
<File Name="Xalan-C_1_12D.dll" />
<File Name="XalanMessages_1_12D.dll" />
<File Name="xsec_2_0D.dll" />
</ComponentGroup>

<ComponentGroup Id="LibrariesDev" Source="$(var.libdigidocpp)\bin">
<Files Include="*.pdb" />
<File Name="digidocpp.lib" />
<File Name="digidocppd.dll" />
<File Name="digidocppd.lib" />
<?ifdef var.swig ?>
<File Name="digidoc_csharp.pdb" />
<File Name="digidoc_csharpd.dll" />
<File Name="digidoc_csharpd.pdb" />
<File Name="digidoc_java.pdb" />
<File Name="digidoc_javad.dll" />
<File Name="digidoc_javad.pdb" />
<File Name="_digidoc_python.pdb" />
<File Name="_digidoc_pythond.pyd" />
<File Name="_digidoc_pythond.pdb" />
<File Name="digidoc_csharpd.dll" />
<File Name="digidoc_javad.dll" />
<File Name="_digidoc_pythond.pyd" />
<?endif?>
</Component>
<Directory Id="SchemaFolder" Name="schema"
FileSource="$(var.libdigidocpp)\etc\digidocpp\schema">
<Component Id="Schemas" Guid="$(var.SchemasGuid)">
<File Name="xml.xsd" />
<File Name="conf.xsd" />
<File Name="OpenDocument_manifest.xsd" />
<File Name="OpenDocument_manifest_v1_2.xsd" />
<File Name="xmldsig-core-schema.xsd" />
<File Name="XAdES01903v132-201601.xsd" />
<File Name="XAdES01903v132-201601-relaxed.xsd" />
<File Name="XAdES01903v141-201601.xsd" />
<File Name="ts_119612v020201_201601xsd.xsd" />
<File Name="en_31916201v010101.xsd" />
<File Name="OpenDocument_dsig.xsd" />
</Component>
</Directory>
<Directory Id="HeadersFolder" Name="include" />
</ComponentGroup>

<ComponentGroup Id="Schemas" Directory="INSTALLFOLDER" Subdirectory="schema">
<Files Include="$(var.libdigidocpp)\etc\digidocpp\schema\*.xsd" />
</ComponentGroup>

<ComponentGroup Id="Headers" Directory="INSTALLFOLDER" Subdirectory="include">
<Files Include="$(var.libdigidocpp)\include\**" />
</ComponentGroup>

<?ifdef var.docLocation ?>
<Directory Id="DocumentationFolder" Name="documentation" />
<ComponentGroup Id="Documentation" Directory="INSTALLFOLDER" Subdirectory="documentation">
<Files Include="$(var.docLocation)\**" />
</ComponentGroup>
<?endif?>
</Directory>
</StandardDirectory>

<Feature Id="InstallLibdigidocpp" Level="1" Title="Libdigidocpp" Display="expand" ConfigurableDirectory="APPLICATIONFOLDER">
<ComponentRef Id="Libraries" />
<ComponentRef Id="Schemas" />

<Feature Id="InstallLibdigidocpp" Level="1" Title="Libdigidocpp" Display="expand" ConfigurableDirectory="INSTALLFOLDER">
<ComponentGroupRef Id="Runtime" />
<ComponentGroupRef Id="Dependencies" />
<ComponentGroupRef Id="Libraries" />
<ComponentGroupRef Id="Schemas" />
<Feature Id="InstallDevel" Level="1" Title="Development">
<ComponentGroupRef Id="Headers" />
<ComponentRef Id="LibrariesDev" />
<ComponentGroupRef Id="RuntimeDev" />
<ComponentGroupRef Id="DependenciesDev" />
<ComponentGroupRef Id="LibrariesDev" />
</Feature>
<?ifdef var.docLocation ?>
<Feature Id="InstallDocumentation" Level="1" Title="Documentation">
Expand Down

0 comments on commit 7043883

Please sign in to comment.