mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-09-22 07:54:19 +00:00
Compare commits
14
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2cd9c5a5d | ||
|
|
995ece19ae | ||
|
|
99182674ef | ||
|
|
c05ff5d9ec | ||
|
|
7bc231023f | ||
|
|
3244b66c1c | ||
|
|
b72982edd8 | ||
|
|
a1db1272a9 | ||
|
|
e67f235887 | ||
|
|
641066ea07 | ||
|
|
9f035b7d37 | ||
|
|
92b512b719 | ||
|
|
1102f73680 | ||
|
|
cf9663fc26 |
@@ -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
@@ -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
|
||||||
|
|||||||
Vendored
+81
-21
@@ -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 = "."
|
||||||
|
|||||||
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
win-console=true
|
||||||
Reference in New Issue
Block a user