[izpack-users] UninstallerListener and variables

Klaus Bartz bartzkau at gmx.net
Fri Mar 9 20:38:36 CET 2007


Hi Tim and Victoria,
no, unfortunately you can do it not because there is no
UninstallData class in the uninstaller, else this class exist only in
the installer :~|
If you use

String st = "this is my test string";
UninstallData.getInstance().addAdditionalData("myVar", st);

in the installer, uninstaller.jar contains the "file" myVar which contains
an serialized String object with the value "this is my test string". You  
can
look into a jar file with an zip program like WinZip.
To get the String you have to read the "file" with an object stream

     InputStream in = getClass().getResourceAsStream("/myVar");
           // Do not forget the slash ----------------^
     if( in == null )
     { // No actions, nothing todo.
       return;
     }
     ObjectInputStream objIn = new ObjectInputStream(in);
     String stInUninstaller = (String)objIn.readObject();

That's it. If you use a more complex self declared container class which is
not declared in the Java Virtual Machine do
not forget to include the class file into the uninstaller (pack it into the
MyUninstallerListener.jar).

Cheers

Klaus


Am 09.03.2007, 19:49 Uhr, schrieb Tim & Victoria O'Malley  
<tvomalley at gmail.com>:

> So in my UninstallListener can I do the following:
>
> Map additionalData = UninstallData.*getInstance*().getAdditionalData();
>
> String myVar= (String)additionalData.get("myVar");
>
> or do I need to write a handler?
>
> Thanks
>
>
>
> On 3/9/07, Bartz, Klaus <Klaus.Bartz at coi.de> wrote:
>>
>> Hi tvomalley (??),
>> in the IzPack uninstaller there are no IzPack variables from install.xml
>> or
>> from installation process. But you can put what you wont into the
>> uninstaller
>> via
>> UninstallData.getInstance().addAdditionalData("<Name of the data",
>> <DataObject>);
>> You can use RegistryInstallerListener line 146ff (writes log of registry
>> data
>> into uninstaller.jar) and RegistryUninstallerListener line 62ff
>> (reads log of registry data and rewinds the made keys and values) as
>> example.
>>
>> Cheers
>>
>> Klaus
>>
>> > -----Original Message-----
>> > From: izpack-users-bounces at lists.berlios.de
>> > [mailto:izpack-users-bounces at lists.berlios.de] On Behalf Of tvomalley
>> > Sent: Thursday, March 08, 2007 4:18 PM
>> > To: izpack-users at lists.berlios.de
>> > Subject: [izpack-users] UninstallerListener and variables
>> >
>> >
>> >
>> > If I create a custom UninstallerListener can I get a varaible
>> > that is set in my install.xml? Is there a way to pass and
>> > argument to the custom UninstallerListener? Thanks
>> > --
>> > View this message in context:
>> > http://www.nabble.com/UninstallerListener-and-variables-tf3369
>> 129.html#a9374199
>> Sent from the izpack users mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> izpack-users mailing list
>> izpack-users at lists.berlios.de
>> https://lists.berlios.de/mailman/listinfo/izpack-users
>> _______________________________________________
>> izpack-users mailing list
>> izpack-users at lists.berlios.de
>> https://lists.berlios.de/mailman/listinfo/izpack-users
>>
>
>
> __________ NOD32 1.1392 (20060202) Information __________
>
> Diese E-Mail wurde vom NOD32 Antivirus System geprüft
> http://www.nod32.com
>



-- 
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/



More information about the izpack-users mailing list