Java应用程序和MySQL安装在一个包中 [英] Java application and MySQL installation in a single package

查看:142
本文介绍了Java应用程序和MySQL安装在一个包中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在单个exe文件中打包Java应用程序和MySQL安装文件?我可以在后台自动安装MySQL文件(或者没有来自用户的任何输入)吗?这只是为了简化安装过程。

How can I pack a Java application and MySQL installation files in a single exe file? Can I install the MySQL files automatically in background (or without any inputs from user)? This is just to simplify the installation procedure.

推荐答案

Java是跨平台的,MySQL不是,所以你必须使用不同的MySQL二进制文件为多个平台创建各种安装程序。如果你想为非Windows系统包含MySQL源代码,那么这是另一个故事...所以我假设你只想安装Windows。

Java is cross platform, MySQL isn't, so you'd have to create various installers for multiple platforms with different MySQL binaries. If you want to include MySQL source code for non Windows systems, then that's another story... so I assume you want just an installation for Windows.

首先,得到一个你会觉得舒服的安装软件。 维基百科上有一个很好的免费和非免费安装程序列表。

First of all, get an installation software that you'll feel comfortable with. There is a nice list of free and non free installers on Wikipedia.

第二件事,你可以做一个无声的MySQL安装。 此处解释了如何完成。

Second thing, you can do a silent MySQL installation. How it's done is explained here.

但是请注意,在没有用户许可的情况下进行无提示的MySQL安装对我来说听起来不太好,因为MySQL并不是完全轻量级的软件,如果用户已经在某处安装了MySQL,你可能会搞砸一些东西。

But note that doing a silent MySQL installation without user's permission doesn't sound too good to me, since MySQL isn't exactly lightweight software and you might mess up something if a user already has MySQL somewhere installed.

因此,通过这样做,您必须格外小心检查端口3306是否已经启动并运行(默认MySQL端口),以及其他健全性检查以查看如果有可能在后台潜伏另一个实例。

So, by doing this, you have to be extra careful to check if port 3306 is already up and running (default MySQL port), and other sanity checks to see if there's a possibility of another instance lurking in the background.

如果您至少告知您的用户将安装MySQL,那会更好。考虑一下这些细节,因为它们可能会破坏你的一些用户。

It would be better if you at least informed your user that MySQL will be installed. Think about these details, because they might be dealbreakers so some of your users.

这篇关于Java应用程序和MySQL安装在一个包中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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