Skip to content

Fix JabRef-post-image.wsf to make it agnostic to the location of the …#13033

Draft
alexeysemenyukoracle wants to merge 95 commits intoJabRef:mainfrom
alexeysemenyukoracle:fix-jpackage-post-image
Draft

Fix JabRef-post-image.wsf to make it agnostic to the location of the …#13033
alexeysemenyukoracle wants to merge 95 commits intoJabRef:mainfrom
alexeysemenyukoracle:fix-jpackage-post-image

Conversation

@alexeysemenyukoracle
Copy link
Copy Markdown

@alexeysemenyukoracle alexeysemenyukoracle commented Apr 29, 2025

Fix JabRef-post-image.wsf script to make it independent of the project build location.

Build-only change to eliminate dependencies on the context in which the "post-image" jpackage script is called on Windows.

Closes #13034

Important: the baseline for the fix is v6.0-alpha2 tag. There is no JabRef-post-image.wsf in the main branch after #12990, so this PR can not be integrated as-is.

Mandatory checks

  • I own the copyright of the code submitted and I license it under the MIT license
  • [/] Change in CHANGELOG.md described in a way that is understandable for the average user (if change is visible to the user)
  • [/] Tests created for changes (if applicable)
  • [/] Manually tested changed features in running JabRef (always required)
  • [/] Screenshots added in PR description (if change is visible to the user)
  • [/] Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • [/] Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

@Siedlerchr
Copy link
Copy Markdown
Member

Siedlerchr commented Apr 29, 2025

Thanks for the contribution! Looks good from my side. Would you please resolce the conflicts then we can merge it!

@Siedlerchr Siedlerchr added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Apr 29, 2025
@Siedlerchr
Copy link
Copy Markdown
Member

Due to the modularization which we merged after the alpha, the jpackage resources are now under jabgui/buildres/windows and in the corresponding build gradle file.

@alexeysemenyukoracle
Copy link
Copy Markdown
Author

Right, but there is no JabRef-post-image.wsf script in these resources anymore. Instead, there is "main.wxs". If this is a permanent fix and not a temporary workaround for jpackage's bug in JDK24, then this pull request can be discarded. Otherwise, I can merge and integrate it later.

@JabRef JabRef deleted a comment from jabref-machine Apr 29, 2025
@Siedlerchr
Copy link
Copy Markdown
Member

I totally overlooked that it was integrated into the main.wxs now. I think it was originally meant to be a workaround by @koppor but could be a permanent solution now as well if it works as intended.

@koppor
Copy link
Copy Markdown
Member

koppor commented Apr 30, 2025

I think, we should get this in. The idea of the script was IMHO: Take the JDK generated main.w... file as "leading X and add necessary things afterwards.

I will try to take care later.

(And @alexeysemenyukoracle thank you so much for the time invested!)

@koppor
Copy link
Copy Markdown
Member

koppor commented Apr 30, 2025

As far as I understood openjdk/jdk#19318 (comment) and https://bugs.openjdk.org/browse/JDK-8355651, we should update to JDK25 to have the script working again? 😅

@koppor koppor added status: depends-on-external A bug or issue that depends on an update of an external library and removed status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers labels Apr 30, 2025
@koppor
Copy link
Copy Markdown
Member

koppor commented Apr 30, 2025

@koppor koppor mentioned this pull request Apr 30, 2025
1 task
@koppor
Copy link
Copy Markdown
Member

koppor commented Apr 30, 2025

Windows:

> Could not copy file 'D:\a\jabref\jabref\jabgui\buildres\windows\JabRef-post-image.wsf' to 'D:\a\jabref\jabref\jabgui\build\jpackage-resource-dir\JabRef-post-image.wsf'.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
   > Error - Invalid filter specification for org.apache.tools.ant.filters.ReplaceTokens

The ChatGPT-solution (dc293db) seems to be wired... Needs more investigation.

@alexeysemenyukoracle
Copy link
Copy Markdown
Author

I'd stick to the current workaround with "main.wxs" and revisit this PR later when you decide to migrate to a newer JDK version.

@koppor
Copy link
Copy Markdown
Member

koppor commented Jun 7, 2025

I merged upstream/main (and resolved conflicts). CI shows

 > Could not copy file 'D:\a\jabref\jabref\jabgui\buildres\windows\JabRef-post-image.wsf' to 'D:\a\jabref\jabref\jabgui\build\jpackage-resource-dir\JabRef-post-image.wsf'.

   > Error - Invalid filter specification for org.apache.tools.ant.filters.ReplaceTokens
[Incubating] Problems report is available at: file:///D:/a/jabref/jabref/build/reports/problems/problems-report.html

Too late here for a proper-follow-up now. 😅

