Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Windows debug launcher #2666

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/win-exe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ jobs:
--no-man-pages
--strip-debug
--compress=1
- name: Prepare debug launcher config
shell: bash
run: envsubst '${SEMVER_STR} ${REVISION_NUM}' < dist/win/resources/debug-launcher.properties > debug-launcher.properties
env:
SEMVER_STR: ${{ needs.get-version.outputs.semVerStr }}
REVISION_NUM: ${{ needs.get-version.outputs.revNum }}
infeo marked this conversation as resolved.
Show resolved Hide resolved
- name: Run jpackage
run: >
${JAVA_HOME}/bin/jpackage
Expand Down Expand Up @@ -101,6 +107,7 @@ jobs:
--java-options "-Dcryptomator.integrationsWin.keychainPaths=\"~/AppData/Roaming/Cryptomator/keychain.json\""
--resource-dir dist/win/resources
--icon dist/win/resources/Cryptomator.ico
--add-launcher debug=debug-launcher.properties
- name: Patch Application Directory
run: |
cp dist/win/contrib/* appdir/Cryptomator
Expand Down
3 changes: 2 additions & 1 deletion dist/win/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ installer
*.wixobj
*.pdb
*.msi
license.rtf
license.rtf
debug.properties
7 changes: 7 additions & 0 deletions dist/win/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ if ($clean -and (Test-Path -Path $appPath)) {
Remove-Item -Path $appPath -Force -Recurse
}

# prepare additional launcher
$debugProps = Get-Content -Path $buildDir\resources\debug-launcher.properties
$debugProps = $debugProps -replace '\${SEM_VER_STR}', "$semVerNo"
$debugProps = $debugProps -replace '\${REVISION_NUM}', "$revisionNo"
Set-Content -Path $buildDir\resources\debug.properties -Value $debugProps

# create app dir
& "$Env:JAVA_HOME\bin\jpackage" `
--verbose `
Expand Down Expand Up @@ -93,6 +99,7 @@ if ($clean -and (Test-Path -Path $appPath)) {
--java-options "-Dcryptomator.integrationsWin.keychainPaths=`"~/AppData/Roaming/$AppName/keychain.json`"" `
--java-options "-Dcryptomator.showTrayIcon=true" `
--java-options "-Dcryptomator.buildNumber=`"msi-$revisionNo`"" `
--add-launcher debug=$buildDir\resources\debug.properties `
--resource-dir resources `
--icon resources/$AppName.ico

Expand Down
18 changes: 18 additions & 0 deletions dist/win/resources/debug-launcher.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
win-console=true
java-options=--enable-preview \
--enable-native-access=org.cryptomator.jfuse.win \
-Xss5m \
-Xmx256m \
-Dcryptomator.appVersion="${SEM_VER_STR}" \
-Dfile.encoding="utf-8" \
-Dcryptomator.logDir="~/AppData/Roaming/$AppName" \
-Dcryptomator.pluginDir="~/AppData/Roaming/$AppName/Plugins" \
-Dcryptomator.settingsPath="~/AppData/Roaming/$AppName/settings.json" \
-Dcryptomator.ipcSocketPath="~/AppData/Roaming/$AppName/ipc.socket" \
-Dcryptomator.p12Path="~/AppData/Roaming/$AppName/key.p12" \
-Dcryptomator.mountPointsDir="~/$AppName" \
-Dcryptomator.loopbackAlias="$LoopbackAlias" \
-Dcryptomator.integrationsWin.autoStartShellLinkName="$AppName" \
-Dcryptomator.integrationsWin.keychainPaths="~/AppData/Roaming/$AppName/keychain.json" \
-Dcryptomator.showTrayIcon=true \
-Dcryptomator.buildNumber="msi-${REVISION_NUM}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might even add -dbg here, what do you think?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean a new jvm property (e.g., cryptomator.dbg) which is read by the application?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No just the build number, so we know whether people started the debug launcher

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, got it! Yes, that's a good idea.