简体   繁体   中英

How do I make an installer for my java program which also installs mysql?

When the program is installing on windows, I want the installer to check if mysql is installed, and install it if it isn't (Or at very least give a link to the website so the user can install it)

I'm sure this is possible, I've been trying to figure this out for a while now. If you can have an installer check if the user has java installed and install it if they don't, then surely you can do the same for mysql?

Perhaps I'm looking at this the wrong way - should I instead be getting the java program to check if mysql is installed and install it then if it isn't? And if so, how do I do that?

Any help would be hugely appreciated, I've been stuck with this for a long time.

I refer to this answer.

Java is cross platform, MySQL isn't, so you'd have to create various installers for multiple platforms with different MySQL binaries.

My suggestion is to have a look around the web in order to find the correct way to create an installer depending on the OS you're using

Installer is usually created for OS (Windows, Linux). In our case we created deb package (for Debian) which checked if PostgreSQL and other prerequisites are installed and installed what is missing. So, basically it is job for installation script (in our case it was shell).

Wix installers along with .bat files you can use. http://wixtoolset.org/ It has built-in directives that can check if software is installed or not, outdated version notifications also.But WIX is kind of a database of your software binaries.So you have to include the binaries of MySQL(whichever are supported on windows) in the installer using harvest wix utility. http://wixtoolset.org/documentation/manual/v3/overview/heat.html

This will just copy the binaries in your target directory if the software is not installed, you have to write all this logic to skip or install using wix directives/conditional custom actions .To do after copy stuff like starting or configuring the service either write a bat/powershell file which will handle all this and you can invoke this powershell file from wix after the copy action using wix custom action directives. http://wixtoolset.org/documentation/manual/v3/wixdev/extensions/authoring_custom_actions.html .

Or you can write all the steps of bat files in many different custom actions.You will need visual studio to create this installer.In the begining it will be trouble to understand how it works but this is the best way to create production level deployment/product installers for microsoft suite.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM