Use InstallAnywhere to package Java_Web programs and webapp packaging tools

Source: Internet
Author: User
Tags change settings

Use InstallAnywhere to package Java_Web programs and webapp packaging tools
 

I. Preparations

1. Download and install InstallAnywhere;

2. Download the decompressed version jdk1.7 (for example, jdk1.7.0 _ 75 );

3. Download the decompressed version of tomcat7.0 or later (apache-tomcat-7.0.72 In the example );

4. Download The unzipped version of MySQL5.0 or above (the example is a mysql-5.6.26 );

5. Place the web Project in tomcat's webapps, and synchronize the database of the project to the decompressed MySQL, then, place jdk, tomcat, and MySQL in the same folder of a disk;

II,Compile two batch processing files: "install. bat" and "uninstall. bat"

Register the content in service. bat

Echo "registering mysql service"
Cd mysql5.0 \ bin
Mysqld-install mysql-iams

Start content in. bat

Cd mysql5.0 \ bin
Echo "Start mysql service"
Net start mysql-iams
Cd ..
Cd ..
Cd apache-tomcat-7.0.72 \ bin
Call startup. bat

The content in. bat must be clicked before uninstallation:

Cd mysql5.0 \ bin
Net stop mysql-iams
Mysqld remove mysql-iams
Cd ..
Cd ..
Cd apache-tomcat-7.0.72 \ bin
Call shutdown. bat

3. Create a project

Open InstallAnywhere, create a Typical Project Template, select Advanced Designer, set Title, Name, etc.

Iv. Localization Language

Choose Project> Locales> and select the desired localization language.

5. Set Environment Variables

Choose Install> and click Add Action...> Set System Environment Variable> Add>. Set four System Environment variables: JAVA_HOME, CATALINA_HOME, CATALINA_DIR, and PATH. $ USER_INSTALL_DIR $ indicates the installation path selected by the user.

JAVA_HOME: $ USER_INSTALL_DIR $ \ jdk1.7.0 _ 75

CATALINA_HOME: $ USER_INSTALL_DIR $ \ apache-tomcat-7.0.72.

CATALINA_DIR: $ USER_INSTALL_DIR $ \ apache-tomcat-7.0.72 \ bin

PATH: $ USER_INSTALL_DIR $ \ jdk1.7.0 _ 75

\ Bin; $ USER_INSTALL_DIR $ \ mysql5.0 \ bin; $ USER_INSTALL_DIR $ \ apache-tomcat-7.0.72 \ bin; c: \ windows \ system32

Then Add jdk, tomcat, and mysql to the directory directly by clicking Add Files ,:

 

Vi. Registration Service

1. Choose Post-Install> and click Add Action...> Execute Command> Add>. After the installation is complete, run install. bat to register Tomcat and MySQL services. Command Line: cmd/c $ USER_INSTALL_DIR $ \ install. bat $ USER_INSTALL_DIR $. In addition, select the three Options in Options. Move the Execute Command to the front of Panel: Install Complete.

2. Then Add the button Add Action...> mow.text File-Single File> Add>, and then select my under the mysql installation directory in Installed file. in (if this file is not available, create such a file first, and the content is blank). Select the first prepend in Additional Text and enter:

# For advice on how to change settings please see

# Http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html

# *** Do not edit this file. It's a template which will be copied to

# *** Default location during install, and will be replaced if you

# *** Upgrade to a newer version of MySQL.

[Mysqld]

# Remove leading # and set to the amount of RAM for the most important data

# Cache in MySQL. Start at 70% of total RAM for dedicated servers, else 10%.

# Innodb_buffer_pool_size = 128 M

# Set the database engine to INNODB

Default-storage-engine = INNODB

# Set mysql Server Encoding

Character_set_server = utf8

# Setting the mysql server Character Set

Collation-server = utf8_general_ci

[Client]

# Set the default Character Set of the mysql client

Default-character-set = GBK

[WinMySQLAdmin]

Server = $ USER_INSTALL_DIR $ \ mysql5.0 \ bin \ mysqladmin.exe

# Remove leading # to turn on a very important data integrity option: logging

# Changes to the binary log between backups.

# Log_bin

# These are commonly set, remove the # and set as required.

# Set the mysql installation directory. If the directory contains spaces, quotation marks are required.

Basedir = $ USER_INSTALL_DIR $ \ mysql5.0

# Set the directory for storing mysql database data. The folder name must be data

Datadir = $ USER_INSTALL_DIR $ \ mysql5.0 \ data

# Maximum number of connections allowed

Max_connections = 200

# Set port 3306

# Port = 3306

# Server_id = 1

# Remove leading # to set options mainly useful for reporting servers.

# The server defaults are faster for transactions and fast SELECTs.

# Adjust sizes as needed, experiment to find the optimal values.

# Join_buffer_size = 128 M

# Sort_buffer_size = 2 M

# Read_rnd_buffer_size = 2 M

SQL _mode = NO_ENGINE_SUBSTITUTION, STRICT_TRANS_TABLES

Move the mow.text File-Single File to the rear of Panel: Install Complete.

3. Then Add the button Add Action...> excute Script/Batch file> Add>, in which Commnet: Start mysql (that is, start mysql, you can write anything, only you know)

Input in Script: net start mysql

Move the Excute Script/Batch file to the end of mow.text File-Single File.

7. Enable the browser after installation and automatically open the project

Menu Post-Install>, click Add Action...> enter the item address localhost: 8080/ProjectName in Launch Default Browser> Add> OtherUrl to move the Launch Default Browser to the Panel: Install Complete.

VIII. Anti-Installation

Choose Pre-Uninstall> and click Add Action> Execute Command> Add>.

Command Line: cmd/c $ USER_INSTALL_DIR $ \ uninstall. bat $ USER_INSTALL_DIR $

Move the Execute Command to the first one. Select the three Options in Options.

 

IX. Packaging

Choose Build>, and click Build Project>. Wait until the InstallAnywhere package is complete.

After the installation is complete, click Open in Explorer>, and the folder Web_Installers> InstData> Windows> VM>. install.exe is the complete installation package.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.