什么是安装 Java EE 应用程序的好的 InstallAnywhere 替代品?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/759855/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 19:08:10  来源:igfitidea点击:

What are good InstallAnywhere replacements for installing a Java EE application?

javainstallerjakarta-eewindows-installer

提问by Jonik

Which (commercial or free) installer tool would you recommend to replace InstallAnywhereas the installer for a Java EE application? What do you specifically like about it, and what are its downsides?

您建议使用哪种(商业或免费)安装程序工具来替换InstallAnywhere作为 Java EE 应用程序的安装程序?你特别喜欢它的什么,它的缺点是什么?

Some requirements:

一些要求:

  • Must support running custom Java codeas part of installation procedure
  • Must support Windows, including latest 64-bit versions like Windows Server 2008; support for other target operating systems is a plus
  • Must be able to install a bundled application server (such as Resinor Tomcat) as a service on Windows
  • Must support basic stuff like copying and moving files around, editing configuration files, extracting ZIPs, etc.
  • (Must support bundling a specific version of JRE; at the very least by including a ZIP to be extracted)
  • 必须支持在安装过程中运行自定义 Java 代码
  • 必须支持 Windows,包括最新的 64 位版本,如 Windows Server 2008;对其他目标操作系统的支持是一个加分项
  • 必须能够在 Windows 上安装捆绑的应用程序服务器(例如ResinTomcat)作为服务
  • 必须支持基本的东西,比如复制和移动文件、编辑配置文件、提取 ZIP 等。
  • (必须支持捆绑特定版本的 JRE;至少包括要提取的 ZIP)

Edit: a few more points:

编辑:还有几点:

  • Preferably does not depend on a preinstalled JRE (or any other 3rd party runtime environment or library) on target machine; in other words, can produce an independent Windows .exe (or .msi)
  • The tool should preferably be cross-platform so that installer development can be done on Linux, Windows, or Mac.
  • Should preferably have a decent GUI for putting the installer together. Once that is done, however, it mustbe possible to skip the GUI and make installer building part of automated build process.
  • 最好不依赖于目标机器上预装的 JRE(或任何其他 3rd 方运行时环境或库);换句话说,可以生成独立的 Windows .exe(或 .msi)
  • 该工具最好是跨平台的,以便安装程序开发可以在 Linux、Windows 或 Mac 上完成。
  • 最好有一个像样的 GUI 来将安装程序放在一起。但是,一旦完成,就必须可以跳过 GUI 并使安装程序构建成为自动构建过程的一部分。

采纳答案by Jonik

In this case, unfortunately, SO didn't tell us much that we didn't know already (and indeed the tool we ultimately chose was not mentioned in any answer). However, I'm posting our experiences here, as they might be helpful to others later on.

在这种情况下,不幸的是,SO 并没有告诉我们太多我们已经不知道的信息(实际上,我们最终选择的工具没有在任何答案中提及)。但是,我在这里发布我们的经验,因为它们以后可能对其他人有所帮助。

We (quickly) evaluated the following installer tools, mostly by looking at their websites and browsing for other information on the web: Actual Installer, Advanced Installer, BitRock InstallBuilder, Inno Setup, Install Creator, Installer VISE for Windows, InstallShield, install4j, IzPack, NSIS, openInstaller, Scriptlogic MSI Studio, Smart Install Maker, Symantec Wise Installation Studio, and WiX.

我们(快速)评估了以下安装程序工具,主要是通过查看他们的网站和浏览网络上的其他信息:Actual InstallerAdvanced InstallerBitRock InstallBuilderInno SetupInstall CreatorInstaller VISE for WindowsInstallShieldinstall4jIzPackNSISopenInstallerScriptlogic MSI StudioSmart Install MakerSymantec Wise Installation StudioWiX

We screened out most of them early on, and ended up shortlisting two options for closer evaluation: BitRock InstallBuilderand install4j. For these tools, we downloaded evaluation versions and did some prototyping, to see if the things that are most important to us are really supported, and how easy or hard it is to get things working.

