Skip to content

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

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

Open
alexeysemenyukoracle opened this issue Apr 29, 2025 · 0 comments · May be fixed by #13033
Open

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

alexeysemenyukoracle opened this issue Apr 29, 2025 · 0 comments · May be fixed by #13033

Comments

@alexeysemenyukoracle
Copy link

As a maintainer of the jpackage JDK tool I noticed buildres/windows/JabRef-post-image.wsf has a couple of issues:

  1. A path to the "config" directory is derived from the current process directory. This logic is fragile and redundant. jpackage runs a copy of the "post-image" script from the "config" directory, so the path to the "config" directory is the parent folder of the script:
var installerConfig = fileSystem.GetFile(WScript.ScriptFullName).ParentFolder;
  1. The script relies on the assumption that jpackage will create the "config" directory and the "image" directory within JabRef project directory tree. This is needed to obtain a path to the root directory of the project at JabRef-post-image.wsf:12. To ensure this, '--temp', "$buildDir/installer" is passed as an argument to jpackage in build.gradle:936. This will fall off if Gradle build directory is created outside of the project tree, which is not an uncommon configuration.

Unfortunately, issue n2 doesn't have a trivial solution like issue n1 because jpackage doesn't provide sufficient context to the post-image script. As a workaround, I'd embed a path to JabRef project root in the post-image script source. This will make it agnostic to the location of the project build directory and eliminate the need for '--temp', "$buildDir/installer" in the build.gradle. To embed a path to JabRef project root in the JabRef-post-image.wsf file, I'd add a Gradle task transforming it in the build.

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

Successfully merging a pull request may close this issue.

2 participants