Compare commits

..
Author SHA1 Message Date
Armin Schrenk 0da557068b prevent usage of cached zip file 2025-06-30 17:04:10 +02:00
Armin Schrenk 50fb1c3042 use same jpackage for msi and appimage 2025-06-30 12:07:58 +02:00
Armin Schrenk f2525791f8 fix path 2025-06-30 11:54:56 +02:00
Armin Schrenk 01d9fe32b5 use proper download url 2025-06-30 11:41:54 +02:00
Armin Schrenk 68e0da37f5 use patched jdk version to build msi on arm 2025-06-30 11:21:26 +02:00
4 changed files with 41 additions and 88 deletions
+19 -4
View File
@@ -126,6 +126,19 @@ jobs:
--no-man-pages
--strip-debug
--compress zip-0
- name: Change win-console flag if debug is active
if: ${{ inputs.isDebug }}
run: echo "WIN_CONSOLE_FLAG=--win-console" >> $GITHUB_ENV
- name: Setup patched JDK if necessary
id: setup-patched-jdk
run: |
if [ "${{ matrix.arch }}" == "arm64" ]; then
curl --output patched-jdk.zip -L "https://static.cryptomator.org/desktop/patched-win-jdk-2.zip"
unzip patched-jdk.zip -d patched-jdk
echo "JAVA_HOME=${{ github.workspace }}/patched-jdk/jdk" >> $GITHUB_OUTPUT
else
echo "JAVA_HOME=${JAVA_HOME}" >> $GITHUB_OUTPUT
fi
- name: Run jpackage
run: >
${JAVA_HOME}/bin/jpackage
@@ -163,7 +176,9 @@ jobs:
--java-options "-Djavafx.verbose=${{ inputs.isDebug }}"
--resource-dir dist/win/resources
--icon dist/win/resources/Cryptomator.ico
--add-launcher "Debug_Cryptomator=dist/win/debug-launcher.properties"
${WIN_CONSOLE_FLAG}
env:
JAVA_HOME: ${{ steps.setup-patched-jdk.outputs.JAVA_HOME }}
- name: Patch Application Directory
run: |
cp dist/win/contrib/* appdir/Cryptomator
@@ -178,9 +193,7 @@ jobs:
exit 1
}
- name: Fix permissions
run: |
attrib -r appdir/Cryptomator/Cryptomator.exe
attrib -r appdir/Cryptomator/Debug_Cryptomator.exe
run: attrib -r appdir/Cryptomator/Cryptomator.exe
shell: pwsh
- name: Extract jars with DLLs for Codesigning
shell: pwsh
@@ -261,6 +274,7 @@ jobs:
--license-file dist/win/resources/license.rtf
--file-associations dist/win/resources/FAvaultFile.properties
env:
JAVA_HOME: ${{ steps.setup-patched-jdk.outputs.JAVA_HOME }}
JP_WIXWIZARD_RESOURCES: ${{ github.workspace }}/dist/win/resources # requires abs path, used in resources/main.wxs
JP_WIXHELPER_DIR: ${{ github.workspace }}\appdir
- name: Codesign MSI
@@ -360,6 +374,7 @@ jobs:
working-directory: dist/win
run: >
wix build
-arch ${{ matrix.arch }}
-define BundleName="Cryptomator"
-define BundleVersion="${{ needs.get-version.outputs.semVerNum }}.${{ needs.get-version.outputs.revNum}}"
-define BundleVendor="Skymatic GmbH"
+1 -2
View File
@@ -4,8 +4,7 @@ installer
*.wixobj
*.pdb
*.msi
*Debug.properties
*.exe
*.jmod
resources/jfxJmods.zip
license.rtf
license.rtf
+21 -81
View File
@@ -49,7 +49,6 @@ $buildDir = Split-Path -Parent $PSCommandPath
$version = $(mvn -f $buildDir/../../pom.xml help:evaluate -Dexpression="project.version" -q -DforceStdout)
$semVerNo = $version -replace '(\d+\.\d+\.\d+).*','$1'
$revisionNo = $(git rev-list --count HEAD)
$signingCertThumbprint = "TODO"
Write-Output "`$version=$version"
Write-Output "`$semVerNo=$semVerNo"
@@ -118,7 +117,7 @@ switch ($archName) {
}
## create custom runtime
### adjust for JEP 493
### check for JEP 493
if ((& "$Env:JAVA_HOME\bin\jlink" --help | Select-String -Pattern "Linking from run-time image enabled" -SimpleMatch | Measure-Object).Count -eq 0 ) {
$jmodPaths="$Env:JAVA_HOME/jmods;" + $jmodPaths;
}
@@ -140,29 +139,6 @@ if ($clean -and (Test-Path -Path $appPath)) {
Remove-Item -Path $appPath -Force -Recurse
}
$javaOptions = @(
"--java-options", "--enable-native-access=javafx.graphics,org.cryptomator.jfuse.win,org.cryptomator.integrations.win"
"--java-options", "-Xss5m"
"--java-options", "-Xmx256m"
"--java-options", "-Dcryptomator.appVersion=`"$semVerNo`""
"--java-options", "-Dfile.encoding=`"utf-8`""
"--java-options", "-Djava.net.useSystemProxies=true"
"--java-options", "-Dcryptomator.logDir=`"@{localappdata}/$AppName`""
"--java-options", "-Dcryptomator.pluginDir=`"@{appdata}/$AppName/Plugins`""
"--java-options", "-Dcryptomator.settingsPath=`"@{appdata}/$AppName/settings.json;@{userhome}/AppData/Roaming/$AppName/settings.json`""
"--java-options", "-Dcryptomator.ipcSocketPath=`"@{localappdata}/$AppName/ipc.socket`""
"--java-options", "-Dcryptomator.p12Path=`"@{appdata}/$AppName/key.p12;@{userhome}/AppData/Roaming/$AppName/key.p12`""
"--java-options", "-Dcryptomator.mountPointsDir=`"@{userhome}/$AppName`""
"--java-options", "-Dcryptomator.loopbackAlias=`"$LoopbackAlias`""
"--java-options", "-Dcryptomator.integrationsWin.autoStartShellLinkName=`"$AppName`""
"--java-options", "-Dcryptomator.integrationsWin.keychainPaths=`"@{appdata}/$AppName/keychain.json;@{userhome}/AppData/Roaming/$AppName/keychain.json`""
"--java-options", "-Dcryptomator.integrationsWin.windowsHelloKeychainPaths=`"@{appdata}/$AppName/windowsHelloKeychain.json`""
"--java-options", "-Dcryptomator.showTrayIcon=true"
"--java-options", "-Dcryptomator.buildNumber=`"msi-$revisionNo`""
)
# create app dir
& "$Env:JAVA_HOME\bin\jpackage" `
--verbose `
@@ -175,16 +151,28 @@ $javaOptions = @(
--name $AppName `
--vendor $Vendor `
--copyright $copyright `
--java-options "--enable-preview" `
--java-options "--enable-native-access=javafx.graphics,org.cryptomator.jfuse.win,org.cryptomator.integrations.win" `
--java-options "-Xss5m" `
--java-options "-Xmx256m" `
--java-options "-Dcryptomator.appVersion=`"$semVerNo`"" `
--app-version "$semVerNo.$revisionNo" `
--java-options "-Dfile.encoding=`"utf-8`"" `
--java-options "-Djava.net.useSystemProxies=true" `
--java-options "-Dcryptomator.logDir=`"@{localappdata}/$AppName`"" `
--java-options "-Dcryptomator.pluginDir=`"@{appdata}/$AppName/Plugins`"" `
--java-options "-Dcryptomator.settingsPath=`"@{appdata}/$AppName/settings.json;@{userhome}/AppData/Roaming/$AppName/settings.json`"" `
--java-options "-Dcryptomator.ipcSocketPath=`"@{localappdata}/$AppName/ipc.socket`"" `
--java-options "-Dcryptomator.p12Path=`"@{appdata}/$AppName/key.p12;@{userhome}/AppData/Roaming/$AppName/key.p12`"" `
--java-options "-Dcryptomator.mountPointsDir=`"@{userhome}/$AppName`"" `
--java-options "-Dcryptomator.loopbackAlias=`"$LoopbackAlias`"" `
--java-options "-Dcryptomator.integrationsWin.autoStartShellLinkName=`"$AppName`"" `
--java-options "-Dcryptomator.integrationsWin.keychainPaths=`"@{appdata}/$AppName/keychain.json;@{userhome}/AppData/Roaming/$AppName/keychain.json`"" `
--java-options "-Dcryptomator.integrationsWin.windowsHelloKeychainPaths=`"@{appdata}/$AppName/windowsHelloKeychain.json`"" `
--java-options "-Dcryptomator.showTrayIcon=true" `
--java-options "-Dcryptomator.buildNumber=`"msi-$revisionNo`"" `
--resource-dir resources `
--icon resources/$AppName.ico `
--add-launcher "Debug_${AppName}=$buildDir\debug-launcher.properties" `
@javaOptions
if ($LASTEXITCODE -ne 0) {
Write-Error "jpackage Appimage failed with exit code $LASTEXITCODE"
return 1;
}
--icon resources/$AppName.ico
#Create RTF license for msi
&mvn -B -f $buildDir/../../pom.xml license:add-third-party "-Djavafx.platform=win" `
@@ -199,7 +187,6 @@ if ($LASTEXITCODE -ne 0) {
# patch app dir
Copy-Item "contrib\*" -Destination "$AppName"
attrib -r "$AppName\$AppName.exe"
attrib -r "$AppName\Debug_${AppName}.exe"
# patch batch script to set hostfile
$webDAVPatcher = "$AppName\patchWebDAV.bat"
try {
@@ -209,53 +196,6 @@ try {
exit 1
}
# sign app dir
## extract
Add-Type -AssemblyName "System.io.compression.filesystem"
$jarFolder = Resolve-Path "$AppName\app\mods"
$jarExtractDir = New-Item -Path "$AppName\jar-extract" -ItemType Directory
Get-ChildItem -Path $jarFolder -Filter "*.jar" | ForEach-Object {
$jar = [Io.compression.zipfile]::OpenRead($_.FullName)
if (@($jar.Entries | Where-Object {
$_.Name.ToString().EndsWith(".dll")} | Select-Object -First 1).Count -gt 0) {
#jars containing dlls extract
Set-Location $jarExtractDir
Expand-Archive -Path $_.FullName
}
$jar.Dispose()
}
Set-Location $buildDir
## Extract wixhelper.dll for Codesigning #see https://github.com/cryptomator/cryptomator/issues/3130
if($jmodPaths -like "${env:JAVA_HOME}\jmods") {
$wixHelperDir = New-Item -Path ${AppName}/jpackage-jmod -ItemType Directory
& ${env:JAVA_HOME}\bin\jmod.exe extract --dir $wixHelperDir "${env:JAVA_HOME}\jmods\jdk.jpackage.jmod"
Get-ChildItem -Recurse -Path "$wixHelperDir" -File wixhelper.dll | Select-Object -Last 1 | Copy-Item -Destination "${AppName}/"
}
## prepare signtool
Write-Output "Signing files in app dir $AppName..."
$signTool = Get-ChildItem -Path "${Env:ProgramFiles(x86)}\Windows Kits\10\bin\" -Recurse -Filter "signtool.exe" | Where-Object FullName -like "*${archName}*" | Sort-Object LastWriteTime -Descending | Select-Object -First 1
if ($null -eq $signTool) {
Write-Error "Unable to find signtool.exe in ${Env:ProgramFiles(x86)}\Windows Kits\10\bin\. Please ensure Windows SDK is installed."
exit 1
}
Write-Output "Using signtool: $($signTool.FullName)"
Write-Output "Using signing certificate with thumbprint: $signingCertThumbprint"
## sign files inside app dir
$filesToSign = Get-ChildItem -Path $AppName -Recurse -File -Include "*.exe","*.dll","*.sys"
foreach ($file in $filesToSign) {
& $signTool sign /as /sha1 $signingCertThumbprint /tr "http://timestamp.digicert.com" /td SHA256 /fd SHA256 /d "Cryptomator" $file.FullName
if( $? -eq $false) {
Write-Error "Failed to sign file: $($file.FullName)"
exit 1
}
}
#TODO: Sign wixhelper.dll with signtool.exe
#TODO: patch jar files with signed dlls
# create .msi
$Env:JP_WIXWIZARD_RESOURCES = "$buildDir\resources"
$Env:JP_WIXHELPER_DIR = "."
-1
View File
@@ -1 +0,0 @@
win-console=true