我们很早就筛选了其中的大部分,最终列出了两个选项以供进一步评估:BitRock InstallBuilderinstall4j。对于这些工具,我们下载了评估版本并进行了一些原型设计,以查看对我们来说最重要的东西是否真的得到支持,以及让它们工作的难易程度。

Both of the options were good in many things (and both seemed good alternatives to InstallAnywhere):

这两个选项在很多方面都很好(并且似乎都是 InstallAnywhere 的不错选择):

  • They produce completely native and pretty Windows .exe installers that are easy to customise with your own graphics etc.
  • Both tools could easily be automated so that installer building is triggered from Ant. (With install4j it literally took me just five minutes to learn itand then implement it.)
  • Both companies seem to have good support (well, at least for prospects evaluating their products ;-) Especially from BitRock we got very quick replies.
  • 它们生成完全原生且漂亮的 Windows .exe 安装程序,这些安装程序很容易使用您自己的图形等进行自定义。
  • 这两种工具都可以轻松实现自动化,以便从 Ant 触发安装程序构建。(使用 install4j,我只用了五分钟就学会了它,然后实现了它。)
  • 两家公司似乎都得到了很好的支持(好吧,至少对于评估他们产品的潜在客户来说是这样;-)尤其是从 BitRock 那里,我们得到了非常快的答复。

In the following things install4j seemed better than BitRock for our needs (many of these are subjective, of course, so YMMV):

在以下方面,install4j 似乎比 BitRock 更能满足我们的需求(当然,其中许多是主观的,所以 YMMV):

  • install4j definitely has better support for running custom Java code - it can be done at any point during the installation, and regardless of whether there's any preinstalled JRE on the system.
  • BitRock uses a more hard-coded sequence of installation steps while install4j is more flexible. In install4j, adding custom screens and forms (with or without custom Java code), asking user for input, etc., can be done at any point, before or after installing any files.
  • Also some basic things like defining the filesets that are to be copied to the target system, and adding an installation step to replace certain strings in configuration files seemed somewhat easier in install4j.
  • install4j has better support for JRE bundling
  • When creating installers on Linux, the look & feel of install4j IDE was nicer (more "native") than that of BitRock
  • (install4j's licensing optionswere better for us - we strongly preferred a couple of floating licenses to named licenses for all developers or an expensive "site license")
  • install4j 肯定对运行自定义 Java 代码有更好的支持——它可以在安装过程中的任何时候完成,而不管系统上是否有任何预装的 JRE。
  • BitRock 使用更硬编码的安装步骤序列,而 install4j 更灵活。在 install4j 中,可以在安装任何文件之前或之后的任何时候添加自定义屏幕和表单(使用或不使用自定义 Java 代码)、询问用户输入等。
  • 还有一些基本的事情,比如定义要复制到目标系统的文件集,以及添加安装步骤来替换配置文件中的某些字符串,在 install4j 中似乎更容易一些。
  • install4j 对 JRE 捆绑有更好的支持
  • 在 Linux 上创建安装程序时,install4j IDE 的外观和感觉比 BitRock 更好(更“本机”)
  • (install4j 的许可选项对我们来说更好——我们强烈推荐几个浮动许可,而不是所有开发人员的命名许可或昂贵的“站点许可”)

So ultimately we went with install4j. Here are some more details on why it was impressive:

所以最终我们选择了install4j。以下是有关其令人印象深刻的原因的更多详细信息:

  • Its IDE, where you put the installer together, is very simple and easy to use - I could figure out how to do most things I wanted quickly, even without looking at documentation. And when I did have to check something in the documentation (e.g. how to refer to installer variables; how to get started writing custom Java code against the install4j API), it didn't take long to find what I needed.
  • You can completely customise the screens and actions during the installation procedure, and also add custom screens and actions (coded against their Java API) at any point. This was important to us because we need to reuse existing custom Java code from the old InstallAnywhere installer.
  • In some small details, install4j seems ideal for Javadevelopers. For example, if you want to add a validation script to check some user input, you can code that very quickly in the install4j IDE itself, using plain old Java, with coding assistance resembling that of IntelliJ IDEA.
  • We deemed the cost of install4j floating licenses reasonable, considering how good the tool is (and downright bargain compared to the inflated pricing of InstallAnywhere...)
  • In short, it seemed like the best installer tool available for deploying Java applications.
  • 它的 IDE,您将安装程序放在一起,非常简单且易于使用 - 我可以弄清楚如何快速完成我想做的大多数事情,甚至无需查看文档。当我确实必须检查文档中的某些内容时(例如,如何引用安装程序变量;如何开始针对 install4j API 编写自定义 Java 代码),很快就找到了我需要的东西。
  • 您可以在安装过程中完全自定义屏幕和操作,也可以随时添加自定义屏幕和操作(针对其Java API 进行编码)。这对我们很重要,因为我们需要重用旧 InstallAnywhere 安装程序中现有的自定义 Java 代码。
  • 在一些小细节上,install4j 似乎是Java开发人员的理想选择。例如,如果您想添加一个验证脚本来检查某些用户输入,您可以在 install4j IDE 本身中非常快速地编写代码,使用普通的旧 Java,并提供类似于 IntelliJ IDEA 的编码帮助。
  • 我们认为 install4j 浮动许可证的成本是合理的,考虑到该工具有多好(与 InstallAnywhere 的夸大定价相比,这是非常划算的......)
  • 简而言之,它似乎是可用于部署 Java 应用程序的最佳安装程序工具。

回答by willcodejavaforfood

I've seen several people recommend IzPack, but I honestly don't know if it meets your requirements. It's at least free :)

我见过几个人推荐IzPack,但老实说,我不知道它是否符合您的要求。至少是免费的 :)

