Compare commits

...
Author SHA1 Message Date
Armin Schrenk d2cd9c5a5d extend local build script with step to sign build files 2025-07-02 22:09:25 +02:00
Armin Schrenk 995ece19ae Fix failing signing of debug launcher 2025-07-02 21:52:44 +02:00
Armin Schrenk 99182674ef Merge branch 'develop' into feature/window-debug-launcher 2025-06-30 16:19:56 +02:00
Armin Schrenk c05ff5d9ec revert to old name 2025-06-24 14:35:49 +02:00
Armin Schrenk 7bc231023f pack java options into array for local build script 2025-06-24 14:22:48 +02:00
Armin Schrenk 3244b66c1c change name of debug launcher to not confuse users 2025-06-17 15:08:18 +02:00
Armin Schrenk b72982edd8 simplify debug launcher to only run inside a terminal 2025-06-17 14:53:04 +02:00
Armin Schrenk a1db1272a9 Merge branch 'develop' into feature/window-debug-launcher 2025-06-17 13:59:33 +02:00
Armin Schrenk e67f235887 Merge branch 'develop' into feature/window-debug-launcher
# Conflicts:
#	.github/workflows/win-exe.yml
#	dist/win/.gitignore
2025-05-30 10:52:16 +02:00
Armin Schrenk 641066ea07 Several fixes:
* substitute all java-options
* use correct properties path
* fix read-only attribute of debug launcher
2023-02-06 13:55:40 +01:00
Armin Schrenk 9f035b7d37 Merge branch 'develop' into feature/window-debug-launcher 2023-02-06 12:32:07 +01:00
Armin Schrenk 92b512b719 remove javafx debug option 2023-02-06 12:22:39 +01:00
Armin Schrenk 1102f73680 replace/substitute variables in debug launcher 2023-02-06 12:15:03 +01:00
Armin Schrenk cf9663fc26 add addiitonal launcher to debug javafx problems 2023-02-03 13:17:06 +01:00
4 changed files with 88 additions and 27 deletions
+4 -5
View File
@@ -126,9 +126,6 @@ jobs:
--no-man-pages --no-man-pages
--strip-debug --strip-debug
--compress zip-0 --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: Run jpackage - name: Run jpackage
run: > run: >
${JAVA_HOME}/bin/jpackage ${JAVA_HOME}/bin/jpackage
@@ -166,7 +163,7 @@ jobs:
--java-options "-Djavafx.verbose=${{ inputs.isDebug }}" --java-options "-Djavafx.verbose=${{ inputs.isDebug }}"
--resource-dir dist/win/resources --resource-dir dist/win/resources
--icon dist/win/resources/Cryptomator.ico --icon dist/win/resources/Cryptomator.ico
${WIN_CONSOLE_FLAG} --add-launcher "Debug_Cryptomator=dist/win/debug-launcher.properties"
- name: Patch Application Directory - name: Patch Application Directory
run: | run: |
cp dist/win/contrib/* appdir/Cryptomator cp dist/win/contrib/* appdir/Cryptomator
@@ -181,7 +178,9 @@ jobs:
exit 1 exit 1
} }
- name: Fix permissions - name: Fix permissions
run: attrib -r appdir/Cryptomator/Cryptomator.exe run: |
attrib -r appdir/Cryptomator/Cryptomator.exe
attrib -r appdir/Cryptomator/Debug_Cryptomator.exe
shell: pwsh shell: pwsh
- name: Extract jars with DLLs for Codesigning - name: Extract jars with DLLs for Codesigning
shell: pwsh shell: pwsh
+2 -1
View File
@@ -4,7 +4,8 @@ installer
*.wixobj *.wixobj
*.pdb *.pdb
*.msi *.msi
*Debug.properties
*.exe *.exe
*.jmod *.jmod
resources/jfxJmods.zip resources/jfxJmods.zip
license.rtf license.rtf
+81 -21
View File
@@ -49,6 +49,7 @@ $buildDir = Split-Path -Parent $PSCommandPath
$version = $(mvn -f $buildDir/../../pom.xml help:evaluate -Dexpression="project.version" -q -DforceStdout) $version = $(mvn -f $buildDir/../../pom.xml help:evaluate -Dexpression="project.version" -q -DforceStdout)
$semVerNo = $version -replace '(\d+\.\d+\.\d+).*','$1' $semVerNo = $version -replace '(\d+\.\d+\.\d+).*','$1'
$revisionNo = $(git rev-list --count HEAD) $revisionNo = $(git rev-list --count HEAD)
$signingCertThumbprint = "TODO"
Write-Output "`$version=$version" Write-Output "`$version=$version"
Write-Output "`$semVerNo=$semVerNo" Write-Output "`$semVerNo=$semVerNo"
@@ -117,7 +118,7 @@ switch ($archName) {
} }
## create custom runtime ## create custom runtime
### check for JEP 493 ### adjust 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 ) { 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; $jmodPaths="$Env:JAVA_HOME/jmods;" + $jmodPaths;
} }
@@ -139,6 +140,29 @@ if ($clean -and (Test-Path -Path $appPath)) {
Remove-Item -Path $appPath -Force -Recurse 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 # create app dir
& "$Env:JAVA_HOME\bin\jpackage" ` & "$Env:JAVA_HOME\bin\jpackage" `
--verbose ` --verbose `
@@ -151,28 +175,16 @@ if ($clean -and (Test-Path -Path $appPath)) {
--name $AppName ` --name $AppName `
--vendor $Vendor ` --vendor $Vendor `
--copyright $copyright ` --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" ` --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 ` --resource-dir resources `
--icon resources/$AppName.ico --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;
}
#Create RTF license for msi #Create RTF license for msi
&mvn -B -f $buildDir/../../pom.xml license:add-third-party "-Djavafx.platform=win" ` &mvn -B -f $buildDir/../../pom.xml license:add-third-party "-Djavafx.platform=win" `
@@ -187,6 +199,7 @@ if ($clean -and (Test-Path -Path $appPath)) {
# patch app dir # patch app dir
Copy-Item "contrib\*" -Destination "$AppName" Copy-Item "contrib\*" -Destination "$AppName"
attrib -r "$AppName\$AppName.exe" attrib -r "$AppName\$AppName.exe"
attrib -r "$AppName\Debug_${AppName}.exe"
# patch batch script to set hostfile # patch batch script to set hostfile
$webDAVPatcher = "$AppName\patchWebDAV.bat" $webDAVPatcher = "$AppName\patchWebDAV.bat"
try { try {
@@ -196,6 +209,53 @@ try {
exit 1 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 # create .msi
$Env:JP_WIXWIZARD_RESOURCES = "$buildDir\resources" $Env:JP_WIXWIZARD_RESOURCES = "$buildDir\resources"
$Env:JP_WIXHELPER_DIR = "." $Env:JP_WIXHELPER_DIR = "."
+1
View File
@@ -0,0 +1 @@
win-console=true