mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-09-24 00:44:21 +00:00
Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
426b33ae1a | ||
|
|
8e52161fa4 | ||
|
|
f1540e13eb | ||
|
|
2c2165cb22 | ||
|
|
03cb5f6be9 | ||
|
|
8a98048835 |
@@ -83,7 +83,7 @@ jobs:
|
|||||||
- arch: x64
|
- arch: x64
|
||||||
os: windows-latest
|
os: windows-latest
|
||||||
java-dist: 'zulu' #cannot use temurin, see https://github.com/cryptomator/cryptomator/issues/3824#issuecomment-2829827427
|
java-dist: 'zulu' #cannot use temurin, see https://github.com/cryptomator/cryptomator/issues/3824#issuecomment-2829827427
|
||||||
java-version: '25.0.1+8'
|
java-version: '26.0.1+8'
|
||||||
java-package: 'jdk'
|
java-package: 'jdk'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
@@ -220,12 +220,10 @@ jobs:
|
|||||||
}
|
}
|
||||||
$jar.Dispose()
|
$jar.Dispose()
|
||||||
}
|
}
|
||||||
- name: Extract wixhelper.dll for Codesigning #see https://github.com/cryptomator/cryptomator/issues/3130
|
- name: Get msi helper dll for code signing
|
||||||
shell: pwsh
|
|
||||||
run: |
|
run: |
|
||||||
New-Item -Path appdir/jpackage-jmod -ItemType Directory
|
${JAVA_HOME}/bin/jpackage --type msi --win-upgrade-uuid bda45523-42b1-4cae-9354-a45475ed4775 --app-image appdir/Cryptomator --dest /tmp/ --name Test --vendor Test --copyright "None" --app-version "1.0" --temp msi-helper
|
||||||
& $env:JAVA_HOME\bin\jmod.exe extract --dir jpackage-jmod "${env:JAVA_HOME}\jmods\jdk.jpackage.jmod"
|
find ./msi-helper/ -type f -name msica.dll -exec mv {} ./appdir \;
|
||||||
Get-ChildItem -Recurse -Path "jpackage-jmod" -File wixhelper.dll | Select-Object -Last 1 | Copy-Item -Destination "appdir"
|
|
||||||
- name: Sign DLLs with Azure Trusted Signing
|
- name: Sign DLLs with Azure Trusted Signing
|
||||||
if: inputs.sign || github.event_name == 'schedule'
|
if: inputs.sign || github.event_name == 'schedule'
|
||||||
uses: ./.github/actions/win-sign-action
|
uses: ./.github/actions/win-sign-action
|
||||||
@@ -261,6 +259,16 @@ jobs:
|
|||||||
"-Dlicense.failOnMissing=true"
|
"-Dlicense.failOnMissing=true"
|
||||||
"-Dlicense.licenseMergesUrl=file:///${{ github.workspace }}/license/merges"
|
"-Dlicense.licenseMergesUrl=file:///${{ github.workspace }}/license/merges"
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
|
- name: Create file association file from template
|
||||||
|
working-directory: dist/win
|
||||||
|
run: |
|
||||||
|
$Env:JP_WIXWIZARD_RESOURCES_PROPERTIES_FORMAT = "${Env:JP_WIXWIZARD_RESOURCES}".Replace('\', '\\');
|
||||||
|
Get-Content .\resources\FAvaultFile.template.properties `
|
||||||
|
| ForEach-Object { $ExecutionContext.InvokeCommand.ExpandString($_) } `
|
||||||
|
| Out-File -FilePath .\resources\FAvaultFile.properties
|
||||||
|
env:
|
||||||
|
JP_WIXWIZARD_RESOURCES: ${{ github.workspace }}/dist/win/resources/ # requires abs path, used in resources/main.wxs
|
||||||
|
shell: pwsh
|
||||||
- name: Create MSI
|
- name: Create MSI
|
||||||
run: >
|
run: >
|
||||||
${JAVA_HOME}/bin/jpackage
|
${JAVA_HOME}/bin/jpackage
|
||||||
@@ -276,14 +284,14 @@ jobs:
|
|||||||
--win-menu
|
--win-menu
|
||||||
--win-dir-chooser
|
--win-dir-chooser
|
||||||
--win-shortcut-prompt
|
--win-shortcut-prompt
|
||||||
--win-update-url "https:\\cryptomator.org\downloads"
|
--win-update-url "https://cryptomator.org/downloads"
|
||||||
--win-menu-group Cryptomator
|
--win-menu-group Cryptomator
|
||||||
--resource-dir dist/win/resources
|
--resource-dir dist/win/resources
|
||||||
--license-file dist/win/resources/license.rtf
|
--license-file dist/win/resources/license.rtf
|
||||||
--file-associations dist/win/resources/FAvaultFile.properties
|
--file-associations dist/win/resources/FAvaultFile.properties
|
||||||
env:
|
env:
|
||||||
JP_WIXWIZARD_RESOURCES: ${{ github.workspace }}/dist/win/resources # requires abs path, used in resources/main.wxs
|
JP_WIXWIZARD_RESOURCES: ${{ github.workspace }}/dist/win/resources/ # requires abs path, used in resources/main.wxs
|
||||||
JP_WIXHELPER_DIR: ${{ github.workspace }}\appdir
|
JP_WIXHELPER_DIR: ${{ github.workspace }}\appdir\
|
||||||
- name: Sign MSI with Azure Trusted Signing
|
- name: Sign MSI with Azure Trusted Signing
|
||||||
if: inputs.sign || github.event_name == 'schedule'
|
if: inputs.sign || github.event_name == 'schedule'
|
||||||
uses: ./.github/actions/win-sign-action
|
uses: ./.github/actions/win-sign-action
|
||||||
|
|||||||
Vendored
+88
-64
@@ -16,6 +16,19 @@ Param(
|
|||||||
# Function Definitions Section
|
# Function Definitions Section
|
||||||
# ============================
|
# ============================
|
||||||
|
|
||||||
|
function Invoke-CommandWithExitCheck {
|
||||||
|
param (
|
||||||
|
[string]$Command,
|
||||||
|
[string[]]$Arguments
|
||||||
|
)
|
||||||
|
|
||||||
|
& $Command @Arguments
|
||||||
|
if ($LASTEXITCODE -ne 0) {
|
||||||
|
Write-Error "Command '$Command' failed with exit code $LASTEXITCODE"
|
||||||
|
exit $LASTEXITCODE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function Main {
|
function Main {
|
||||||
|
|
||||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||||
@@ -65,7 +78,8 @@ Write-Host "`$Env:JAVA_HOME=$Env:JAVA_HOME"
|
|||||||
$copyright = "(C) $CopyrightStartYear - $((Get-Date).Year) $Vendor"
|
$copyright = "(C) $CopyrightStartYear - $((Get-Date).Year) $Vendor"
|
||||||
|
|
||||||
# compile
|
# compile
|
||||||
&mvn -B -f $buildDir/../../pom.xml clean package -DskipTests -Pwin
|
Invoke-CommandWithExitCheck -Command `
|
||||||
|
"mvn" -Arguments @("-B", "-f", "$buildDir/../../pom.xml", "clean", "package", "-DskipTests", "-Pwin")
|
||||||
Copy-Item "$buildDir\..\..\target\$MainJarGlob.jar" -Destination "$buildDir\..\..\target\mods"
|
Copy-Item "$buildDir\..\..\target\$MainJarGlob.jar" -Destination "$buildDir\..\..\target\mods"
|
||||||
|
|
||||||
# add runtime
|
# add runtime
|
||||||
@@ -129,16 +143,18 @@ if ((& "$Env:JAVA_HOME\bin\jlink" --help | Select-String -Pattern "Linking from
|
|||||||
}
|
}
|
||||||
|
|
||||||
### create runtime
|
### create runtime
|
||||||
& "$Env:JAVA_HOME\bin\jlink" `
|
Invoke-CommandWithExitCheck -Command `
|
||||||
--verbose `
|
"$Env:JAVA_HOME\bin\jlink" -Arguments @(
|
||||||
--output runtime `
|
"--verbose",
|
||||||
--module-path $jmodPaths `
|
"--output", "runtime",
|
||||||
--add-modules java.base,java.desktop,java.instrument,java.logging,java.naming,java.net.http,java.scripting,java.sql,java.xml,jdk.unsupported,jdk.accessibility,jdk.management.jfr,jdk.crypto.cryptoki,jdk.crypto.ec,jdk.crypto.mscapi,java.compiler,javafx.base,javafx.graphics,javafx.controls,javafx.fxml `
|
"--module-path", $jmodPaths,
|
||||||
--strip-native-commands `
|
"--add-modules", "java.base,java.desktop,java.instrument,java.logging,java.naming,java.net.http,java.scripting,java.sql,java.xml,jdk.unsupported,jdk.accessibility,jdk.management.jfr,jdk.crypto.cryptoki,jdk.crypto.ec,jdk.crypto.mscapi,java.compiler,javafx.base,javafx.graphics,javafx.controls,javafx.fxml",
|
||||||
--no-header-files `
|
"--strip-native-commands",
|
||||||
--no-man-pages `
|
"--no-header-files",
|
||||||
--strip-debug `
|
"--no-man-pages",
|
||||||
--compress "zip-0" #do not compress and use msi compression
|
"--strip-debug",
|
||||||
|
"--compress", "zip-0" #do not compress and use msi compression
|
||||||
|
)
|
||||||
|
|
||||||
$appPath = ".\$AppName"
|
$appPath = ".\$AppName"
|
||||||
if ($clean -and (Test-Path -Path $appPath)) {
|
if ($clean -and (Test-Path -Path $appPath)) {
|
||||||
@@ -195,14 +211,15 @@ if ($LASTEXITCODE -ne 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#Create RTF license for msi
|
#Create RTF license for msi
|
||||||
&mvn -B -f $buildDir/../../pom.xml license:add-third-party `
|
Invoke-CommandWithExitCheck -Command `
|
||||||
"-Dlicense.thirdPartyFilename=license.rtf" `
|
"mvn" -Arguments @("-B", "-f", "$buildDir/../../pom.xml", "license:add-third-party", `
|
||||||
"-Dlicense.fileTemplate=$buildDir\resources\licenseTemplate.ftl" `
|
"-Dlicense.thirdPartyFilename=license.rtf", `
|
||||||
"-Dlicense.outputDirectory=$buildDir\resources\" `
|
"-Dlicense.fileTemplate=$buildDir\resources\licenseTemplate.ftl", `
|
||||||
"-Dlicense.includedScopes=compile" `
|
"-Dlicense.outputDirectory=$buildDir\resources\", `
|
||||||
"-Dlicense.excludedGroups=^org\.cryptomator" `
|
"-Dlicense.includedScopes=compile", `
|
||||||
"-Dlicense.failOnMissing=true" `
|
"-Dlicense.excludedGroups=^org\.cryptomator", `
|
||||||
"-Dlicense.licenseMergesUrl=file:///$buildDir/../../license/merges"
|
"-Dlicense.failOnMissing=true", `
|
||||||
|
"-Dlicense.licenseMergesUrl=file:///$buildDir/../../license/merges")
|
||||||
|
|
||||||
# patch app dir
|
# patch app dir
|
||||||
Copy-Item "contrib\*" -Destination "$AppName"
|
Copy-Item "contrib\*" -Destination "$AppName"
|
||||||
@@ -210,42 +227,46 @@ attrib -r "$AppName\$AppName.exe"
|
|||||||
attrib -r "$AppName\${AppName} (Debug).exe"
|
attrib -r "$AppName\${AppName} (Debug).exe"
|
||||||
|
|
||||||
# create .msi
|
# create .msi
|
||||||
$Env:JP_WIXWIZARD_RESOURCES = "$buildDir\resources"
|
$Env:JP_WIXWIZARD_RESOURCES = "$buildDir\resources\"
|
||||||
$Env:JP_WIXHELPER_DIR = "."
|
$Env:JP_WIXWIZARD_RESOURCES_PROPERTIES_FORMAT = "${Env:JP_WIXWIZARD_RESOURCES}".Replace('\', '\\');
|
||||||
& "$Env:JAVA_HOME\bin\jpackage" `
|
$Env:JP_WIXHELPER_DIR = ""
|
||||||
--verbose `
|
|
||||||
--type msi `
|
|
||||||
--win-upgrade-uuid $UpgradeUUID `
|
|
||||||
--app-image $AppName `
|
|
||||||
--dest installer `
|
|
||||||
--name $AppName `
|
|
||||||
--vendor $Vendor `
|
|
||||||
--copyright $copyright `
|
|
||||||
--app-version "$semVerNo.$revisionNo" `
|
|
||||||
--win-menu `
|
|
||||||
--win-dir-chooser `
|
|
||||||
--win-shortcut-prompt `
|
|
||||||
--win-menu-group $AppName `
|
|
||||||
--resource-dir resources `
|
|
||||||
--license-file resources/license.rtf `
|
|
||||||
--win-update-url $UpdateUrl `
|
|
||||||
--about-url $AboutUrl `
|
|
||||||
--file-associations resources/FAvaultFile.properties
|
|
||||||
|
|
||||||
if ($LASTEXITCODE -ne 0) {
|
Get-Content .\resources\FAvaultFile.template.properties ` # Similar to envsubst
|
||||||
Write-Error "jpackage MSI failed with exit code $LASTEXITCODE"
|
| ForEach-Object { $ExecutionContext.InvokeCommand.ExpandString($_) } `
|
||||||
return 1;
|
| Out-File -FilePath .\resources\FAvaultFile.properties
|
||||||
}
|
|
||||||
|
Invoke-CommandWithExitCheck -Command `
|
||||||
|
"$Env:JAVA_HOME\bin\jpackage" -Arguments @(
|
||||||
|
"--verbose",
|
||||||
|
"--type", "msi",
|
||||||
|
"--win-upgrade-uuid", $UpgradeUUID,
|
||||||
|
"--app-image", $AppName,
|
||||||
|
"--dest", "installer",
|
||||||
|
"--name", $AppName,
|
||||||
|
"--vendor", $Vendor,
|
||||||
|
"--copyright", $copyright,
|
||||||
|
"--app-version", "$semVerNo.$revisionNo",
|
||||||
|
"--win-menu",
|
||||||
|
"--win-dir-chooser",
|
||||||
|
"--win-shortcut-prompt",
|
||||||
|
"--win-menu-group", $AppName,
|
||||||
|
"--resource-dir", "resources",
|
||||||
|
"--license-file", "resources/license.rtf",
|
||||||
|
"--win-update-url", $UpdateUrl,
|
||||||
|
"--about-url", $AboutUrl,
|
||||||
|
"--file-associations", "resources/FAvaultFile.properties"
|
||||||
|
)
|
||||||
|
|
||||||
#Create RTF license for bundle
|
#Create RTF license for bundle
|
||||||
&mvn -B -f $buildDir/../../pom.xml license:add-third-party `
|
Invoke-CommandWithExitCheck -Command `
|
||||||
"-Dlicense.thirdPartyFilename=license.rtf" `
|
"mvn" -Arguments @("-B", "-f", "$buildDir/../../pom.xml", "license:add-third-party", `
|
||||||
"-Dlicense.fileTemplate=$buildDir\bundle\resources\licenseTemplate.ftl" `
|
"-Dlicense.thirdPartyFilename=license.rtf", `
|
||||||
"-Dlicense.outputDirectory=$buildDir\bundle\resources\" `
|
"-Dlicense.fileTemplate=$buildDir\bundle\resources\licenseTemplate.ftl", `
|
||||||
"-Dlicense.includedScopes=compile" `
|
"-Dlicense.outputDirectory=$buildDir\bundle\resources\", `
|
||||||
"-Dlicense.excludedGroups=^org\.cryptomator" `
|
"-Dlicense.includedScopes=compile", `
|
||||||
"-Dlicense.failOnMissing=true" `
|
"-Dlicense.excludedGroups=^org\.cryptomator", `
|
||||||
"-Dlicense.licenseMergesUrl=file:///$buildDir/../../license/merges"
|
"-Dlicense.failOnMissing=true", `
|
||||||
|
"-Dlicense.licenseMergesUrl=file:///$buildDir/../../license/merges")
|
||||||
|
|
||||||
# download Winfsp
|
# download Winfsp
|
||||||
$winfspMsiUrl= 'https://github.com/winfsp/winfsp/releases/download/v2.1/winfsp-2.1.25156.msi'
|
$winfspMsiUrl= 'https://github.com/winfsp/winfsp/releases/download/v2.1/winfsp-2.1.25156.msi'
|
||||||
@@ -271,18 +292,21 @@ Invoke-WebRequest $winfspUninstaller -OutFile ".\bundle\resources\winfsp-uninsta
|
|||||||
Copy-Item ".\installer\$AppName-*.msi" -Destination ".\bundle\resources\$AppName.msi" -Force
|
Copy-Item ".\installer\$AppName-*.msi" -Destination ".\bundle\resources\$AppName.msi" -Force
|
||||||
|
|
||||||
# create bundle including winfsp
|
# create bundle including winfsp
|
||||||
& wix build `
|
Invoke-CommandWithExitCheck -Command `
|
||||||
-define BundleName="$AppName" `
|
"wix" -Arguments @(
|
||||||
-define BundleVersion="$semVerNo.$revisionNo" `
|
"build",
|
||||||
-define BundleVendor="$Vendor" `
|
"-define", "BundleName=$AppName",
|
||||||
-define BundleCopyright="$copyright" `
|
"-define", "BundleVersion=$semVerNo.$revisionNo",
|
||||||
-define AboutUrl="$AboutUrl" `
|
"-define", "BundleVendor=$Vendor",
|
||||||
-define HelpUrl="$HelpUrl" `
|
"-define", "BundleCopyright=$copyright",
|
||||||
-define UpdateUrl="$UpdateUrl" `
|
"-define", "AboutUrl=$AboutUrl",
|
||||||
-ext "WixToolset.Util.wixext" `
|
"-define", "HelpUrl=$HelpUrl",
|
||||||
-ext "WixToolset.BootstrapperApplications.wixext" `
|
"-define", "UpdateUrl=$UpdateUrl",
|
||||||
.\bundle\bundleWithWinfsp.wxs `
|
"-ext", "WixToolset.Util.wixext",
|
||||||
-out "installer\$AppName-Installer.exe"
|
"-ext", "WixToolset.BootstrapperApplications.wixext",
|
||||||
|
".\bundle\bundleWithWinfsp.wxs",
|
||||||
|
"-out", ".\installer\$AppName-Installer.exe"
|
||||||
|
)
|
||||||
|
|
||||||
Write-Host "Created EXE installer .\installer\$AppName-Installer.exe"
|
Write-Host "Created EXE installer .\installer\$AppName-Installer.exe"
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
mime-type=application/vnd.cryptomator.vault
|
mime-type=application/vnd.cryptomator.vault
|
||||||
extension=cryptomator
|
extension=cryptomator
|
||||||
description=Cryptomator Vault File
|
description=Cryptomator Vault File
|
||||||
icon=resources/Cryptomator-Vault.ico
|
icon=C:\\Users\\Arbeit\\Skymatic\\cryptomator-jdk26-jpackage\\dist\\win\\resources\\Cryptomator-Vault.ico
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
mime-type=application/vnd.cryptomator.vault
|
||||||
|
extension=cryptomator
|
||||||
|
description=Cryptomator Vault File
|
||||||
|
icon=${env:JP_WIXWIZARD_RESOURCES_PROPERTIES_FORMAT}Cryptomator-Vault.ico
|
||||||
Vendored
+3
-3
@@ -68,7 +68,7 @@
|
|||||||
<?endif?>
|
<?endif?>
|
||||||
|
|
||||||
<!-- TODO: how does this work again? -->
|
<!-- TODO: how does this work again? -->
|
||||||
<ns0:Binary Id="JpCaDll" SourceFile="$(env.JP_WIXHELPER_DIR)\wixhelper.dll" />
|
<ns0:Binary Id="JpCaDll" SourceFile="$(env.JP_WIXHELPER_DIR)msica.dll"></ns0:Binary>
|
||||||
<ns0:CustomAction Id="JpFindRelatedProducts" BinaryRef="JpCaDll" DllEntry="FindRelatedProductsEx" />
|
<ns0:CustomAction Id="JpFindRelatedProducts" BinaryRef="JpCaDll" DllEntry="FindRelatedProductsEx" />
|
||||||
|
|
||||||
<?ifndef SkipCryptomatorLegacyCheck ?>
|
<?ifndef SkipCryptomatorLegacyCheck ?>
|
||||||
@@ -225,7 +225,7 @@
|
|||||||
<ns0:Custom Action="JpFindRelatedProducts" After="FindRelatedProducts"/>
|
<ns0:Custom Action="JpFindRelatedProducts" After="FindRelatedProducts"/>
|
||||||
</ns0:InstallUISequence>
|
</ns0:InstallUISequence>
|
||||||
|
|
||||||
<ns0:WixVariable Id="WixUIBannerBmp" Value="$(env.JP_WIXWIZARD_RESOURCES)\banner.bmp" />
|
<ns0:WixVariable Id="WixUIBannerBmp" Value="$(env.JP_WIXWIZARD_RESOURCES)banner.bmp" />
|
||||||
<ns0:WixVariable Id="WixUIDialogBmp" Value="$(env.JP_WIXWIZARD_RESOURCES)\background.bmp" />
|
<ns0:WixVariable Id="WixUIDialogBmp" Value="$(env.JP_WIXWIZARD_RESOURCES)background.bmp" />
|
||||||
</ns0:Package>
|
</ns0:Package>
|
||||||
</ns0:Wix>
|
</ns0:Wix>
|
||||||
|
|||||||
Reference in New Issue
Block a user