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 all 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
12 changes: 11 additions & 1 deletion .github/workflows/win-exe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ jobs:
--no-man-pages
--strip-debug
--compress=1
- name: Prepare debug launcher config
shell: bash
run: envsubst '${SEMVER_STR} ${REVISION_NUM} ${APP_NAME} ${LOOPBACK_ALIAS}' < dist/win/resources/debug-launcher.properties > dist/win/resources/CryptomatorDebug.properties
env:
SEMVER_STR: ${{ needs.get-version.outputs.semVerStr }}
REVISION_NUM: ${{ needs.get-version.outputs.revNum }}
APP_NAME: 'Cryptomator'
- name: Run jpackage
run: >
${JAVA_HOME}/bin/jpackage
Expand Down Expand Up @@ -101,6 +108,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 "CryptomatorDebug=CryptomatorDebug.properties"
- name: Patch Application Directory
run: |
cp dist/win/contrib/* appdir/Cryptomator
Expand All @@ -115,7 +123,9 @@ jobs:
exit 1
}
- name: Fix permissions
run: attrib -r appdir/Cryptomator/Cryptomator.exe
run: |
attrib -r appdir/Cryptomator/Cryptomator.exe
attrib -r appdir/Cryptomator/CryptomatorDebug.exe
shell: pwsh
- name: Extract integrations DLL for code signing
shell: pwsh
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
13 changes: 12 additions & 1 deletion dist/win/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ 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"
$debugProps = $debugProps -replace '\${APP_NAME}', "$AppName"
$debugProps = $debugProps -replace '\${LOOPBACK_ALIAS}', "$LoopbackAlias"
Set-Content -Path $buildDir\resources\${AppName}Debug.properties -Value $debugProps


# create app dir
& "$Env:JAVA_HOME\bin\jpackage" `
--verbose `
Expand Down Expand Up @@ -94,7 +103,8 @@ if ($clean -and (Test-Path -Path $appPath)) {
--java-options "-Dcryptomator.showTrayIcon=true" `
--java-options "-Dcryptomator.buildNumber=`"msi-$revisionNo`"" `
--resource-dir resources `
--icon resources/$AppName.ico
--icon resources/$AppName.ico `
--add-launcher "${AppName}Debug=$buildDir\resources\${AppName}Debug.properties"

#Create RTF license for msi
&mvn -B -f $buildDir/../../pom.xml license:add-third-party `
Expand All @@ -109,6 +119,7 @@ if ($clean -and (Test-Path -Path $appPath)) {
# patch app dir
Copy-Item "contrib\*" -Destination "$AppName"
attrib -r "$AppName\$AppName.exe"
attrib -r "$AppName\${AppName}Debug.exe"
# patch batch script to set hostfile
$webDAVPatcher = "$AppName\patchWebDAV.bat"
try {
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/${APP_NAME}" \
-Dcryptomator.pluginDir="~/AppData/Roaming/${APP_NAME}/Plugins" \
-Dcryptomator.settingsPath="~/AppData/Roaming/${APP_NAME}/settings.json" \
-Dcryptomator.ipcSocketPath="~/AppData/Roaming/${APP_NAME}/ipc.socket" \
-Dcryptomator.p12Path="~/AppData/Roaming/${APP_NAME}/key.p12" \
-Dcryptomator.mountPointsDir="~/${APP_NAME}" \
-Dcryptomator.loopbackAlias="${LOOPBACK_ALIAS}" \
-Dcryptomator.integrationsWin.autoStartShellLinkName="${APP_NAME}" \
-Dcryptomator.integrationsWin.keychainPaths="~/AppData/Roaming/${APP_NAME}/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.

Loading