在Win中的64位JRE上运行install4j [英] Running install4j on 64bit JRE in Win

查看:153
本文介绍了在Win中的64位JRE上运行install4j的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过Install4J为Windows创建单个媒体文件,该文件可以在用户安装32位或64位JRE的两种情况下都可以运行?

Is it possible to create via Install4J a single media file for Windows that can run in both cases when user has 32bit or 64bit JRE installed?

我遇到的情况是包装不需要64位OS功能的应用程序.因此,我选择了要生成的32位(Install4J)可执行文件.最终,当我们尝试在已安装64位JRE的64位Win7上安装时遇到了问题.安装程序抱怨缺少32位JRE.

I have a case where I'm wrapping an application that has no need for 64bit OS features. So I have selected a 32bit (Install4J) executable to be generated. Eventually we experienced problems when we have tried to install on 64bit Win7 that has 64bit JRE installed. Installer complained about a missing 32bit JRE.

在Install4J的帮助指南中,我发现了以下内容:

In Help Guide of Install4J I have found the following:

在Windows上,本机可执行文件可以是32位或64位可执行文件.如果您的应用程序需要64位JRE,则可以选择为媒体文件生成64位安装程序和启动程序. 请注意,无法创建可同时使用64位和32位JRE的启动器.由于启动程序通过加载JVM DLL通过JNI接口启动JVM,因此架构必须相同.如果同时针对32位和64位JRE和操作系统,则必须为其生成不同的媒体文件.

On Windows, a native executable can be either a 32-bit or a 64-bit executable. If you need a 64-bit JRE for your application you can choose to generate 64-bit installers and launchers for a media file. Note that it is not possible to create launchers that work with both 64-bit and 32-bit JREs. Since the launcher starts the JVM with the JNI interface by loading the JVM DLL, the architecture has to be the same. If you target both 32-bit and 64-bit JREs and operating systems, you have to generate different media files for them.

我希望当您确实需要特定的64位功能时,黑体字就是这种情况.

I'm hoping that bold is referring for those cases when you do need specific 64bit features.

有帮助吗?提前致谢.

Any help? Thanks in advance.

推荐答案

我设法找到了实际上是黑客"的解决方案.

I have managed to found the solution that is actually a "hack".

这个想法是将适当的32位Java打包在一起,并指示Install4J不要使用用户的Java,也不要依赖它.作为输出,Install4J将在安装应用程序本身的同一级别上创建"jre"文件夹.这样,当用户在计算机上未安装JRE时,甚至可以同时运行安装程序和应用程序.

The idea is to pack appropriate 32bit Java as bundle and to instruct Install4J not to use user's Java and not to depend on it. As output Install4J will create "jre" folder on the same level where the app itself is installed. By doing so it is even possible to run both installer and app when user has no JRE installed on the machine.

我创建此类Install4J配置的方式如下:

The way I have created such Install4J configuration is following:

  • 打开媒体",然后打开"Windows"(如果要为Unix或Mac捆绑JRE,则打开其他任何语言)
  • 选择捆绑的JRE"
  • 选中捆绑以下JRE",然后找到所需的Java版本
  • 取消选中作为共享JRE安装"和仅在没有找到其他合适的JRE的情况下安装"(将JRE放置在您已安装应用程序的文件夹中)的复选框

这篇关于在Win中的64位JRE上运行install4j的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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