回答by dfa

you may be interested in launch4j

你可能对launch4j感兴趣

回答by Brian Agnew

I can vouch for izPack. It's Ant-based so you can package up an Ant install in it, and that Ant install can contain custom tasks, and/or scripts written within your Ant build.xml (e.g. using Groovy, Beanshell or any BSF-enabled scripting language). So it'll cover your customisable requirement.

我可以担保izPack。它是基于 Ant 的,因此您可以在其中打包 Ant 安装,并且该 Ant 安装可以包含自定义任务和/或在您的 Ant build.xml 中编写的脚本(例如,使用 Groovy、Beanshell 或任何支持 BSF 的脚本语言)。因此,它将涵盖您的可定制需求。

I've used it in the past for all the above - unzipping/services/custom code. It's multi-platform, although I can't vouch for that specific instance above (64bit Windows). But if it runs Java, you should be fine.

我过去曾将它用于上述所有操作 - 解压缩/服务/自定义代码。它是多平台的,尽管我不能保证上面的特定实例(64 位 Windows)。但是如果它运行Java,你应该没问题。

The one headache is the JRE. You'd obviously require someJRE to run this. However I think you should be able to pack up and execute a specific JRE installation within izPack.

最令人头疼的是 JRE。您显然需要一些JRE 来运行它。但是我认为您应该能够在 izPack 中打包并执行特定的 JRE 安装。

回答by ivan_ivanovich_ivanoff

Sun offers an open source installer:

Sun 提供了一个开源安装程序:

OpenInstaller

打开安装程序

I'm sure that all your requested features are supported.
But it seems for me a little too hard to configure.

我确信您要求的所有功能都得到支持。
但对我来说似乎有点难以配置。

But guess what: It has not only a GUI but also a (pseudo-graphic) CLI.
Nice screenshots and info here.

但是你猜怎么着:它不仅有一个 GUI,还有一个(伪图形)CLI。
漂亮的屏幕截图和信息在这里

回答by Daniel Lopez

