From a8b920698d680b8b3c33e995f5371d865daf8eb3 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Tue, 10 May 2022 16:32:59 +0200 Subject: [PATCH 1/9] Generify error message in installer --- dist/win/resources/customWizard.wxi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/win/resources/customWizard.wxi b/dist/win/resources/customWizard.wxi index ce82c2933..0cd34e44f 100644 --- a/dist/win/resources/customWizard.wxi +++ b/dist/win/resources/customWizard.wxi @@ -91,7 +91,7 @@ FOUNDRUNNINGAPP From 67027476527935b80d8dd52cb90454a8185d03c9 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Tue, 10 May 2022 18:35:04 +0200 Subject: [PATCH 2/9] separate cryptomator labels and asset paths from installer file --- dist/win/resources/main.wxs | 16 ++++++------- dist/win/resources/overrides.wxi | 39 ++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 8 deletions(-) create mode 100644 dist/win/resources/overrides.wxi diff --git a/dist/win/resources/main.wxs b/dist/win/resources/main.wxs index 09b555caa..6df4439ab 100644 --- a/dist/win/resources/main.wxs +++ b/dist/win/resources/main.wxs @@ -86,12 +86,12 @@ - - - - + + + + - + @@ -130,12 +130,12 @@ diff --git a/dist/win/resources/overrides.wxi b/dist/win/resources/overrides.wxi new file mode 100644 index 000000000..3328ccec2 --- /dev/null +++ b/dist/win/resources/overrides.wxi @@ -0,0 +1,39 @@ + + + + + + + + + + + + From a29f10a5048a2421e33ab8934feec16e3f913081 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Wed, 11 May 2022 12:22:29 +0200 Subject: [PATCH 3/9] refactor build scipt to be easiert customizable --- dist/win/build.bat | 15 +++++++- dist/win/build.ps1 | 61 +++++++++++++++++--------------- dist/win/resources/main.wxs | 2 +- dist/win/resources/overrides.wxi | 1 - 4 files changed, 47 insertions(+), 32 deletions(-) diff --git a/dist/win/build.bat b/dist/win/build.bat index 8ca9183b4..84013ec1b 100644 --- a/dist/win/build.bat +++ b/dist/win/build.bat @@ -1,2 +1,15 @@ @echo off -powershell -NoLogo -NoExit -ExecutionPolicy Unrestricted -Command .\build.ps1 \ No newline at end of file +SET APPNAME="Cryptomator" +SET VENDOR="Skymatic GmbH" +SET FIRST_COPYRIGHT_YEAR=2016 +SET ABOUT_URL="https://cryptomator.org" +SET UPDATE_URL="https://cryptomator.org/downloads/" +SET HELP_URL="https://cryptomator.org/contact/" +powershell -NoLogo -NoExit -ExecutionPolicy Unrestricted -Command .\build.ps1^ + -AppName %APPNAME%^ + -Vendor "%VENDOR%"^ + -CopyrightStartYear %FIRST_COPYRIGHT_YEAR%^ + -AboutUrl "%ABOUT_URL%"^ + -HelpUrl "%HELP_URL%"^ + -UpdateUrl "%UPDATE_URL%"^ + -Clean 1 \ No newline at end of file diff --git a/dist/win/build.ps1 b/dist/win/build.ps1 index abecdef61..84900f9ff 100644 --- a/dist/win/build.ps1 +++ b/dist/win/build.ps1 @@ -1,5 +1,13 @@ -# check parameters -$clean = $args[0] -eq "fresh" +Param( + [Parameter(Mandatory, HelpMessage="Please provide a name for the app")][string] $AppName, + [Parameter(Mandatory, HelpMessage="Please provide a valud path to an icon file")][string] $IconPath, + [Parameter(Mandatory, HelpMessage="Please provide the name of the vendor")][string] $Vendor, + [Parameter(Mandatory, HelpMessage="Please provide the starting year for the copyright notice")][int] $CopyrightStartYear, + [Parameter(Mandatory, HelpMessage="Please provide a help url")][string] $HelpUrl, + [Parameter(Mandatory, HelpMessage="Please provide an update url")][string] $UpdateUrl, + [Parameter(Mandatory, HelpMessage="Please provide an about url")][string] $AboutUrl, + [bool] $clean +) # check preconditions if ((Get-Command "git" -ErrorAction SilentlyContinue) -eq $null) @@ -24,8 +32,7 @@ Write-Output "`$revisionNo=$revisionNo" Write-Output "`$buildDir=$buildDir" Write-Output "`$Env:JAVA_HOME=$Env:JAVA_HOME" -$vendor = "Skymatic GmbH" -$copyright = "(C) 2016 - 2022 Skymatic GmbH" +$copyright = "(C) $CopyrightStartYear - $((Get-Date).Year) $Vendor" # compile &mvn -B -f $buildDir/../../pom.xml clean package -DskipTests -Pwin @@ -48,7 +55,7 @@ if ($clean -and (Test-Path -Path $runtimeImagePath)) { --strip-debug ` --compress=1 -$appPath = '.\Cryptomator' +$appPath = ".\$AppName" if ($clean -and (Test-Path -Path $appPath)) { Remove-Item -Path $appPath -Force -Recurse } @@ -62,20 +69,20 @@ if ($clean -and (Test-Path -Path $appPath)) { --module-path ../../target/mods ` --module org.cryptomator.desktop/org.cryptomator.launcher.Cryptomator ` --dest . ` - --name Cryptomator ` - --vendor $vendor ` + --name $AppName ` + --vendor $Vendor ` --copyright $copyright ` --java-options "-Xss5m" ` --java-options "-Xmx256m" ` --java-options "-Dcryptomator.appVersion=`"$semVerNo`"" ` --app-version "$semVerNo.$revisionNo" ` --java-options "-Dfile.encoding=`"utf-8`"" ` - --java-options "-Dcryptomator.logDir=`"~/AppData/Roaming/Cryptomator`"" ` - --java-options "-Dcryptomator.pluginDir=`"~/AppData/Roaming/Cryptomator/Plugins`"" ` - --java-options "-Dcryptomator.settingsPath=`"~/AppData/Roaming/Cryptomator/settings.json`"" ` - --java-options "-Dcryptomator.ipcSocketPath=`"~/AppData/Roaming/Cryptomator/ipc.socket`"" ` - --java-options "-Dcryptomator.keychainPath=`"~/AppData/Roaming/Cryptomator/keychain.json`"" ` - --java-options "-Dcryptomator.mountPointsDir=`"~/Cryptomator`"" ` + --java-options "-Dcryptomator.logDir=`"~/AppData/Roaming/$AppName`"" ` + --java-options "-Dcryptomator.pluginDir=`"~/AppData/Roaming/$AppName/Plugins`"" ` + --java-options "-Dcryptomator.settingsPath=`"~/AppData/Roaming/$AppName/settings.json`"" ` + --java-options "-Dcryptomator.ipcSocketPath=`"~/AppData/Roaming/$AppName/ipc.socket`"" ` + --java-options "-Dcryptomator.keychainPath=`"~/AppData/Roaming/$AppName/keychain.json`"" ` + --java-options "-Dcryptomator.mountPointsDir=`"~/$AppName`"" ` --java-options "-Dcryptomator.showTrayIcon=true" ` --java-options "-Dcryptomator.buildNumber=`"msi-$revisionNo`"" ` --resource-dir resources ` @@ -92,12 +99,8 @@ if ($clean -and (Test-Path -Path $appPath)) { "-Dlicense.licenseMergesUrl=file:///$buildDir/../../license/merges" # patch app dir -Copy-Item "contrib\*" -Destination "Cryptomator" -attrib -r "Cryptomator\Cryptomator.exe" - -$aboutUrl="https://cryptomator.org" -$updateUrl="https://cryptomator.org/downloads/" -$helpUrl="https://cryptomator.org/contact/" +Copy-Item "contrib\*" -Destination "$AppName" +attrib -r "$AppName\$AppName.exe" # create .msi $Env:JP_WIXWIZARD_RESOURCES = "$buildDir\resources" @@ -107,18 +110,18 @@ $Env:JP_WIXWIZARD_RESOURCES = "$buildDir\resources" --win-upgrade-uuid bda45523-42b1-4cae-9354-a45475ed4775 ` --app-image Cryptomator ` --dest installer ` - --name Cryptomator ` - --vendor $vendor ` + --name $AppName ` + --vendor $Vendor ` --copyright $copyright ` --app-version "$semVerNo" ` --win-menu ` --win-dir-chooser ` --win-shortcut-prompt ` - --win-update-url $updateUrl ` - --win-menu-group Cryptomator ` + --win-menu-group $AppName ` --resource-dir resources ` - --about-url $aboutUrl ` --license-file resources/license.rtf ` + --win-update-url $UpdateUrl ` + --about-url $AboutUrl ` --file-associations resources/FAvaultFile.properties #Create RTF license for bundle @@ -139,14 +142,14 @@ Write-Output "Downloading ${winfspMsiUrl}..." Invoke-WebRequest $winfspMsiUrl -OutFile ".\bundle\resources\winfsp.msi" # redirects are followed by default # copy MSI to bundle resources -Copy-Item ".\installer\Cryptomator-*.msi" -Destination ".\bundle\resources\Cryptomator.msi" +Copy-Item ".\installer\$AppName-*.msi" -Destination ".\bundle\resources\$AppName.msi" # create bundle including winfsp & "$env:WIX\bin\candle.exe" .\bundle\bundleWithWinfsp.wxs -ext WixBalExtension -out bundle\ ` -dBundleVersion="$semVerNo.$revisionNo" ` - -dBundleVendor="$vendor" ` + -dBundleVendor="$Vendor" ` -dBundleCopyright="$copyright" ` - -dAboutUrl="$aboutUrl" ` - -dHelpUrl="$helpUrl" ` - -dUpdateUrl="$updateUrl" + -dAboutUrl="$AboutUrl" ` + -dHelpUrl="$HelpUrl" ` + -dUpdateUrl="$UpdateUrl" & "$env:WIX\bin\light.exe" -b . .\bundle\BundlewithWinfsp.wixobj -ext WixBalExtension -out installer\Cryptomator-Installer.exe \ No newline at end of file diff --git a/dist/win/resources/main.wxs b/dist/win/resources/main.wxs index 6df4439ab..26f968fbd 100644 --- a/dist/win/resources/main.wxs +++ b/dist/win/resources/main.wxs @@ -86,7 +86,7 @@ - + diff --git a/dist/win/resources/overrides.wxi b/dist/win/resources/overrides.wxi index 3328ccec2..41194fa05 100644 --- a/dist/win/resources/overrides.wxi +++ b/dist/win/resources/overrides.wxi @@ -31,7 +31,6 @@ Default value is `yes`. --> - From 90d43f28d9bfac49c968f727060e1b33fe8681e6 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Wed, 11 May 2022 12:25:53 +0200 Subject: [PATCH 4/9] eradicate last hard coded app name occurences in build script --- dist/win/build.ps1 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dist/win/build.ps1 b/dist/win/build.ps1 index 84900f9ff..25b4cfea8 100644 --- a/dist/win/build.ps1 +++ b/dist/win/build.ps1 @@ -1,6 +1,5 @@ Param( [Parameter(Mandatory, HelpMessage="Please provide a name for the app")][string] $AppName, - [Parameter(Mandatory, HelpMessage="Please provide a valud path to an icon file")][string] $IconPath, [Parameter(Mandatory, HelpMessage="Please provide the name of the vendor")][string] $Vendor, [Parameter(Mandatory, HelpMessage="Please provide the starting year for the copyright notice")][int] $CopyrightStartYear, [Parameter(Mandatory, HelpMessage="Please provide a help url")][string] $HelpUrl, @@ -86,7 +85,7 @@ if ($clean -and (Test-Path -Path $appPath)) { --java-options "-Dcryptomator.showTrayIcon=true" ` --java-options "-Dcryptomator.buildNumber=`"msi-$revisionNo`"" ` --resource-dir resources ` - --icon resources/Cryptomator.ico + --icon resources/$AppName.ico #Create RTF license for msi &mvn -B -f $buildDir/../../pom.xml license:add-third-party ` @@ -108,7 +107,7 @@ $Env:JP_WIXWIZARD_RESOURCES = "$buildDir\resources" --verbose ` --type msi ` --win-upgrade-uuid bda45523-42b1-4cae-9354-a45475ed4775 ` - --app-image Cryptomator ` + --app-image $AppName ` --dest installer ` --name $AppName ` --vendor $Vendor ` @@ -152,4 +151,4 @@ Copy-Item ".\installer\$AppName-*.msi" -Destination ".\bundle\resources\$AppName -dAboutUrl="$AboutUrl" ` -dHelpUrl="$HelpUrl" ` -dUpdateUrl="$UpdateUrl" -& "$env:WIX\bin\light.exe" -b . .\bundle\BundlewithWinfsp.wixobj -ext WixBalExtension -out installer\Cryptomator-Installer.exe \ No newline at end of file +& "$env:WIX\bin\light.exe" -b . .\bundle\BundlewithWinfsp.wixobj -ext WixBalExtension -out installer\$AppName-Installer.exe \ No newline at end of file From 0f88e6c2fe44e39824146bed5b72e2f8a72e31cf Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Wed, 11 May 2022 12:48:56 +0200 Subject: [PATCH 5/9] fix errors --- dist/win/build.bat | 2 +- dist/win/resources/main.wxs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/win/build.bat b/dist/win/build.bat index 84013ec1b..b65bda600 100644 --- a/dist/win/build.bat +++ b/dist/win/build.bat @@ -7,7 +7,7 @@ SET UPDATE_URL="https://cryptomator.org/downloads/" SET HELP_URL="https://cryptomator.org/contact/" powershell -NoLogo -NoExit -ExecutionPolicy Unrestricted -Command .\build.ps1^ -AppName %APPNAME%^ - -Vendor "%VENDOR%"^ + -Vendor ""%VENDOR%""^ -CopyrightStartYear %FIRST_COPYRIGHT_YEAR%^ -AboutUrl "%ABOUT_URL%"^ -HelpUrl "%HELP_URL%"^ diff --git a/dist/win/resources/main.wxs b/dist/win/resources/main.wxs index 26f968fbd..9397bab8a 100644 --- a/dist/win/resources/main.wxs +++ b/dist/win/resources/main.wxs @@ -86,7 +86,7 @@ - + From 80696972cb433d569e64495489878244f32839d5 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Wed, 11 May 2022 13:00:32 +0200 Subject: [PATCH 6/9] allow upgrade-uuid to be customized in build script --- dist/win/build.bat | 4 ++++ dist/win/build.ps1 | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dist/win/build.bat b/dist/win/build.bat index b65bda600..b2ec68225 100644 --- a/dist/win/build.bat +++ b/dist/win/build.bat @@ -1,12 +1,16 @@ @echo off +:: Default values for Cryptomator builds SET APPNAME="Cryptomator" +SET UPGRADE_UUID="bda45523-42b1-4cae-9354-a45475ed4775" SET VENDOR="Skymatic GmbH" SET FIRST_COPYRIGHT_YEAR=2016 SET ABOUT_URL="https://cryptomator.org" SET UPDATE_URL="https://cryptomator.org/downloads/" SET HELP_URL="https://cryptomator.org/contact/" + powershell -NoLogo -NoExit -ExecutionPolicy Unrestricted -Command .\build.ps1^ -AppName %APPNAME%^ + -UpgradeUUID "%UPGRADE_UUID%"^ -Vendor ""%VENDOR%""^ -CopyrightStartYear %FIRST_COPYRIGHT_YEAR%^ -AboutUrl "%ABOUT_URL%"^ diff --git a/dist/win/build.ps1 b/dist/win/build.ps1 index 7e812ebb2..23c897ab6 100644 --- a/dist/win/build.ps1 +++ b/dist/win/build.ps1 @@ -1,5 +1,6 @@ Param( [Parameter(Mandatory, HelpMessage="Please provide a name for the app")][string] $AppName, + [Parameter(Mandatory, HelpMessage="Please provide the windows upgrade uuid for the app")][string] $UpgradeUUID, [Parameter(Mandatory, HelpMessage="Please provide the name of the vendor")][string] $Vendor, [Parameter(Mandatory, HelpMessage="Please provide the starting year for the copyright notice")][int] $CopyrightStartYear, [Parameter(Mandatory, HelpMessage="Please provide a help url")][string] $HelpUrl, @@ -107,7 +108,7 @@ $Env:JP_WIXWIZARD_RESOURCES = "$buildDir\resources" & "$Env:JAVA_HOME\bin\jpackage" ` --verbose ` --type msi ` - --win-upgrade-uuid bda45523-42b1-4cae-9354-a45475ed4775 ` + --win-upgrade-uuid $UpgradeUUID ` --app-image $AppName ` --dest installer ` --name $AppName ` From 7dfc4d9ded30d233e5d06e359dd96eccdf84c92c Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 12 May 2022 09:14:03 +0200 Subject: [PATCH 7/9] allow custom name for c9r/c9s icon file --- dist/win/resources/main.wxs | 2 +- dist/win/resources/overrides.wxi | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dist/win/resources/main.wxs b/dist/win/resources/main.wxs index 9397bab8a..b8703a14d 100644 --- a/dist/win/resources/main.wxs +++ b/dist/win/resources/main.wxs @@ -86,7 +86,7 @@ - + diff --git a/dist/win/resources/overrides.wxi b/dist/win/resources/overrides.wxi index 41194fa05..60133a35b 100644 --- a/dist/win/resources/overrides.wxi +++ b/dist/win/resources/overrides.wxi @@ -31,6 +31,7 @@ Default value is `yes`. --> + From 3e6d81ef1bb08b1c6d0693d3797f731003902f31 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 12 May 2022 09:15:04 +0200 Subject: [PATCH 8/9] Use parameter for main jar glob pattern --- dist/win/build.bat | 2 ++ dist/win/build.ps1 | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dist/win/build.bat b/dist/win/build.bat index b2ec68225..0c6e14cee 100644 --- a/dist/win/build.bat +++ b/dist/win/build.bat @@ -1,6 +1,7 @@ @echo off :: Default values for Cryptomator builds SET APPNAME="Cryptomator" +SET MAIN_JAR_GLOB="cryptomator-*" SET UPGRADE_UUID="bda45523-42b1-4cae-9354-a45475ed4775" SET VENDOR="Skymatic GmbH" SET FIRST_COPYRIGHT_YEAR=2016 @@ -10,6 +11,7 @@ SET HELP_URL="https://cryptomator.org/contact/" powershell -NoLogo -NoExit -ExecutionPolicy Unrestricted -Command .\build.ps1^ -AppName %APPNAME%^ + -MainJarGlob "%MAIN_JAR_GLOB%"^ -UpgradeUUID "%UPGRADE_UUID%"^ -Vendor ""%VENDOR%""^ -CopyrightStartYear %FIRST_COPYRIGHT_YEAR%^ diff --git a/dist/win/build.ps1 b/dist/win/build.ps1 index 23c897ab6..cfbd07244 100644 --- a/dist/win/build.ps1 +++ b/dist/win/build.ps1 @@ -1,6 +1,7 @@ Param( [Parameter(Mandatory, HelpMessage="Please provide a name for the app")][string] $AppName, - [Parameter(Mandatory, HelpMessage="Please provide the windows upgrade uuid for the app")][string] $UpgradeUUID, + [Parameter(Mandatory, HelpMessage="Please provide the glob pattern to identify the main jar")][string] $MainJarGlob, + [Parameter(Mandatory, HelpMessage="Please provide the windows upgrade uuid for the installer")][string] $UpgradeUUID, [Parameter(Mandatory, HelpMessage="Please provide the name of the vendor")][string] $Vendor, [Parameter(Mandatory, HelpMessage="Please provide the starting year for the copyright notice")][int] $CopyrightStartYear, [Parameter(Mandatory, HelpMessage="Please provide a help url")][string] $HelpUrl, @@ -36,7 +37,7 @@ $copyright = "(C) $CopyrightStartYear - $((Get-Date).Year) $Vendor" # compile &mvn -B -f $buildDir/../../pom.xml clean package -DskipTests -Pwin -Copy-Item "$buildDir\..\..\target\cryptomator-*.jar" -Destination "$buildDir\..\..\target\mods" +Copy-Item "$buildDir\..\..\target\$MainJarGlob.jar" -Destination "$buildDir\..\..\target\mods" # add runtime $runtimeImagePath = '.\runtime' From 75093f1c09f322aab752bdb6bb59e089565042d6 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 12 May 2022 16:12:20 +0200 Subject: [PATCH 9/9] Make lauchner class configurable --- dist/win/build.bat | 2 ++ dist/win/build.ps1 | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dist/win/build.bat b/dist/win/build.bat index 0c6e14cee..c97ebbb35 100644 --- a/dist/win/build.bat +++ b/dist/win/build.bat @@ -8,10 +8,12 @@ SET FIRST_COPYRIGHT_YEAR=2016 SET ABOUT_URL="https://cryptomator.org" SET UPDATE_URL="https://cryptomator.org/downloads/" SET HELP_URL="https://cryptomator.org/contact/" +SET MODULE_AND_MAIN_CLASS="org.cryptomator.desktop/org.cryptomator.launcher.Cryptomator" powershell -NoLogo -NoExit -ExecutionPolicy Unrestricted -Command .\build.ps1^ -AppName %APPNAME%^ -MainJarGlob "%MAIN_JAR_GLOB%"^ + -ModuleAndMainClass "%MODULE_AND_MAIN_CLASS%"^ -UpgradeUUID "%UPGRADE_UUID%"^ -Vendor ""%VENDOR%""^ -CopyrightStartYear %FIRST_COPYRIGHT_YEAR%^ diff --git a/dist/win/build.ps1 b/dist/win/build.ps1 index cfbd07244..78a5b5bb8 100644 --- a/dist/win/build.ps1 +++ b/dist/win/build.ps1 @@ -1,6 +1,7 @@ Param( [Parameter(Mandatory, HelpMessage="Please provide a name for the app")][string] $AppName, [Parameter(Mandatory, HelpMessage="Please provide the glob pattern to identify the main jar")][string] $MainJarGlob, + [Parameter(Mandatory, HelpMessage="Please provide the module- and main class path to start the app")][string] $ModuleAndMainClass, [Parameter(Mandatory, HelpMessage="Please provide the windows upgrade uuid for the installer")][string] $UpgradeUUID, [Parameter(Mandatory, HelpMessage="Please provide the name of the vendor")][string] $Vendor, [Parameter(Mandatory, HelpMessage="Please provide the starting year for the copyright notice")][int] $CopyrightStartYear, @@ -68,7 +69,7 @@ if ($clean -and (Test-Path -Path $appPath)) { --runtime-image runtime ` --input ../../target/libs ` --module-path ../../target/mods ` - --module org.cryptomator.desktop/org.cryptomator.launcher.Cryptomator ` + --module $ModuleAndMainClass ` --dest . ` --name $AppName ` --vendor $Vendor ` @@ -109,7 +110,7 @@ $Env:JP_WIXWIZARD_RESOURCES = "$buildDir\resources" & "$Env:JAVA_HOME\bin\jpackage" ` --verbose ` --type msi ` - --win-upgrade-uuid $UpgradeUUID ` + --win-upgrade-uuid $UpgradeUUID ` --app-image $AppName ` --dest installer ` --name $AppName `