Hello Martin,
Thank you for your question and for reaching out with your question today.
Creating an MSI/MSIX installer package for a Java application that includes the JDK/JRE and other dependencies can be a bit challenging, especially when trying to publish it on the Microsoft Store. Here are some potential approaches you can consider to package your Java app correctly:
- MSIX Packaging Tool (Recommended):
The MSIX Packaging Tool is designed to help developers package their traditional desktop applications into the MSIX format, which is the modern deployment package for Windows 10 and the Microsoft Store. This tool can be used to repackage your existing MSI installer or your Java application.
To use the MSIX Packaging Tool, you'll need to have a clean system (virtual machine or physical) where you can install your application along with its dependencies (OpenJDK, JXbrowser, and the specific DLL). Once everything is set up and working correctly, you can run the MSIX Packaging Tool to capture the changes and create an MSIX package out of it.
- Install4j:
Install4j is a multi-platform Java installer builder that provides support for creating Windows installers, including MSI installers. It allows you to bundle the JRE, additional DLLs, and other dependencies within the installer package. While it's not an MSI/MSIX specifically, it can create installer packages suitable for distribution.
- JLink (Java Linker):
JLink is part of the OpenJDK, and it allows you to create custom runtime images that contain only the necessary modules for your Java application to run. This can significantly reduce the size of the Java runtime bundled with your application. After creating the custom runtime image, you can package it along with your application and other dependencies using tools like Install4j.
- AdoptOpenJDK's JLink MSI Installer:
AdoptOpenJDK has an experimental project that provides an MSI installer for JREs created with JLink. You can find more information about this project on their GitHub repository. However, do note that this is still experimental and may not be suitable for all use cases.
Keep in mind that while bundling the JRE with your application can simplify the installation process, it also means that your application won't benefit from any potential security updates or improvements that might be provided by the system-installed JRE. Additionally, Microsoft Store has specific guidelines and requirements for apps, so it's essential to ensure your application complies with those guidelines to successfully publish it on the store.
Lastly, always thoroughly test your MSI/MSIX installer on different systems to ensure it works correctly and doesn't introduce any conflicts or compatibility issues with other software.
I used AI provided by ChatGPT to formulate part of this response. I have verified that the information is accurate before sharing it with you.
If the reply was helpful, please don’t forget to upvote or accept as answer.