如何为 izpack 安装程序 .jar 文件制作 .exe 文件
我用 izpack 制作了一个安装程序。它在 .jar 文件中。我想将其制作为 .exe 文件以便分发它。我怎样才能以简单的方式做到这一点?
I make an installer with izpack. Its in .jar file. I want to make it in .exe file in order to distribute it. How can I do it in an easy way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Andrew 总是喜欢从一开始就推广 Java Web Start 技术:) 这是一项很好的技术。但是,您还需要先学习技术部分,然后才能开始修补它。
否则,您将使用旧式 EXE 分发模型,如下所示...
无论如何我都不熟悉 Izpack。但是,有类似的单独工具可以实现 izPack 的综合结果。我最喜欢的 EXE 创建和安装工具是从 Eclipse IDE 运行的 Launch4J + InnoSetup + Ant 任务。
Launch4J 是一个 Java 应用程序启动器。
InnoSetup 是一个安装创建者
Ant 任务 帮助开发人员完成构建和集成步骤。
如何使用Launch4J + InnoSetup + Ant构建任务+ Eclipse IDE:
http://www.eteks.com/tips/tipCreationExe.html(法语- 使用 Google 翻译)
当您考虑为 Java 应用程序分发基于桌面的 Windows EXE 文件时,您还需要考虑目标环境。当您的目标是 Windows XP 或更低版本时,这没问题。但是,当您想让它在 Windows Vista 和 Windows 7 下正常工作时,这将开始成为一个重大挫折。
最好不要将需要保存到
%ProgramFiles%< 的应用程序配置、临时文件等存储/code> 在 Windows Vista/Windows 7 下,因为它现在成为只读文件夹。为此目的使用用户的配置文件文件夹。
当然,您可以通过使用“以管理员身份运行”运行应用程序来绕过它,但它涉及以下设置:
如何解决以下问题:
(1) Windows Vista/Windows 7 中的
AppUserModelID
Java 支持问题需要以下解决方案:Launch4j、NSIS 和重复的固定 Windows 7 任务栏Icons
(2) Java 应用程序的
以管理员身份运行
问题需要以下解决方案:请求 Windows Vista 上的 Java 应用程序的管理员权限
其他除此之外,在 64 位 Windows 版本下运行时还需要检查
%ProgramFiles%
。 32 位 Windows 和 64 位 Windows 之间的路径不同。在 64 位 Windows 下,所有 32 位应用程序都将进入%ProgramFiles(x86)%
。因此,在使用
%ProgramFiles%
中安装的 Java 应用文件夹和子文件夹的硬编码文件路径值时要小心。最好设置一个Windows 环境变量
,该变量可以由以下 ISS 文件片段中的 InnoSetup 生成。使用 JavaSystem.getenv("MYAPP_HOME")
检索变量:实验并享受!
Andrew always likes to promote Java Web Start technology from the start :) It is a nice tech. But, you also need to learn the technical parts first before you can start tinkering with it.
Otherwise, you are left with the old-style EXE distribution model as follows...
I am not familiar with Izpack anyway. But, there are similar separate tools to achieve the combined result as to what izPack can do. My favorite EXE creation and installer tools are Launch4J + InnoSetup + Ant task running from Eclipse IDE.
Launch4J is a Java app launcher.
InnoSetup is an installation creator
Ant task helps developers on build and integration steps.
How to use Launch4J + InnoSetup + Ant build task + Eclipse IDE:
http://www.eteks.com/tips/tipCreationExe.html (in French - use Google translate)
When you are thinking of distributing a desktop-based Windows EXE file for a Java app, you also need to think about the target environment. It is fine when you are targeting Windows XP or lesser version. But, it will start to be a major frustration when you want to make it work properly under Windows Vista and Windows 7.
It is best not to store application configurations, temporary files, etc. that require saving into
%ProgramFiles%
under Windows Vista/Windows 7 as it now becomes a read-only folder. Use user's profile folder for such purpose.Of course, you can bypass it by running your app with "Run as Administrator" but it involves the following setup:
How to solve the following issues:
(1) Issue with
AppUserModelID
Java support in Windows Vista/Windows 7 needs the following solution:Launch4j, NSIS, and duplicate pinned Windows 7 taskbar icons
(2) Issue with
Run as Administrator
for a Java app needs the following solution:Request admin privileges for Java app on Windows Vista
Other than those, you also need to check on
%ProgramFiles%
when running under 64-bit Windows version. The path is not the same between 32-bit Windows and 64-bit Windows. Under 64-bit Windows, all 32-bit apps will go into%ProgramFiles(x86)%
.So, be careful when using the hard-coded file path value to your Java app's folder and sub-folders that are installed in
%ProgramFiles%
. It is better to set up aWindows environment variable
which can be generated by InnoSetup in the following ISS file snippet. Use JavaSystem.getenv("MYAPP_HOME")
to retrieve the variable:Experiment and enjoy!
如果应用程序。有一个 GUI,您可以从网站进行分发,Java Web Start 提供了最佳解决方案。 JWS 适用于所有支持 Java 的平台,并受 Oracle 支持。
(我听说 .Net 对于“仅限 Windows”的解决方案效果很好。)
If the app. has a GUI and you can distribute from a web site, Java Web Start offers the best solution. JWS works for all platforms that support Java, and is supported by Oracle.
(I hear that .Net works well for 'Windows only' solutions.)
winrun4j 非常容易使用,我唯一的问题是,除非你使用嵌入式 JVM 进行分发,否则你'您可能需要同时提供 64 位和 32 位下载。
winrun4j is very easy to use, my only issue with it is that unless you are distributing with an embedded JVM you'll probably have to provide both a 64bit and a 32bit download.