From 8ba046c048509e1d8047c3edb3a0287bc3f5c0cc Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Sun, 6 Oct 2019 22:28:35 +0200 Subject: [PATCH 1/2] Fix JabFox integration With the new jpackage build JabFox stopped working because the registry values were not specified correctly. This fixes #4303 and fixes #4737. Moreover, the correct icon is now displayed in the installer. --- CHANGELOG.md | 1 + build.gradle | 17 +++++++++++- buildres/JabRef-post-image.wsf | 35 ++++++++++++++++++++++++ buildres/{JabRef.bat => JabRefHost.bat} | 2 +- buildres/{JabRef.ps1 => JabRefHost.ps1} | 15 +++++----- buildres/JabRefTopBanner.bmp | Bin 0 -> 85894 bytes buildres/jabref.json | 2 +- 7 files changed, 61 insertions(+), 11 deletions(-) create mode 100644 buildres/JabRef-post-image.wsf rename buildres/{JabRef.bat => JabRefHost.bat} (60%) rename buildres/{JabRef.ps1 => JabRefHost.ps1} (72%) create mode 100644 buildres/JabRefTopBanner.bmp diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a4e50fdea6..5da79394ebc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# - We fixed an issue where it was no longer possible to connect to LibreOffice. [#5261](https://github.com/JabRef/jabref/issues/5261) - The "All entries group" is no longer shown when no library is open. - We fixed an exception which occurred when closing JabRef. [#5348](https://github.com/JabRef/jabref/issues/5348) +- We fixed a few problems that prevented JabFox to communicate with JabRef. [#4737](https://github.com/JabRef/jabref/issues/4737) [#4303](https://github.com/JabRef/jabref/issues/4303) - We fixed an error where the groups containing an entry loose their highlight color when scrolling. [#5022](https://github.com/JabRef/jabref/issues/5022) - After assigning an entry to a group, the item count is now properly colored to reflect the new membership of the entry. [#3112](https://github.com/JabRef/jabref/issues/3112) - The group panel is now properly updated when switching between libraries (or when closing/opening one). [#3142](https://github.com/JabRef/jabref/issues/3142) diff --git a/build.gradle b/build.gradle index b3d7851f76a..6ee658af349 100644 --- a/build.gradle +++ b/build.gradle @@ -514,6 +514,11 @@ task generateFinalJabRefPS1File(type: Copy) { filter(org.apache.tools.ant.filters.ReplaceTokens, tokens: [jabRefJarFileName: jar.archiveName]) } +task deleteInstallerTemp(type: Delete) { + delete "$buildDir/installer" +} + +jpackage.dependsOn deleteInstallerTemp jlink { options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages'] launcher { @@ -584,7 +589,9 @@ jlink { '--app-version', "${project.version}", '--win-upgrade-uuid', 'd636b4ee-6f10-451e-bf57-c89656780e36', '--win-dir-chooser', - '--win-shortcut' + '--win-shortcut', + '--temp', "$buildDir/installer", + '--resource-dir', "${projectDir}/buildres" ] } @@ -609,6 +616,14 @@ jlink { } } } +tasks.jpackageImage.doLast { + copy { + from("/buildres/") { + include "jabref.json", "JabRefHost.bat", "JabRefHost.ps1" + } + into "$buildDir/distribution/JabRef" + } +} jmh { warmupIterations = 5 diff --git a/buildres/JabRef-post-image.wsf b/buildres/JabRef-post-image.wsf new file mode 100644 index 00000000000..56ddd9097f4 --- /dev/null +++ b/buildres/JabRef-post-image.wsf @@ -0,0 +1,35 @@ + + + + + + diff --git a/buildres/JabRef.bat b/buildres/JabRefHost.bat similarity index 60% rename from buildres/JabRef.bat rename to buildres/JabRefHost.bat index 7a2cee363b0..d44d94f282c 100644 --- a/buildres/JabRef.bat +++ b/buildres/JabRefHost.bat @@ -1,3 +1,3 @@ @echo off pushd %~dp0 -@powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -WindowStyle Hidden -File ".\JabRef.ps1" +@powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -WindowStyle Hidden -File ".\JabRefHost.ps1" diff --git a/buildres/JabRef.ps1 b/buildres/JabRefHost.ps1 similarity index 72% rename from buildres/JabRef.ps1 rename to buildres/JabRefHost.ps1 index fe814e6013e..f31df86f74e 100644 --- a/buildres/JabRef.ps1 +++ b/buildres/JabRefHost.ps1 @@ -11,8 +11,7 @@ function Respond($response) { } } -$jabRefJarFileName = "@jabRefJarFileName@" -$jabRefJar = [System.IO.Path]::Combine($PSScriptRoot, $jabRefJarFileName) +$jabRefExe = [System.IO.Path]::Combine($PSScriptRoot, "JabRef.exe") try { $reader = New-Object System.IO.BinaryReader([System.Console]::OpenStandardInput()) @@ -21,16 +20,16 @@ try { $message = $messageRaw | ConvertFrom-Json if ($message.Status -eq "validate") { - if (-not (Test-Path $jabRefJar)) { - return Respond @{message="jarNotFound";path=$jabRefJar} + if (-not (Test-Path $jabRefExe)) { + return Respond @{message="jarNotFound";path=$jabRefExe} } else { return Respond @{message="jarFound"} } } - - if (-not (Test-Path $jabRefJar)) { + + if (-not (Test-Path $jabRefExe)) { $wshell = New-Object -ComObject Wscript.Shell - $popup = "Unable to locate '$jabRefJarFileName' in '$([System.IO.Path]::GetDirectoryName($jabRefJar))'." + $popup = "Unable to locate '$jabRefExe'." $wshell.Popup($popup,0,"JabRef", 0x0 + 0x30) return } @@ -39,7 +38,7 @@ try { #$wshell.Popup($message.Text,0,"JabRef", 0x0 + 0x30) $messageText = $message.Text - $output = & java -jar $jabRefJar -importBibtex "$messageText" 2>&1 + $output = & $jabRefExe -importBibtex "$messageText" 2>&1 #$output = & echoargs -importBibtex $messageText 2>&1 #$wshell.Popup($output,0,"JabRef", 0x0 + 0x30) return Respond @{message="ok";output="$output"} diff --git a/buildres/JabRefTopBanner.bmp b/buildres/JabRefTopBanner.bmp new file mode 100644 index 0000000000000000000000000000000000000000..7e95c3b8fd763ce3cdc4b35620daf7902dcd8df4 GIT binary patch literal 85894 zcmeI5S65V77RT)`FwgT5<`c}rJkI;9wu5$38w{W#X2hIR8;OGCjDmm)hy+1`0-}KA zoHGaMA7p{nFiYh9dO3-EgDo^$X0QR{y<`|R-V|6Kk0s||+NKl%O#-#Y&L zFaG^%!{7O7d=>m{!v@3mAFq${5&}X%2nd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;08fMacZOKEK%}>jyIJSQDOzt*xzNVp~}jibM#rITyl)`7beDpxH&z%?A}^YYF_1v zNifN=$MJEe2YRC8r2c0|1R&)m&k34th=Fnbku0P%|JyaMaz^^P^|V^Xo;UP)p5s}< zPxUSnqT`zW2+G9?0U@wf1W?bh!GY?6Y&;&+S3z)>DU#)|k%CsNPm;rlcRM}ElYkSv zF{SCr^K*aoei*w+M4vs3Qe)9~*1X3^Zzz5hMFh*z8mURp*)Rq*1|Qz}==vF=S@7hT zKNS@3QFL4ppbQrRLSTImKxE%Ne?s)gUrcYK+8SdApWMBKBOA%?Z)=LXdIE#`-kzT_ zLcEu)9*(6?Hc)YLJYIF=o)GoAqWlTnAPGcR`nbrcqwAH52ZEK2;Y?t7PE;TnnEma|)E4iquP#iAi9UCPs6o8j z5hq>A48pRu@t!fjiHCV`+1S3beRuRboLO=+72?S=RrkYBNbD{!X#sm}dXAB-kf4l0c@wYs_bJ5>*>s`lh z$ifZeW%5bwV_)KFhOG z@z;OW{1y%t9k&2S-Vy>r;L9PP|FDR3j`a7Sss#Ma&CF2fih?SSemfg@XgfwU?v&UI zZUym?#Dg13VtxLLAVQ)Ki8rUDZNLFX)ZE{7+k=bl&}`A_Rs{5XhPK+ zHe?0#u7F%}Az96`m0KZLVQf zju9Kr1LmBWm>BG6Yb<$%Q=V>cb|NY|ZYQuZtq>3bnkKNMvkM0KRyV*c-zb7^NW)(X nOMitEiH@%TMs^DUAs__S2?5dZb@Gdn%M=1aKnScrV8ed_Z^w(k literal 0 HcmV?d00001 diff --git a/buildres/jabref.json b/buildres/jabref.json index dee50f008fe..9024c5b17f4 100644 --- a/buildres/jabref.json +++ b/buildres/jabref.json @@ -1,7 +1,7 @@ { "name": "org.jabref.jabref", "description": "JabRef", - "path": "JabRef.bat", + "path": "JabRefHost.bat", "type": "stdio", "allowed_extensions": [ "@jabfox" From a6948ea0de5c8f13da452a5f029129952cc99ca3 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Sun, 6 Oct 2019 22:32:47 +0200 Subject: [PATCH 2/2] Remove unnecessary code --- build.gradle | 8 -------- 1 file changed, 8 deletions(-) diff --git a/build.gradle b/build.gradle index 6ee658af349..7192e613482 100644 --- a/build.gradle +++ b/build.gradle @@ -506,14 +506,6 @@ modernizer { } // Release tasks -task generateFinalJabRefPS1File(type: Copy) { - from('buildres') { - include 'JabRef.ps1' - } - into 'build' - filter(org.apache.tools.ant.filters.ReplaceTokens, tokens: [jabRefJarFileName: jar.archiveName]) -} - task deleteInstallerTemp(type: Delete) { delete "$buildDir/installer" }