[izpack-devel] Issues while reading data from packs

Bartz, Klaus Klaus.Bartz at coi.de
Fri Aug 4 11:54:18 CEST 2006


Hi Michael,
see context related.

>-----Original Message-----
>From: izpack-devel-bounces at lists.berlios.de
>[mailto:izpack-devel-bounces at lists.berlios.de]On Behalf Of Michael
>Scherer
>Sent: Friday, August 04, 2006 11:07 AM
>To: izpack-devel at lists.berlios.de
>Subject: [izpack-devel] Issues while reading data from packs
>
>
>Hi.
>
>I'm currently trying to implement a BackupPanel which saves all
>files that will be overwritten by the InstallPanel into a jar.File.
>
>While doing this I'm trying to find all filenames by reading them
>from the packs like the InstallPanel does ...
>

?? The Unpacker reads the pack "files" (entries in the jar file).

>Now when doing "PackFile packFile = 
>(PackFile)packStream.readObject();" I get
>java.io.OptionalDataException
>         at java.io.ObjectInputStream.readObject0(Unknown Source)
>         at java.io.ObjectInputStream.readObject(Unknown Source)
>         at 

The structure of a pack is really specific. There are ints, packs
and the data in a well (not documented) order. If you would read the
hole pack file you have to skip the "to be installed part". 
That's what you NOT DO. 
Seems so, you think that the pack file only
contains the information of a pack. No, it contains the hole pack.

And so on...

Debug your class. In the docu there is a description how to debug
IzPack with eclipse.
Be aware that you are working very deep in IzPack. I assume, that
you get performance problems during skipping all the pack contents.

If I have to implement something like this, I think I will implement
an InstallListener which implements isFileListener and
beforeFile.
isFileListener returns true,
beforeFile makes the backup.
See as example 
%IZ_HOME%\sample\src\myCompany\tools\install\listener\ChmodInstallerListener.java

You conserve about the real hard job to find the files which are
selected for installation. That's with "selected" is not to much simple,
the Unpacker needs over 150 lines of code to handle it.
beforeFile will be called from the Unpacker before a file will be installed. 


>com.izforge.izpack.panels.OpenBackupPanelAutomationHelper.doBac
>kup(OpenBackupPanelAutomat
>ionHelper.java:61)
>
>What am I doing wrong here, copied must of the stuff from InstallPanel.
>Mmmh, thanks for your help.
>
>Greetings,
>  Michael
>
>PS: see my panel attached to this email
>

Cheers

Klaus



More information about the izpack-devel mailing list