如何将 Java 相关应用程序与 MSI 中的 JRE 捆绑在一起
这类似于 如何创建Java 程序的 .msi 文件? (eclipse) 但也专门用于捆绑 JRE。
我目前正在为我的产品构建 MSI,以便它可以作为 Windows Home Server 的附加组件安装。 安装程序必须是静默 MSI 安装程序。
我的产品依赖于 Java 1.6。我想将 Java 捆绑到 MSI 中,但不一定要安装 JRE,只需将文件复制到我的产品目录并从那里执行就可以了。
最初我尝试安装 JRE 作为第一步。我使用了 JRE 的静默安装程序,但事实证明,因为JRE 通过另一个 MSI 自行安装,在幕后,一次 MSI 安装运行规则被破坏,因此无法安装 JRE。
所以我改为复制 JRE 文件。我已经成功创建了包含所有项目的 MSI,但它的大小高达 60MB!我的应用程序大约有 33MB,其余的是 JRE。我的正常捆绑 JRE 的 setup.exe 大约为 30MB,所以我假设在后一种情况下压缩要好得多(我也在那里使用 Pack200 压缩)。
我正在使用 WiX 构建 MSI 并打开压缩。
将 JRE 与相关应用程序捆绑到 MSI 中的最佳方式是什么?
This is similar to How can I create a .msi file for a Java program ? (eclipse) but is specifically about bundling a JRE as well.
I am currently working on building an MSI for my product so it can be installed as an add-on with Windows Home Server. The installer must be a silent MSI installer.
My product depends on Java 1.6. I want to bundle Java inside the MSI but not necessarily install the JRE, simply copying the files to my product directory and executing from there would be fine.
Initially I tried installing the JRE anyway as a first step. I used the JRE's silent installer, however it turned out that because the JRE installs itself via another MSI, under the covers, the one-MSI-installation-running-at-once rule was broken, and so a JRE could not be installed.
So I changed to copying the JRE files instead. I have managed to create an MSI with all the items, but it comes in at a whopping 60MB! That's around 33MB for my app and the rest is the JRE. My normal setup.exe which bundles the JRE is about 30MB, so I am assuming compression is much better in the latter case (I also use Pack200 compression there).
I am using WiX to build the MSI and have compression turned on.
What is the best way to bundle a JRE, with dependent application, inside an MSI?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
恕我直言,您应该简单地将整个(解压的)JRE 目录添加到您的安装程序文件中。然后从给定的已知路径运行 JRE。许多产品(例如 DB2、Oracle 11g 甚至 WebSphere Application Server)都是这样做的。
IMHO you should simply add whole (unpacked) JRE directory to your installer files. Then run your JRE from the given, known path. Many products (for example DB2, Oracle 11g and even WebSphere Application Server) are doing it exactly like this.