@koppor koppor added the dev: no-bot-comments If set, there should be no comments from our bots label Jun 17, 2025
@trag-bot
Copy link
Copy Markdown

trag-bot Bot commented Jun 17, 2025

@trag-bot didn't find any issues in the code! ✅✨

wxsFile.Close();

// Add registry values for JabRef Browser Extension
contents = contents.replace("</Product>", "<DirectoryRef Id=\"TARGETDIR\"><Component Id=\"RegistryJabRefBrowserEntries\" Guid=\"b6bc55ad-905c-4258-89b1-8b37abbe559c\" Win64=\"yes\"><RegistryKey Root=\"HKMU\" Key=\"SOFTWARE\\Mozilla\\NativeMessagingHosts\\org.jabref.jabref\" Action=\"createAndRemoveOnUninstall\" ForceCreateOnInstall=\"yes\"><RegistryValue Type=\"string\" Value=\"[INSTALLDIR]jabref-firefox.json\"/></RegistryKey><RegistryKey Root=\"HKMU\" Key=\"Software\\Google\\Chrome\\NativeMessagingHosts\\org.jabref.jabref\" Action=\"createAndRemoveOnUninstall\" ForceCreateOnInstall=\"yes\"><RegistryValue Type=\"string\" Value=\"[INSTALLDIR]jabref-chrome.json\"/></RegistryKey><RegistryKey Root=\"HKMU\" Key=\"Software\\Microsoft\\Edge\\NativeMessagingHosts\\org.jabref.jabref\" Action=\"createAndRemoveOnUninstall\" ForceCreateOnInstall=\"yes\"><RegistryValue Type=\"string\" Value=\"[INSTALLDIR]jabref-chrome.json\"/></RegistryKey><RegistryKey Root=\"HKMU\" Key=\"Software\\Google\\Chrome\\Extensions\\bifehkofibaamoeaopjglfkddgkijdlh\" Action=\"createAndRemoveOnUninstall\" ForceCreateOnInstall=\"yes\"><RegistryValue Type=\"string\" Name=\"update_url\" Value=\"https://clients2.google.com/service/update2/crx\" /></RegistryKey><RegistryKey Root=\"HKMU\" Key=\"Software\\Wow6432Node\\Google\\Chrome\\Extensions\\bifehkofibaamoeaopjglfkddgkijdlh\" Action=\"createAndRemoveOnUninstall\" ForceCreateOnInstall=\"yes\"><RegistryValue Type=\"string\" Name=\"update_url\" Value=\"https://clients2.google.com/service/update2/crx\" /></RegistryKey><RegistryKey Root=\"HKMU\" Key=\"Software\\Microsoft\\Edge\\Extensions\\pgkajmkfgbehiomipedjhoddkejohfna\" Action=\"createAndRemoveOnUninstall\" ForceCreateOnInstall=\"yes\"><RegistryValue Type=\"string\" Name=\"update_url\" Value=\"https://edge.microsoft.com/extensionwebstorebase/v1/crx\" /></RegistryKey><RegistryKey Root=\"HKMU\" Key=\"Software\\Wow6432Node\\Microsoft\\Edge\\Extensions\\pgkajmkfgbehiomipedjhoddkejohfna\" Action=\"createAndRemoveOnUninstall\" ForceCreateOnInstall=\"yes\"><RegistryValue Type=\"string\" Name=\"update_url\" Value=\"https://edge.microsoft.com/extensionwebstorebase/v1/crx\" /></RegistryKey></Component></DirectoryRef><Feature Id=\"BrowserExtension\" Level=\"1\"><ComponentRef Id=\"RegistryJabRefBrowserEntries\" /></Feature></Product>");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

See PR #14884 we need to adapt this

@github-actions github-actions Bot removed the status: changes-required Pull requests that are not yet complete label Jan 22, 2026
@koppor
Copy link
Copy Markdown
Member

koppor commented Jan 22, 2026

Blocked by gradle/gradle#20930 (comment)

- Task `:jabgui:genPostImageWsf` of type `Build_gradle$WriteTinyFile`: cannot serialize Gradle script object references as these are not supported with the configuration cache.

@koppor koppor added this to the 6.0-alpha.6 milestone Jan 23, 2026
@Siedlerchr Siedlerchr modified the milestones: 6.0-alpha.6, 6.0-beta Mar 16, 2026
@github-actions github-actions Bot added the status: changes-required Pull requests that are not yet complete label Mar 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Your pull request conflicts with the target branch.

Please merge with your code. For a step-by-step guide to resolve merge conflicts, see https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-using-the-command-line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev: no-bot-comments If set, there should be no comments from our bots 📌 Pinned status: changes-required Pull requests that are not yet complete status: depends-on-external A bug or issue that depends on an update of an external library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve JabRef-post-image.wsf ("post-image" script for jpackage)

4 participants