Ich habe folgendes XML-File für die Installation mit Hilfe von izPack vorliegen:
Im Ordner src habe ich noch ein jar-File liegen, mit dem ich in eine Konfigurationsdatei die IP-Adresse und den Port der Datenbank reinschreibe. Außerdem werden die Tabellen erstellt sowie die Insert-Anweisungen durchgeführt. Wie kann ich aus dem XML-File dieses Skript automatisch ausführen?
Code:
<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<!--
A sample installation file.
Use it as a base for your own installers :-)
To compile it :
- go in the bin directory where you installed IzPack
- call "compile ../sample/install.xml -b ../sample"
-->
<installation version="1.0">
<!--
The info section.
The meaning of the tags should be natural ...
-->
<info>
<appname>Installation</appname>
<appversion>1.0 beta</appversion>
<authors>
<author name="Autor" email="xml@e-mail.de"/>
</authors>
<url>http://www.irgendeine-adresse.de/</url>
</info>
<!--
The gui preferences indication.
Sets the installer window to 640x480. It will not be able to change the size.
-->
<guiprefs width="640" height="480" resizable="no"/>
<!--
The locale section.
Asks here to include the English and German langpacks.
-->
<locale>
<langpack iso3="deu"/>
<langpack iso3="eng"/>
</locale>
<!--
The resources section.
The ids must be these ones if you want to use the LicencePanel and/or the InfoPanel.
-->
<resources>
<res id="LicencePanel.licence" src="Licence.txt"/>
<res id="InfoPanel.info" src="Readme.txt"/>
</resources>
<!--
The panels section.
We indicate here which panels we want to use. The order will be respected.
-->
<panels>
<panel classname="HelloPanel"/>
<panel classname="InfoPanel"/>
<panel classname="LicencePanel"/>
<panel classname="TargetPanel"/>
<panel classname="PacksPanel"/>
<panel classname="InstallPanel"/>
<panel classname="FinishPanel"/>
</panels>
<!--
The packs section.
We specify here our packs.
-->
<packs>
<pack name="Base" required="yes">
<description>The base files</description>
<file src="Readme.txt" targetdir="$INSTALL_PATH"/>
<file src="Licence.txt" targetdir="$INSTALL_PATH"/>
<file src="script.bat" targetdir="$INSTALL_PATH"/>
<parsable targetfile="$INSTALL_PATH/script.bat"/>
</pack>
<pack name="Docs" required="no">
<description>The documentation</description>
<file src="doc" targetdir="$INSTALL_PATH"/>
</pack>
<pack name="Sources" required="no">
<description>The sources</description>
<file src="src" targetdir="$INSTALL_PATH"/>
</pack>
</packs>
</installation>
Im Ordner src habe ich noch ein jar-File liegen, mit dem ich in eine Konfigurationsdatei die IP-Adresse und den Port der Datenbank reinschreibe. Außerdem werden die Tabellen erstellt sowie die Insert-Anweisungen durchgeführt. Wie kann ich aus dem XML-File dieses Skript automatisch ausführen?