We created BitRock InstallBuilder, a crossplatform installation tool after some frustrating experiences with InstallAnywhere and specially its cousin (now defunct) InstallShield MP. More than half of our clients use our tool to package Java-based software but the tool is native, not Java-based. That means we have a number of advantages such as native look and feel (incl. Vista, GTK, Qt, etc.) and no need to do self-extraction previous to installation (faster startup, less space requirements) to mention a couple. To answer your specific questions:

我们创建了BitRock InstallBuilder,这是一个平台安装工具,在使用 InstallAnywhere 和特别是它的堂兄(现已解散)InstallShield MP 经历了一些令人沮丧的经历之后。我们超过一半的客户使用我们的工具来打包基于 Java 的软件,但该工具是原生的,而不是基于 Java 的。这意味着我们有许多优点,例如原生外观(包括 Vista、GTK、Qt 等),并且无需在安装前进行自解压(启动更快、空间要求更少)等等。要回答您的具体问题:

  • Supports calling Java code as part of the installation at multiple points in time (such as when a certain page is displayed, files being copied, at uninstall time, etc.). The code is not compiled in the installer, but it can be called externally and the result used in the installer. If you are more specific about which kind of code that you need I can provide specific sample code. We have a lot of built-in actions for functionality that needs to be manually added to other installers, so you may not need to write that code in the first place!
  • We support all versions of Windows, including 64bit and Windows 2008 (multiple customers have certified on those platforms using our installers)
  • We support bundled applications servers, including Tomcat, Resin, JBoss and others. Take a look at BitNamifor examples of such stacks that we have created.
  • We support copying and moving files, substituting values in config files, unpacking files and most other common installation functionality. One of our principles is that the installer should provide built-in support for common installation actions and have an easy, clean interface for invoking external code that is specific to a client's product.
  • We support bundling JREs, as you mention is often enough just to bundle the JRE directory and setting the appropriate value for JAVA_HOME in the launching scripts
  • 支持在多个时间点(例如显示特定页面、复制文件、卸载时等)调用 Java 代码作为安装的一部分。代码不会在安装程序中编译,但可以在外部调用并在安装程序中使用结果。如果您更具体地了解需要哪种代码,我可以提供特定的示例代码。对于需要手动添加到其他安装程序的功能,我们有很多内置操作,因此您可能不需要首先编写该代码!
  • 我们支持所有版本的 Windows,包括 64 位和 Windows 2008(多个客户已使用我们的安装程序在这些平台上进行了认证)
  • 我们支持捆绑的应用服务器,包括 Tomcat、Resin、JBoss 等。查看BitNami以获取我们创建的此类堆栈的示例。
  • 我们支持复制和移动文件、替换配置文件中的值、解压缩文件和大多数其他常见安装功能。我们的原则之一是安装程序应该为常见的安装操作提供内置支持,并有一个简单、干净的界面来调用特定于客户产品的外部代码。
  • 我们支持捆绑 JRE,正如您提到的,通常只需捆绑 JRE 目录并在启动脚本中为 JAVA_HOME 设置适当的值

You can take a look at some of our customerssuch as MySQL, Samsung, Motorola, GitHub, etc. InstallBuilder is a commercial product, but we offer free licenses for open source projects and discounts for small business and microISVs.

您可以看看我们的一些客户,例如 MySQL、Samsung、Motorola、GitHub 等。 InstallBuilder 是一个商业产品,但我们为开源项目提供免费许可证,并为小型企业和 microISV 提供折扣。

回答by Daniel Lopez

Jonik, thanks for posting such detailed feedback of your experience. I wanted to write a follow up answer, since you raise some good points.

Jonik,感谢您发布如此详细的体验反馈。我想写一个后续的答案,因为你提出了一些好的观点。

After certain base requirements are met (which unfortunately InstallAnywhere does not any more) there are not really 'bad' or 'good' tools, but rather tools that are better suited for some projects. It seems you studied carefully all options and install4j will work better for your project. This is probably a good choice, since you have an existing Java codebase from your previous installer that you want to reuse (though I would like to think some of that code would not be necessary with InstallBuilder :)

