-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Get command path dynamically for restarting #262
Conversation
Hi @Ape, Using Current rpm, deb, Windows installer, snap and flatpak version runs without adding an additional JDK because all the packages contains all the needed java modules to run luciferin thanks to jpackage and jlink. I like this approach for two reasons:
With the current approach you can install Luciferin wherever you want but you need to put the .jar file in the lib/app/ folder, that's it. As I said, with the current approach, you can install luciferin wherever you want, but you need to put the jar file in the lib/app folder and use the generated binary from jpackage to launch Luciferin. You can have an idea of this with the Extracting a .deb package like I do for Flatpak or snap for example, ...and it solves this problem :) if you can't download the .deb file from the release in your pkgbuild, you could consider to jpackage the app using the command I use in my CI: firefly_luciferin/.github/workflows/build.yml Line 102 in ba76594
this will create an executable binary with the stripped jdk from source. please let me know if I answered you in a reasonable way... |
I see, this doesn't work with the jpackage approach. However, I would like to be able to also run the app without using jpackage. What do you think about a solution like this? String jpackageApp = System.getProperty("jpackage.app-path");
if (jpackageApp != null) {
commands.add(jpackageApp);
} else {
commands.add(System.getProperty("java.home") + File.separator + "bin" + File.separator + "java");
commands.addAll(ManagementFactory.getRuntimeMXBean().getInputArguments());
commands.add("-jar");
commands.add(System.getProperty("sun.java.command").split("\\s+")[0]);
} I think something like this would also improve the jpackage solution since it would be path independent. Moreover, this way it's also possible to launch the app as an Java application with any custom JVM parameters and they would be retained on restart. |
I agree that this is something that must be improved, |
Isn't that set automatically by jpackage at runtime? |
ooops you're right, that very good. I know that this is a question of tastes, but can you move the strings in Constants.java file please? |
The previous version assumes certain installation location. This version works regardless of where the jar file was installed or if it's just a development build that wasn't really installed at all.
2849327
to
4c699a9
Compare
Any comments on this version? I have tested that it works for the Java app case, but could you test it with jpackage and on Windows before merging. I believe that this solution would also work on snap and flatpak, but I left those as they were. |
very cool... give me some time to test on windows, snap, flatpak, deb... |
weirdly it doesn't work on snap and flatpak but it works well for other use cases. no problem. merging it as it is, thanks. |
- ***Breaking changes***: requires `Firefly Luciferin` firmware (v2.20.5). - **Color accuracy has been significantly improved when using HDR contents.** Closes [#268](sblantipodi/firefly_luciferin#268). - New [color orders](https://github.com/sblantipodi/firefly_luciferin/wiki/RGB-and-RGBW-support#how-to-change-color-order) to support newer LED strips. - Get command path dynamically for restarting. Closes [#262](sblantipodi/firefly_luciferin#262). Thanks @Ape for the PR. - Fix "Sources not selected" crash on Wayland. Closes [#264](sblantipodi/firefly_luciferin#264). Thanks @Ape for the PR. - OnBoard-Led managment for esp8266. Closes [#266](sblantipodi/firefly_luciferin#266). - When setting a low brightness color on Firefly Luciferin, it’s not possible to increase the brightness in the [web interface](https://github.com/sblantipodi/firefly_luciferin/wiki/Remote-Access#luciferin-web-interface). Fixed. - Fix "Slow rainbow" effect switching to "Solid" automatically.
- ***Breaking changes***: requires `Glow Worm Luciferin` firmware (v5.19.4). - **Color accuracy has been significantly improved when using HDR contents.** Closes [#268](#268). - New [color orders](https://github.com/sblantipodi/firefly_luciferin/wiki/RGB-and-RGBW-support#how-to-change-color-order) to support newer LED strips. - Get command path dynamically for restarting. Closes [#262](#262). Thanks @Ape for the PR. - Fix "Sources not selected" crash on Wayland. Closes [#264](#264). Thanks @Ape for the PR. - OnBoard-Led managment for esp8266. Closes [#266](#266). - When setting a low brightness color on Firefly Luciferin, it’s not possible to increase the brightness in the [web interface](https://github.com/sblantipodi/firefly_luciferin/wiki/Remote-Access#luciferin-web-interface). Fixed. - Fix "Slow rainbow" effect switching to "Solid" automatically.
The previous version assumes certain installation location. This version works regardless of where the jar file was installed or if it's just a development build that wasn't really installed at all.
I didn't remove the previously used
getInstallationPath()
as it's also used to Windows-specificwriteRegistryKey()
.