根据我的要求,我应该使用 NSIS 还是 jprofiler/install4j
我们有一个 Web 应用程序,需要让客户更容易部署它。 全新安装的当前工作流程:
- 确保计算机上有 JRE(32 或 64 位)
- 安装 Tomcat(32 或 64 位)
- 在 Oracle 或 SQL Server 中创建数据库(我们为此提供 SQL 脚本)
- 将一些值写入我们的设置表,如主机名。 (可以让用户验证这些,但不希望用户必须点击它们。
- 创建一个连接属性文件(我们提供一个迷你 JAR 应用程序来帮助完成此操作),该文件将位于 Tomcat 下。
- 我们有两个实际的 WAR 文件这些可以拆分到两台机器上,但现在,我们假设它们都被转储到 Tomcat 下,
- 以便它部署 WAR
。这对于我们的用户来说是一个乏味的过程。 我想将它封装到一个安装程序中,并且一直在考虑在 NSIS 中执行此操作,NSIS 似乎有一个很大的社区,但后来也偶然发现了 install4j,尽管它似乎不太为人所知,但它更特定于基于 java 的应用程序。
只是想从更有经验的用户那里获得一些关于平台最佳选择的反馈。
我不想半途而废,然后意识到我选择了错误的安装程序平台。
We have a web application that we need to make easier to deploy for our clients.
The current workflow for a fresh install:
- Ensure there is a JRE on machine (32 or 64bit)
- Install Tomcat (32 or 64bit)
- Create a database in Oracle or SQL Server (we provide SQL scripts for this)
- Write some values into our settings table, like hostname. (Can get user to verify these, but dont want user to have to tap them in.
- Create a connections properties file (we provide a mini JAR app to help with this) that will sit under Tomcat.
- We have two WAR files for our actual web application. These can be split across two machines, but for now, lets assume they both get dumped under Tomcat.
- Start Tomcat so that it deploys the WARs
This is a tedious process for our users
I want to encapsulate it into an installer and have been looking at doing this in NSIS which seems to have a large community, but then also stumbled across install4j, which although seems to be lesser known, is more specific to java based applications.
Just wanted to get some feedback from more experiennced users out there on the best choice for platform.
I do not want to get half way in, and then realise I have chosen the wrong installer platform.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
免责声明:我的公司开发 install4j。
首先,install4j是一个商业工具,所以这与NSIS有很大的区别。其他主要区别是:
对于 install4j,我可以满足您的单一要求:
在媒体向导中,选择 JRE 捆绑包。如果选择“动态捆绑”选项,则仅在找不到合适的 JRE 时才会下载。
我建议只需将现有 tomcat 安装的根目录添加到您的分发树中。
至于服务,您可以使用 Tomcat 发行版中的 Tomcat 服务启动器,也可以在 install4j 中创建服务启动器。在这两种情况下,您都可以使用“安装服务”操作来安装服务。
生成的服务的优点是更新安装程序知道它们正在运行并在安装任何新文件之前自动关闭它们。
使用“运行可执行文件或批处理文件”操作来运行这些脚本。
任何类型的用户交互都是通过可配置的表单完成的。通过几个文本字段表单组件,您可以查询您的设置。
这在控制台安装程序中也可以透明地工作,自动生成的响应文件将允许您基于 GUI 安装程序的单次执行以无人值守模式自动安装。
如果您已经有一个可以执行此操作的 JAR 文件,只需将其添加到“安装程序”->“自定义代码和自定义代码”下即可。资源并向安装程序添加“运行脚本”操作以使用 JAR 文件中的类。
已保存到安装程序变量的表单组件中的任何用户输入都可以通过
“运行脚本”操作(或 install4j 中的任何其他脚本)的脚本属性中的调用来访问。
如果您只是将 Tomcat 目录结构添加到分发树中,则可以预先部署这些 WAR 文件。否则,您可以使用“复制文件”操作将 WAR 文件放置在任何位置。
启动 Tomcat,以便它部署通过“启动服务”操作完成的
Disclaimer: My company develops install4j.
First of all, install4j is a commercial tool, so that's a considerable difference to NSIS. Other major differences are:
For install4j, I can address your single requirements:
In the media wizard, select a JRE bundle. If you select the "dynamic bundle" option, it will only be downloaded if no suitable JRE is found.
I would recommend to simply add the root directory of an existing tomcat installation to your distribution tree.
As for the service, you can either use the Tomcat service launcher from the Tomcat distribution or create a service launcher in install4j. In both case you can use the "Install a service" action on order to install the service.
Generated services have the advantage that an update installer knows that they are running and automatically shuts them down before installing any new files.
Use the "Run executable or batch file" action in order to run these scripts.
Any kind of user interaction is done with configurable forms. With a couple of text field form components you can query your settings.
This also works transparently in the console installer and the automatically generated response file will allow you to automate installations in unattended mode based on a single execution of the GUI installer.
If you already have a JAR file which does that, just add it under Installer->Custom Code & Resources and add a "Run script" action to your installer to use the classes in your JAR file.
Any user input from form components that has been saved to installer variables can be accessed with calls like
in the script property of the "Run script" action (or any other script in install4j).
If you just add the Tomcat directory structure to your distribution tree, you can have these WAR file pre-deployed. Otherwise you can use "Copy file" actions to place the WAR files anywhere.
That's done with the "Start a service" action.