[izpack-users] How to extract zipped file to a temp directory using IzPack

Christopher Brooks cxh at eecs.berkeley.edu
Fri Sep 29 00:26:33 CEST 2006


On Friday 22 September 2006 03:08, Gowri Shankar wrote:
> Hello,
>
> I need a small help, I need to use some file inside an archived
> folder. The archived folder will be shipped with the installer and
> while installing we
> need to extract file to temp dir and use some file in it. can you
> help me in this regards.
>
> Thanks,
> GowriShankar.

I have a similar issue, where I have a jar file that has my source code in
it and I would like to extract the jar file if and only if the user selects
the source code pack.  My workaround was to use the ProcessPanel,
and to write a small class (ExtractJarFile) that extracts a jar file.
I also use an even smaller class file (Echo) to Echo a message.

The tricky part is that both .class files need to go in to a jar file 
and then be added to the installer with the <jar> directive.

My install.xml file looks like:
--start--
...
    </resources>
...
        <res src="ProcessPanel.Spec.xml" id="ProcessPanel.Spec.xml"/>
    </resources>

    <panels>
...
        <panel classname="ProcessPanel"/>
...

    </panels>

    <!-- Include ExtractJarFile.class for the Process Panel -->
    <jar src="ExtractJarFile.jar" stage="install"/>
...
--end--



ProcessPanel.Spec.xml looks like:
--start--
<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>

<processing>
  <job name="unjar sources">
    <executeForPack name="Sources"/>
    <executeclass name="ExtractJarFile">
      <arg>ptII6.0.alpha.src.jar</arg>
      <arg>$INSTALL_PATH</arg>
    </executeclass>
  </job>
  <job name="Done">
    <executeclass name="Echo">
      <arg>Processing completed, please press Next.</arg>
    </executeclass>
  </job>
</processing>

--end--

The docs could use an update, they don't mention the <jar> issue
or executeForPack.  I'll submit a patch to the devel list.

_Christopher

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Echo.java
Type: application/octet-stream
Size: 2196 bytes
Desc: not available
Url : https://lists.berlios.de/pipermail/izpack-users/attachments/20060928/69754157/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ExtractJarFile.java
Type: application/octet-stream
Size: 9513 bytes
Desc: not available
Url : https://lists.berlios.de/pipermail/izpack-users/attachments/20060928/69754157/attachment-0001.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 2773 bytes
Desc: not available
Url : https://lists.berlios.de/pipermail/izpack-users/attachments/20060928/69754157/attachment.bin 


More information about the izpack-users mailing list