在满足某些基本要求(不幸的是 InstallAnywhere 不再适用)之后,就没有真正的“坏”或“好”工具,而是更适合某些项目的工具。看来您仔细研究了所有选项,并且 install4j 将更适合您的项目。这可能是一个不错的选择,因为您想要重用以前安装程序中的现有 Java 代码库(尽管我认为 InstallBuilder 不需要其中的某些代码 :)

Regarding InstallBuilder, we support customizing the screen sequence using the <insertBefore> tag (we probably should better document this). It is also straightforward to bundle a JRE (just including the java/ folder in most cases) but I think your criticism is valid: since this is a common task we should do a better job at documenting / making it accessible though the GUI, including drag-and-drop in all supported platforms. We already have in our roadmap improving the GUI in the areas you mention. The funny thing is that a lot of our customers find the XML format so easy to use that they prefer editing it using their programming editors (as if they were editing HTML)

关于 InstallBuilder,我们支持使用 <insertBefore> 标签自定义屏幕顺序(我们可能应该更好地记录这一点)。捆绑 JRE 也很简单(在大多数情况下只包括 java/ 文件夹),但我认为您的批评是有效的:由于这是一项常见任务,我们应该更好地记录/使其可通过 GUI 访问,包括在所有支持的平台中拖放。我们已经在我们的路线图中改进了您提到的领域的 GUI。有趣的是,我们的许多客户发现 XML 格式非常易于使用,以至于他们更喜欢使用他们的编程编辑器来编辑它(就像他们在编辑 HTML 一样)

Finally, regarding licensing, our current model does not require purchasing additional licenses if those extra programmers will just be building the installers (not designing them) or purchasing extra licenses for build or continuous integration machines. In any case, a couple of floating licenses for install4j are more expensive than a full Enterprise Site license for BitRock:)

最后,关于许可,如果这些额外的程序员只是构建安装程序(而不是设计它们)或为构建或持续集成机器购买额外的许可,我们当前的模型不需要购买额外的许可。无论如何,install4j 的几个浮动许可证比 BitRock 的完整企业站点许可证更贵:)

Thanks again for the feedback

再次感谢你的反馈

回答by sorin

Deployment in an multi-platform environment is always a big source of troubles. It think that the optimum solution would target the creation of native packages for all platforms, like RPM, DEB or MSI ... the ones that could be installed unattended also.

在多平台环境中部署始终是一个很大的麻烦来源。它认为最佳解决方案的目标是为所有平台创建本机包,如 RPM、DEB 或 MSI ......也可以无人值守安装。

Developers should work on making the application self-healing and run without installation.

开发人员应该致力于使应用程序自我修复并在没有安装的情况下运行。

Doing so will payoff in minimize the deployment efforts.

这样做将在最大限度地减少部署工作方面取得回报。

I know this is not quite a solution as you where asking but sometimes you may get better results this way.

我知道这不是一个很好的解决方案,但有时你可能会通过这种方式获得更好的结果。

Remember that you'll get free updating service on Linux if you follow these.

请记住,如果您遵循这些,您将在 Linux 上获得免费更新服务。

I still hope Microsoft will add something similar to MSI (and that would not require you to register at them). Meanwhile for Windows you can take a look at Google Updater just released as open source - http://code.google.com/p/omaha/

我仍然希望微软会添加类似于 MSI 的东西(并且不需要你在他们那里注册)。同时,对于 Windows,您可以查看刚刚作为开源发布的 Google Updater - http://code.google.com/p/omaha/

They released a similar product for Mac OS http://code.google.com/p/update-engine/but sad that they didn't think about creating one product from these two.

他们为 Mac OS http://code.google.com/p/update-engine/发布了一个类似的产品,但遗憾的是他们没有考虑从这两个产品中创建一个产品。

回答by Flueras Bogdan

I recommend having a look at cmInstall, which can be found at http://sourceforge.net/projects/cminstall/

