-
Notifications
You must be signed in to change notification settings - Fork 31
Update version and libs and build universal installer #390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
metsma
wants to merge
1
commit into
main
Choose a base branch
from
libs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,93 @@ | ||
| #powershell -ExecutionPolicy ByPass -File build.ps1 | ||
| param( | ||
| [string]$webeid = $PSScriptRoot, | ||
| [string]$cmake = "C:\Program Files\CMake\bin\cmake.exe", | ||
| [string]$vcpkgroot = "C:\vcpkg", | ||
| [string]$qtdir = "C:\Qt\6.10.0\msvc2022_64", | ||
| [string]$vcpkgroot = $env:VCPKG_ROOT, | ||
| [string]$build_number = $(if ($null -eq $env:BUILD_NUMBER) {"0"} else {$env:BUILD_NUMBER}), | ||
| [string]$version = (Select-String -Path "$webeid/CMakeLists.txt" -Pattern 'project\(web-eid VERSION (\d+\.\d+\.\d+)').Matches[0].Groups[1].Value + ".$build_number", | ||
| [bool]$crosscompile = ($env:PROCESSOR_ARCHITECTURE -eq "AMD64"), | ||
| [string]$qt_dir = "C:\Qt\6.11.1", | ||
| [string]$qt_x64 = "$qt_dir\msvc2022_64", | ||
| [string]$qt_arm64 = $(if ($crosscompile -and (Test-Path "$qt_dir\msvc2022_arm64_cross_compiled")) { "$qt_dir\msvc2022_arm64_cross_compiled" } else { "$qt_dir\msvc2022_arm64" }), | ||
| [string]$buildtype = "RelWithDebInfo", | ||
| [string]$arch = "x64" | ||
| [string]$sign = $null | ||
| ) | ||
|
|
||
| & $cmake -S . -B build\windows -A $arch -DCMAKE_BUILD_TYPE=$buildtype "-DCMAKE_PREFIX_PATH=$qtdir" "-DCMAKE_TOOLCHAIN_FILE=$vcpkgroot\scripts\buildsystems\vcpkg.cmake" "-DVCPKG_MANIFEST_DIR=lib/libelectronic-id" | ||
| & $cmake --build build\windows --config $buildtype | ||
| $ErrorActionPreference = "Stop" | ||
|
|
||
| Try { & wix > $null } Catch { | ||
| & dotnet tool install --global --version 6.0.2 wix | ||
| & wix extension add -g WixToolset.UI.wixext/6.0.2 | ||
| & wix extension add -g WixToolset.Util.wixext/6.0.2 | ||
| & wix extension add -g WixToolset.BootstrapperApplications.wixext/6.0.2 | ||
| } | ||
|
|
||
| if(!(Test-Path -Path $vcpkgroot)) { | ||
| $vcpkgroot = "$webeid\vcpkg" | ||
| & git clone https://github.com/microsoft/vcpkg $vcpkgroot | ||
| & $vcpkgroot\bootstrap-vcpkg.bat | ||
| } | ||
|
|
||
| $vcvars = "${env:VSINSTALLDIR}VC\Auxiliary\Build\vcvarsall.bat" | ||
| if (-not (Test-Path $vcvars)) { | ||
| $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" | ||
| $vcvars = "$(& $vswhere -latest -property installationPath)\VC\Auxiliary\Build\vcvarsall.bat" | ||
| } | ||
|
|
||
| $msi = @{} | ||
|
|
||
| foreach ($arch in @("x64", "arm64")) { | ||
| $env:PLATFORM = $arch | ||
| $buildpath = "$webeid\build\$arch" | ||
| $qt_path = if ($arch -eq "arm64") { $qt_arm64 } else { $qt_x64 } | ||
|
|
||
| $vsarch = if ($arch -eq "arm64") { if ($crosscompile) { "amd64_arm64" } else { "arm64" } } else { "amd64" } | ||
| cmd /c "`"$vcvars`" $vsarch && set" | Where-Object { $_ -match '=' } | ForEach-Object { | ||
| $name, $value = $_ -split '=', 2 | ||
| [System.Environment]::SetEnvironmentVariable($name, $value) | ||
| } | ||
|
|
||
| $cmakeargs = @( | ||
| "-A", $(if ($arch -eq "arm64") { "ARM64" } else { "x64" }), | ||
| "-S", $webeid, | ||
| "-B", $buildpath, | ||
| "-DCMAKE_BUILD_TYPE=$buildtype", | ||
| "-DCMAKE_PREFIX_PATH=$qt_path", | ||
| "-DCMAKE_TOOLCHAIN_FILE=$vcpkgroot\scripts\buildsystems\vcpkg.cmake", | ||
| "-DVCPKG_MANIFEST_DIR=$webeid\lib\libelectronic-id" | ||
| ) | ||
| if ($arch -eq "arm64" -and $crosscompile) { | ||
| $cmakeargs += "-DQT_HOST_PATH=$($qt_x64 -replace '\\','/')" | ||
| } | ||
| if ($sign) { $cmakeargs += "-DSIGNCERT=$sign" } | ||
|
|
||
| & $cmake @cmakeargs | ||
| & $cmake --build $buildpath --config $buildtype | ||
| & $cmake --build $buildpath --config $buildtype --target installer | ||
|
|
||
| $msi[$arch] = "$buildpath\src\app\$buildtype\web-eid_$version.$arch" | ||
| } | ||
|
|
||
| # Bundle | ||
| $bundle = "$webeid\build\web-eid_$version.exe" | ||
| & wix build -nologo ` | ||
| -ext WixToolset.BootstrapperApplications.wixext ` | ||
| -ext WixToolset.Util.wixext ` | ||
| -d webeid_x64="$($msi['x64'])" ` | ||
| -d webeid_arm64="$($msi['arm64'])" ` | ||
| -d MSI_VERSION=$version ` | ||
| -d path="$webeid\install" ` | ||
| "$webeid\install\plugins.wxs" ` | ||
| -o $bundle | ||
|
|
||
| if ($sign) { | ||
| $signargs = @("sign", "/a", "/v", "/s", "MY", "/n", $sign, | ||
| "/fd", "SHA256", "/du", "http://installer.id.ee", | ||
| "/tr", "http://timestamp.digicert.com", "/td", "SHA256") | ||
| $engine = "$webeid\build\web-eid_$version.engine.exe" | ||
| & wix burn detach -nologo $bundle -engine $engine | ||
| & signtool.exe @signargs $engine | ||
| & wix burn reattach -nologo $bundle -engine $engine -o $bundle | ||
| & signtool.exe @signargs $bundle | ||
| Remove-Item $engine | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| "SU_TITLE" = "Web eID Software"; | ||
| "SU_ERROR" = "Error"; | ||
| "SU_13" = "macOS version needs to be 13.0 or newer."; | ||
| "SU_14" = "macOS version needs to be 14.0 or newer."; | ||
| "SU_BASE" = "Base components"; | ||
| "SU_FIREFOX" = "Firefox authentication and signing support"; | ||
| "SU_CHROME" = "Chrome authentication and signing support"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| "SU_TITLE" = "Web eID Software"; | ||
| "SU_ERROR" = "Chyba"; | ||
| "SU_13" = "verze macOS musí být 13.0 nebo novější."; | ||
| "SU_14" = "verze macOS musí být 14.0 nebo novější."; | ||
| "SU_BASE" = "Základní komponenty"; | ||
| "SU_FIREFOX" = "Podpora ověřování a podepisování Firefoxu"; | ||
| "SU_CHROME" = "Podpora ověřování a podepisování Chrome"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| "SU_TITLE" = "Web eID tarkvara"; | ||
| "SU_ERROR" = "Viga"; | ||
| "SU_13" = "macOS'i versioon peab olema 13.0 või uuem."; | ||
| "SU_14" = "macOS'i versioon peab olema 14.0 või uuem."; | ||
| "SU_BASE" = "Baaskomponendid"; | ||
| "SU_FIREFOX" = "Firefoxi autentimise ja allkirjastamise tugi"; | ||
| "SU_CHROME" = "Chrome'i autentimise ja allkirjastamise tugi"; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
build.ps1requires setting$VCPKG_ROOT:Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or you can provide -vcpkgroot argument to powershell script.
https://learn.microsoft.com/en-us/vcpkg/users/config-environment#vcpkg_root