带有JRE检查的Java应用程序的Windows exe启动器 [英] Windows exe launcher for Java app with JRE check
问题描述
我需要分发Java应用程序,我希望安装程序能够在所有情况下安装它。
I need to distribute a Java application and I want an installer to install it in all cases.
我需要创建一个 * .exe
启动器,它将检查已安装的JRE和
I need to create an *.exe
launcher that will check the installed JREs and
- 如果未安装所需的JRE,请显示一个带有正确链接的窗口。
- 如果需要安装JRE,启动正确的可执行jar文件。
推荐答案
我对WinRun4J非常满意: http://winrun4j.sourceforge.net/
I'm pretty happy with WinRun4J: http://winrun4j.sourceforge.net/
这是在积极的开发和我建议的一些改进很快就实现了。
It's under active development and some improvements I suggested were quickly implemented.
目前唯一缺乏的(从我的角度来看)是指定一条相对路径JRE允许将JRE与应用程序捆绑在一起。
The only thing that is currently lacking (from my point of view) is to specify a "relative" path to the JRE to allow bundling a JRE with the application.
为了省去阅读本手册的工作,这就是我为发射器所做的事情:
To spare you the effort of reading the manual, this is what I do for my launcher:
将 WinRun4j.exe
重命名为 MyApp.exe
,然后:
rcedit /C MyApp.exe
rcedit /I MyApp.exe myapp.ico
rcedit /N MyApp.exe MyApp.ini
放入一个漂亮的小批处理文件,没有手动的东西要做。
Put into a nice little batch file and there is no "manual" stuff to do.
您只需一次(如果您的库路径发生变化)
You only need to do this once (and if your library path changes)
这篇关于带有JRE检查的Java应用程序的Windows exe启动器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!