我建议看看cmInstall,它可以在http://sourceforge.net/projects/cminstall/找到

It meets almost all your requirements and it's open source. Plus I'm one its developers :).

它几乎可以满足您的所有要求,并且是开源的。另外我是它的开发人员之一:)。

  1. [yes] Must support running custom Java code as part of installation procedure
  2. [yes] Must support Windows, including latest 64-bit versions like Windows Server 2008; support for other target operating systems is a plus
  3. [can be easily done by using 3rd party libs- e.g.:Tanuki Software] Must be able to install a bundled application server (such as Resin or Tomcat) as a service on Windows
  4. [yes]Must support basic stuff like copying and moving files around, editing configuration files, extracting ZIPs, etc.
  5. [yes - or you can programatically download & unzip it ]Must support bundling a specific version of JRE; at the very least by including a ZIP to be extracted

    6.[no - it needs jdk 1.6 installed, support for .exe or .msi is planned for future]Preferably does not depend on a preinstalled JRE (or any other 3rd party runtime environment or library) on target machine; in other words, can produce an independent Windows .exe (or .msi)

  6. [yes] The tool should preferably be cross-platform so that installer development can be done on Linux, Windows, or Mac.

    7.[no - the cminstall framework is "developer based" - but easy to use.Just read the tutorials from http://sourceforge.net/project/showfiles.php?group_id=250019&package_id=305489and see how easy it is to build an installer!] Should preferably have a decent GUI for putting the installer together. Once that is done, however, it must be possible to skip the GUI and make installer building part of automated build process.

  1. [是] 必须支持在安装过程中运行自定义 Java 代码
  2. [是] 必须支持 Windows,包括最新的 64 位版本,如 Windows Server 2008;对其他目标操作系统的支持是一个加分项
  3. [可以通过使用 3rd 方库轻松完成 - 例如:Tanuki Software] 必须能够在 Windows 上安装捆绑的应用程序服务器(例如 Resin 或 Tomcat)作为服务
  4. [是]必须支持基本的东西,比如复制和移动文件、编辑配置文件、解压缩 ZIP 等。
  5. [是的 - 或者您可以通过编程方式下载并解压缩它]必须支持捆绑特定版本的 JRE;至少通过包含要提取的 ZIP

    6.[否 - 它需要安装 jdk 1.6,未来计划支持 .exe 或 .msi]最好不依赖于目标机器上预装的 JRE(或任何其他 3rd 方运行时环境或库);换句话说,可以生成独立的 Windows .exe(或 .msi)

  6. [是] 该工具最好是跨平台的,以便安装程序开发可以在 Linux、Windows 或 Mac 上完成。

    7.[不 - cminstall 框架是“基于开发人员的” - 但易于使用。只需阅读http://sourceforge.net/project/showfiles.php?group_id=250019&package_id=305489 中的教程,看看它是多么容易构建一个安装程序!] 最好有一个像样的 GUI 来将安装程序放在一起。但是,一旦完成,就必须可以跳过 GUI 并使安装程序构建成为自动构建过程的一部分。

回答by Heidarzadeh

Currently we are using GetDownto handle distribution of our swing applications. We use Tomcat to distribute updates and GetDownto download those updates. It's really flexible and powerful, and much better than java WebStart and because it produces check sum for changes it saves bandwith and downloads just changed files.

目前我们正在使用GetDown来处理我们的 Swing 应用程序的分发。我们使用 Tomcat 分发更新并使用GetDown下载这些更新。它非常灵活和强大,比 java WebStart 好得多,因为它为更改生成校验和,因此可以节省带宽并下载刚刚更改的文件。

A good tutorial : http://www.hascode.com/2012/05/creating-updatable-java-applications-using-getdown-and-the-getdown-maven-plugin/

一个很好的教程:http: //www.hascode.com/2012/05/creating-updatable-java-applications-using-getdown-and-the-getdown-maven-plugin/

Project website : https://github.com/threerings/getdown

项目网址:https: //github.com/threerings/getdown