UseInno SetupCreate 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.Batch installMySQLService:
Under the mysql-5.1.37-win32 \ bin directory:
Create a file: start the 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 the service. Bat
Write:
Net stop exambodymysql (disable the exambodymysql Service)
- 2.Batch installTomcatService:
In the Apache-Tomcat-6.0.33 directory:
Create a file: start the 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 the service. Bat
Net stop exambodytomcat (disable the exambodytomcat Service)
- 3.Create a new compilation FileExambody:
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)