如何为izpack installer .jar文件制作.exe文件 [英] How to make .exe file for izpack installer .jar file

查看:162
本文介绍了如何为izpack installer .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?

推荐答案

Andrew总是喜欢推广 Java Web Start 技术从一开始:)这是一个很好的技术。但是,您还需要先学习技术部分,然后再开始修改它。

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.

否则,您将使用旧式EXE分发模型,如下所示。 ..

Otherwise, you are left with the old-style EXE distribution model as follows...

无论如何,我不熟悉 Izpack 。但是,有类似的单独工具可以实现 izPack 可以做什么的综合结果。我最喜欢的EXE创建和安装程序工具是从 Eclipse IDE 运行的 Launch4J + InnoSetup + Ant任务

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 是一个Java应用程序启动器。
InnoSetup 是安装创建者
Ant任务可帮助开发人员进行构建和集成步骤。

Launch4J is a Java app launcher. InnoSetup is an installation creator Ant task helps developers on build and integration steps.

如何使用Launch4J + InnoSetup + Ant构建任务+ Eclipse IDE
http://www.eteks.com/tips/tipCreationExe.html (法语 - 使用谷歌翻译)

How to use Launch4J + InnoSetup + Ant build task + Eclipse IDE: http://www.eteks.com/tips/tipCreationExe.html (in French - use Google translate)

当你是考虑为Java应用程序分发基于桌面的Windows EXE文件,您还需要考虑目标环境。当您使用Windows XP或更低版本时,它很好。但是,当你想让它在Windows Vista和Windows 7下正常工作时,它将开始成为一个主要的挫折。

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.

最好不要临时存储应用程序配置需要在Windows Vista / Windows 7下保存到%ProgramFiles%的文件等,因为它现在变为只读文件夹。出于此目的使用用户的个人资料文件夹。

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:


Windows Vista和Windows 7通过用户访问控制(UAC)

引入了严格的用户访问策略
b提示功能。必须使用Administrators组下的用户
帐户安装软件

默认Windows'
系统程序文件下的所有文件夹都设置为
只读,可能会导致问题
当尝试保存其中的内容时,非管理员用户帐户
。要使用
非管理员用户帐户运行Java应用程序,必须将
应用程序属性设置为
enable 以管理员身份运行。应在
桌面创建一个
的快捷方式,并设置为启用
administrator
运行。

Windows Vista and Windows 7 have introduced a strict user access policy through the User Access Control (UAC) prompt feature. The software installation must be done using a user account under Administrators group. All folders under the default Windows’ system Program Files are set to read-only and it may cause a problem to non-administrator user accounts when trying to save something in it. To run Java app using a non-administrator user account, the application properties must be set to enable Run as administrator. A shortcut shall be created in the Desktop and be set to enable Run as administrator as well.

如何解决以下问题:

(1)问题 AppUserModelID Windows Vista / Windows 7中的Java支持需要以下解决方案:
Launch4j,NSIS和重复固定的Windows 7任务栏图标

(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)问题与以管理员身份运行对于Java应用程序需要以下解决方案:
在Windows Vista上请求Java应用程序的管理员权限

(2) Issue with Run as Administrator for a Java app needs the following solution: Request admin privileges for Java app on Windows Vista

除此之外,在64位Windows版本下运行时,还需要检查%ProgramFiles%。 32位Windows和64位Windows之间的路径不同。在64位Windows下,所有32位应用程序都将进入%ProgramFiles(x86)%

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)%.

因此,在将硬编码文件路径值用于Java应用程序的文件夹和%ProgramFiles%中安装的子文件夹时要小心。最好设置一个 Windows环境变量,它可以通过以下ISS文件片段中的 InnoSetup 生成。使用Java System.getenv(MYAPP_HOME)来检索变量:

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 a Windows environment variable which can be generated by InnoSetup in the following ISS file snippet. Use Java System.getenv("MYAPP_HOME") to retrieve the variable:

[Registry]
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; Flags: uninsdeletevalue; ValueType: string; ValueName: "MYAPP_HOME"; ValueData: "{app}\"

[Tasks]
Name: modifypath; Description:"Add application directory to your environmental path"; Flags: unchecked

[Run]
Filename: "{app}\MyApp.EXE"; Parameters: """{app}""\"; WorkingDir: "{app}\"; Description: "Run MyApp"; Flags: postinstall nowait skipifsilent

[Code]

const
    ModPathName = 'modifypath';
    ModPathType = 'system';

function ModPathDir(): TArrayOfString;
begin
    setArrayLength(Result, 1)
    Result[0] := ExpandConstant('{app}');
end;
#include "modpath.iss"

试验并享受!

这篇关于如何为izpack installer .jar文件制作.exe文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