Jdk, tomcat, mysql, and innosetup Encapsulation

Source: Internet
Author: User
Tags apache tomcat
Jdk, tomcat, mysql, and innosetup package reference address: www.cnblogs.comxionghuiarchive201203222411207.html has been verified. Follow the steps to create a folder named exambody using the innoSetup installation package, apache-tomcat-6.0.33, mysql-5.1.37-win32, java

Jdk, tomcat, mysql, inno setup package reference address: http://www.cnblogs.com/xionghui/archive/2012/03/22/2411207.html has been verified, by the steps, everything is normal with inno Setup installation package to create a new folder exambody, apache-tomcat-6.0.33, mysql-5.1.37-win32, java

Pack jdk, tomcat, mysql, and inno setup
Reference address:
Http://www.cnblogs.com/xionghui/archive/2012/03/22/2411207.html
Verification has been performed. Follow the steps to make everything normal.

Use inno Setup to create the installation package
Create a folder named exambody with apache-tomcat-6.0.33, mysql-5.1.37-win32, java (Note: jdk), and exambody. ico



1.1. Batch install mysql service:
Under the mysql-5.1.37-win32 \ bin directory:

Create a file: Start service. bat

Write:

Cd/d % ~ Dp0 (switch to the current directory)

"% Cd % \ mysqld.exe"-install exambodyMysql

(Install the mysqld service and name it exambodyMysql)

Net start exambodyMysql (disable the exambodyMysql Service)



Create a new file: Disable service. bat

Write:

Net stop exambodyMysql (disable the exambodyMysql Service)

1.2. Batch install tomcat service:
In the apache-tomcat-6.0.33 directory:

Create a file: Start service. bat

Cd/d % ~ Dp0 (switch to the current directory)

"% Cd % \ service. bat" install (install tomcat service)

Find service. bat in the current directory:

Find:

Rem Guess CATALINA_HOME if not defined

Set "CURRENT_DIR = % cd %"

If not "% CATALINA_HOME %" = "" goto gotHome

Set "CATALINA_HOME = % cd %"

If exist "% CATALINA_HOME % \ bin \ tomcat6.exe" goto okHome

Rem CD to the upper dir

: GotHome

Modify:

Rem Guess CATALINA_HOME if not defined

Set "CURRENT_DIR = % cd %"

Rem if not "% CATALINA_HOME %" = "" goto gotHome

Rem set "CATALINA_HOME = % cd %"

Rem if exist "% CATALINA_HOME % \ bin \ tomcat6.exe" goto okHome

Rem CD to the upper dir

Cd ..

Set "CATALINA_HOME = % cd %"

: GotHome

Note: rem comment out the four rows.

Cd .. is to jump to the upper-level directory of the current directory, that is, apache-tomcat-6.0.33,

Set "CATALINA_HOME = % cd %" is to set CATALINA_HOME to the current directory



Find:

Set "EXECUTABLE = % CATALINA_HOME % \ bin \ tomcat6.exe"

Rem Set default Service name

Set SERVICE_NAME = Tomcat6

Set PR_DISPLAYNAME = Apache Tomcat 6

Modify:

Set "EXECUTABLE = % CATALINA_HOME % \ bin \ tomcat6.exe"

Rem Set default Service name

Set SERVICE_NAME = exambodyTomcat

Set PR_DISPLAYNAME = exambodyTomcat

Note:
First: exambodyTomcat modify service name

Second: exambodyTomcat service display name



Find:

: DoInstall

Rem Install the service

Echo Installing the service '% SERVICE_NAME % '...

Echo Using CATALINA_HOME: "% CATALINA_HOME %"

Echo Using CATALINA_BASE: "% CATALINA_BASE %"

Echo Using JAVA_HOME: "% JAVA_HOME %"

Rem Use the environment variables as an example

Rem Each command line option is prefixed with PR _

Modify:

: DoInstall

Cd ..

Set "JAVA_HOME = % cd % \ java \ jdk1.6.0 _ 21"

Rem Install the service

Echo Installing the service '% SERVICE_NAME % '...

Echo Using CATALINA_HOME: "% CATALINA_HOME %"

Echo Using CATALINA_BASE: "% CATALINA_BASE %"

Echo Using JAVA_HOME: "% JAVA_HOME %"

Rem Use the environment variables as an example

Rem Each command line option is prefixed with PR _

Note: cd .. is to jump to the upper-level directory of the current directory, that is, exambody

Set "JAVA_HOME = % cd % \ java \ jdk1.6.0 _ 21"

Is to set JAVA_HOME to exambody \ java \ jdk1.6.0 _ 21

Find:

Echo The service '% SERVICE_NAME %' has been installed.

: End

Cd "% CURRENT_DIR %"

Modify:

Echo The service '% SERVICE_NAME %' has been installed.

SC config exambodyTomcat start = auto

SC start exambodyTomcat

: End

Cd "% CURRENT_DIR %"

Note: SC config exambodyTomcat start = auto

Set exambodyTomcat to self-start

SC start exambodyTomcat Service

Create a new file: Disable service. bat

Net stop exambodyTomcat (disable the exambodyTomcat Service)

1.3. Create a new compilation file exambody: the code is as follows:

# Define MyAppName ""

# Define MyAppVersion "1.0"

[Setup]

AppName = {# MyAppName} (installer name)

AppVersion = {# MyAppVersion} (set version)

; AppVerName = {# MyAppName }{# MyAppVersion}

DefaultDirName = D: \ exambody (default installation path)

DefaultGroupName = {# MyAppName}

AllowNoIcons = yes

OutputDir = output (output path)

OutputBaseFilename = setup (installer name)

SetupIconFile = exambody \ exambody. ico (set the icon)

Compression = lzma

SolidCompression = yes



[Languages] (set language)

Name: "chinesesimp"; MessagesFile: "compiler: Default. isl"



[Files] (copying Files)

Source: "exambody \ *"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs



[Icons]

Name: "{group }\{ cm: UninstallProgram, {# MyAppName }}"; Filename:" {uninstallexe} "(uninstall the file and generate shortcuts from the Start menu)

Name: "{commondesktop} \ "; Filename: http: // localhost: 8080 (shortcut for creating a home page on the desktop)



[Run] (files automatically Run after installation)

Filename: "{app} \ mysql-5.1.37-win32 \ bin \ Startup service. bat"; Flags: nowait runhidden; (start mysql Service)

Filename: "{app} \ apache-tomcat-6.0.33 \ bin \ Start service. bat"; Flags: nowait runhidden; (start tomcat Service)

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.