[izpack-users] Execute Java Class
macke
maier at isys.uni-klu.ac.at
Tue Nov 7 20:05:15 CET 2006
Hi!
ok, in ProcessPanel.Spec.xml make sure it is ..
<processing>
<job name="any">
<os family="windows"/>
<executeclass name="src.Property.TestWrite"/>
</job>
</processing>
it's NOT <executableclass>
and you have to specify the right path. So if you have the TestWrite.class
in the package src.Property, as I see in your code, you have to write:
<executeclass name="src.Property.TestWrite"/>
bye,
macke
Mandeep wrote:
>
> Hi Macke,
>
> Thankyou very much for the help but it hasn't solved my problem. I have
> a feeling that I am wrong somewhere in specifying the paths. I am
> sending you my complete files with the attachment so that you can have a
> clear Idea of what I am doing.
>
> I have also tried with the following path in the ProcessPanel.Spec.xml:
>
> <executeclass name="com.izforge.izpack.util.TestWrite">
>
> Thankyou again for ur kind help.
>
> Regards
> Mandeep
>
>
>
>
>
> macke wrote:
>
>> Hi!
>>
>> First you have to specify in your install.xml, that you want to use the
>> ProcessPanel:
>> <panels>
>> ...
>> <panel classname="ProcessPanel"/>
>> ...
>> </panels>
>>
>> In the resources section of install.xml you have to tell where the xml
>> for
>> it is:
>>
>> <resources>
>> .....
>> <!-- what has the ProcessPanel to do -->
>> <res id="ProcessPanel.Spec.xml" src="PATH/TO/ProcessPanel.Spec.xml"/>
>> </resources>
>>
>> And you have to include your class. Easiest way is to generate a JAR file
>> including your class. In the install.xml you have then to add the line,
>> e.g.
>> <jar src="PATH/TO/WriteProperties.jar"/>
>>
>> In the ProcessPanel.Spec.xml you have to write:
>> <processing>
>> <job name="name of teh job">
>> <os family="windows" />
>> <executeclass name="com.izforge.izpack.util.WriteProperties"> <!-- this
>> is
>> an example! as you see you have to write the package path to your class.
>> If
>> you don't use packages, only write WriteProperties -->
>> <arg>arg1</arg>
>> ...
>> </executeclass>
>> </processing>
>>
>> Hope this helps.
>>
>> regards,
>> Macke
>>
>>
>>
>>
>> Mandeep wrote:
>>
>>>I want to execute (during or after the installation process) java class
>>>which creates a properties file . I am trying to do this with
ProcessPanel
>>>and writing the following ProcessPanel.Spec.xml for the same:
>>><processing>
>>><job name="any">
>>> <os family="windows"/>
>>> <executableclass name="$INSTALL_PATH/src/WriteProperties.class"/>
>>></job>
>>></processing>
>>>is this the right way to do it...or should I so something else? Please
>>>suggest me.....I am new to IzPack.
>>>
>>
>>
>
>
> <processing>
> <job name="any">
> <os family="windows"/>
> <executableclass name="$INSTALL_PATH/src/Property/TestWrite"/>
> </job>
> </processing>
>
> package src.Property;
>
> import java.io.File;
> import java.io.FileInputStream;
> import java.io.OutputStream;
> import java.util.Properties;
>
>
> public class TestWrite extends java.util.Properties
> {
>
>
>
> public TestWrite()
> {
> super();
> }
> public void setDefault(Properties defProp)
> {
> defaults = defProp;
> }
>
>
> public static void main(String[] args)
> {
> TestWrite prop = new TestWrite();
> OutputStream out=null;
> prop.put("HEIGHT","300");
> prop.put("WIDTH","300");
> String propFileName = "Y:/IzPack/src/lib/prop.prp";
> String comment = "APP SETTINGS, //date will be different for you of
> course";
>
> File outFile = new java.io.File(propFileName);
> try
> {
> out = new java.io.FileOutputStream(outFile);
> prop.store(out, comment);
> }
> catch(java.io.IOException ioe)
> {
> System.out.print(ioe);
> }
> finally
> {
> try{
> out.flush();
> out.close();}
> catch(Exception e)
> {
> System.out.print(e);
> }
> out = null;
> }
> }
>
> }
>
> <?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
>
> <installation version="1.0">
>
> <!--
> The info section.
> The meaning of the tags should be natural ...
> -->
> <info>
> <appname>Sample Installation</appname>
> <appversion>1.4 beta 666</appversion>
> <authors>
> <author name="JPz" email="jpz at superman.org"/>
> <author name="Hidden Man" email="hidden at hisdomain.com"/>
> </authors>
> <url>http://www.anotherworld-inspace-website.net/</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 French langpacks.
> -->
> <locale>
> <langpack iso3="eng"/>
> <langpack iso3="fra"/>
> </locale>
>
> <jar src="Y:/IzPack/src/lib/src/Property/TestWrite.jar"/>
>
> <variables>
> <variable name="Any" value="something"/>
> <variable name="any2" value="again something"/>
> </variables>
>
> <!--
> 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="Y:/IzPack/src/lib/Licence.txt"/>
> <res id="InfoPanel.info" src="Y:/IzPack/src/lib/Readme.txt"/>
> <res id="userInputSpec.xml" src="Y:/IzPack/src/lib/userInputSpec.xml"/>
> <res id="ProcessPanel.Spec.xml"
> src="Y:/IzPack/src/lib/ProcessPanel.Spec.xml"/>
> </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="UserInputPanel"/>
> <panel classname="TargetPanel"/>
> <panel classname="ProcessPanel"/>
> <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="Y:/IzPack/src/lib/Readme.txt"
> targetdir="$INSTALL_PATH"/>
> <file src="Y:/IzPack/src/lib/Licence.txt"
> targetdir="$INSTALL_PATH"/>
> <file src="Y:/IzPack/src/lib/script.bat"
> targetdir="$INSTALL_PATH"/>
> <parsable targetfile="$INSTALL_PATH/script.bat"/> <!-- The
> file will be parsed -->
> </pack>
> <pack name="Docs" required="no">
> <description>The documentation</description>
> <file src="Y:/IzPack/src/lib/doc" targetdir="$INSTALL_PATH"/>
> <!-- Reccursive adding -->
> </pack>
> <pack name="Sources" required="no">
> <description>The sources</description>
> <file src="Y:/IzPack/src/lib/src" targetdir="$INSTALL_PATH"/>
> </pack>
> </packs>
>
> </installation>
>
> _______________________________________________
> izpack-users mailing list
> izpack-users at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/izpack-users
>
>
--
View this message in context: http://www.nabble.com/Execute-Java-Class-tf2589791.html#a7224821
Sent from the izpack users mailing list archive at Nabble.com.
More information about the izpack-users
mailing list