[izpack-users] Windows XP Registry Entries cleaning up

fxa fxa_01 at yahoo.com
Wed Jul 25 00:27:45 CEST 2007


Look at the case for CHANGED_VALUE:  If value has changed it gets replaced
with old value, not being deleted.  So if you had version 1.0 and upgrade to
1.1 then on uninstall it will not be removed just reset to version 1.0



Daniel Silva-3 wrote:
> 
> Sorry,  but what does it mean "roll entries back"?
> 
> I looked at RegistryImpl (thats probably the one used) and I couldnt
> figure
> out on witch case of the rli.getType() the execution falls. It should fall
> on the RegistryLogItem.CREATED_VALUE or RegistryLogItem.CREATED_KEY case,
> for those are the ones that delete entries. But this name, "CREATED", is
> really strange for a deleting process.
> 
> Intuitively, it falls on the RegistryLogItem.REMOVED_KEY or
> RegistryLogItem.REMOVED_VALUE. But thoses cases actually creates entries
> 
> the switch clause in the RegistryImpl.rewind() is like this:
> 
> switch (rli.getType())
>                 {
>                 case RegistryLogItem.CREATED_KEY:
>                     deleteKeyIfEmpty(rli.getRoot(), rli.getKey());
>                     break;
>                 case RegistryLogItem.REMOVED_KEY:
>                     createKeyN(rli.getRoot(), rli.getKey());
>                     break;
>                 case RegistryLogItem.CREATED_VALUE:
>                     RegDataContainer currentContents = null;
>                     // Delete value only if reg entry exists and is equal
> to
> the stored value.
>                     try
>                     {
>                         currentContents = getValue(rli.getRoot(),
> rli.getKey(),
> rliValueName);
>                     }
>                     catch (NativeLibException nle)
>                     {
>                         break;
>                     }
>                     if (currentContents.equals(rli.getNewValue()))
>                     {
>                         deleteValueN(rli.getRoot(), rli.getKey(),
> rliValueName);
>                     }
>                     // TODO: what todo if value has changed?
>                     break;
>                 case RegistryLogItem.REMOVED_VALUE:
>                     // Set old value only if reg entry not exists.
>                     try
>                     {
>                         getValue(rli.getRoot(), rli.getKey(),
> rliValueName);
>                     }
>                     catch (NativeLibException nle)
>                     {
>                         setValueN(rli.getRoot(), rli.getKey(),
> rliValueName,
> rli
>                                 .getOldValue());
>                     }
>                     break;
>                 case RegistryLogItem.CHANGED_VALUE:
>                     // Change to old value only if reg entry exists and
> equal to
>                     // the
>                     // stored value.
>                     try
>                     {
>                         currentContents = getValue(rli.getRoot(),
> rli.getKey(),
> rliValueName);
>                     }
>                     catch (NativeLibException nle)
>                     {
>                         break;
>                     }
>                     if (currentContents.equals(rli.getNewValue()))
>                     {
>                         setValueN(rli.getRoot(), rli.getKey(),
> rliValueName,
> rli
>                                 .getOldValue());
>                     }
>                     break;
>                 }
> 
> On 7/24/07, fxa <fxa_01 at yahoo.com> wrote:
>>
>>
>> Actually what is happening is:  it rolls back entries.  Look at "rewind"
>> method in registry handler.  If you start with no entries, uninstall will
>> delete entries otherwise it roll them back to previous settings.
>>
>>
>> Bartz, Klaus wrote:
>> >
>> > Hi Daniel,
>> > I am not secure that I have understand right. Do it now work or not?
>> > You can have as much Listener as you need. The RegistryHandler will be
>> > used internal
>> > in the RegistryInstallerListener, but it can be used also at an other
>> > place. Then it is needed
>> > to use only one instance of it. But I assume that you do not use
>> registry
>> > at an other point.
>> >
>> > I have just tested the IzPack 3.10.2 installation and uninstallation.
>> It
>> > works as assumed.
>> > My box has Windows XP SP2, I use Java SDK 1.5.0_11.
>> > If the uninstallation of IzPack after a clean installation (without
>> > preexistent keys)
>> > will not clean the regkeys I do not know why. Test it on an other
>> > computer.
>> >
>> > Cheers
>> >
>> > Klaus
>> >
>> >       -----Original Message-----
>> >       From: izpack-users-bounces at lists.berlios.de
>> > [mailto:izpack-users-bounces at lists.berlios.de] On Behalf Of Daniel
>> Silva
>> >       Sent: Tuesday, July 24, 2007 1:48 PM
>> >       To: izpack-users at lists.berlios.de
>> >       Subject: Re: [izpack-users] Windows XP Registry Entries cleaning
>> up
>> >
>> >
>> >       also, I´m using Windows XP as an administrator, so I must have
>> all
>> the
>> > rights to change the registry.
>> >
>> >
>> >       On 7/24/07, Daniel Silva <ddso.01 at gmail.com> wrote:
>> >
>> >               Hi Klaus, thanks again.
>> >
>> >               I removed the registries myself after uninstalling.
>> Installed again and
>> > uninstalled all over. The registries are still not automatically
>> removed.
>> >
>> >               I didnt understand what you said about using a second
>> RegistryHandler,
>> > but the registries that my installation process creates never change.
>> I´m
>> > only using one for the installation and one for the uninstallation:
>> >
>> >
>> >               <listener  installer="RegistryInstallerListener"
>> >                             uninstaller="RegistryUninstallerListener">
>> >                             <os family="windows"/>
>> >               </listener>
>> >
>> >               I´m using another for the installation, but there´s
>> nothing to do with
>> > the registry:
>> >
>> >               <listener installer="SummaryLoggerInstallerListener"/>
>> >
>> >               Also, I changed the $APP_NAME to $UNINSTALL_NAME in
>> RegistrySpec.xml and
>> > CheckedHelloPanel started working the way the manual said it would.
>> That´s
>> > something, all right. Thanks for that clue.
>> >
>> >
>> >
>> >               On 7/24/07, Bartz, Klaus <Klaus.Bartz at coi.de > wrote:
>> >
>> >                       Hi Daniel,
>> >                       if you do not use a second RegistryHandler all
>> keys (except some with
>> > format multi string) have to
>> >                       be removed after uninstall, if the have not
>> changed after install.
>> >                       If the keys exist before installing, they will
>> also exist after
>> > uninstall. This can be if you have forgotten the dll
>> >                       in the uninstaller (keyword "both") in a previos
>> test. The uninstaller
>> > do not simple remove the entries else
>> >                       it changes the entries to the state before
>> installation.
>> >                       Therefore remove the not automatically removed
>> keys after uninstall and
>> > test again with install - uninstall.
>> >
>> >                       This work only with a direct call of the
>> uninstaller.jar, not at
>> > debugging with e.g. Eclipse. For the last
>> >                       see my email to "fxa".
>> >
>> >                       Cheers
>> >
>> >                       Klaus
>> >
>> >                               -----Original Message-----
>> >                               From:
>> izpack-users-bounces at lists.berlios.de
>> > [mailto:izpack-users-bounces at lists.berlios.de] On Behalf Of Daniel
>> Silva
>> >                               Sent: Monday, July 23, 2007 7:53 PM
>> >                               To: izpack-users at lists.berlios.de
>> >
>> >                               Subject: Re: [izpack-users] Windows XP
>> Registry Entries cleaning up
>> >
>> >
>> >
>> >                               Hi Klaus, thans for the reply.
>> >
>> >                               the "registryEntries",
>> native\COIOSHelper.dll  and the
>> > com\izforge\izpack\event\RegistryUninstallerListener.class are all
>> there.
>> >                               I really dont know if the key are
>> persistent or not. How do I know
>> > that?
>> >
>> >                               Even izPack entries are not erase when I
>> uninstall it.
>> >
>> >
>> >
>> >                               On 7/23/07, Bartz, Klaus <
>> Klaus.Bartz at coi.de > wrote:
>> >
>> >                                       Hi Daniel,
>> >                                       sorry for late answer, but I was
>> on a workshop.
>> >                                       I do not really know why
>> uninstall
>> do not work correctly with your
>> > program.
>> >                                       We use $UNINSTALL_NAME instead of
>> $APP_NAME, but this should produce
>> > only problems
>> >                                       with multiple installations of
>> the
>> same program.
>> >
>> >                                       Try with some additional other
>> keys, may be with the root HKCU.
>> >
>> >                                       Are all keys persistent, or only
>> some?
>> >                                       Look into your
>> uninstaller.jar(may be with an unzipper or with jar).
>> >                                       Is there a file "registryEntries"
>> in the root? It is a java object
>> > stream, but with some editors
>> >                                       you can look into. If you can, is
>> there the entry
>> >
>> SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\<your APP_NAME>
>> > ?
>> >                                       Is in the uninstaller
>> >
>> com\izforge\izpack\event\RegistryUninstallerListener.class
>> >                                       and
>> >                                       native\COIOSHelper.dll        ?
>> >
>> >                                       Cheers
>> >
>> >
>> >                                       Klaus
>> >
>> >
>> >                                       -----Original Message-----
>> >                                       From:
>> izpack-users-bounces at lists.berlios.de
>> > [mailto:izpack-users-bounces at lists.berlios.de] On Behalf Of Daniel
>> Silva
>> >                                       Sent: Monday, July 16, 2007 10:38
>> PM
>> >                                       To: izpack-users at lists.berlios.de
>> >                                       Subject: [izpack-users] Windows
>> XP
>> Registry Entries cleaning up
>> >
>> >
>> >                                       Hi,
>> >
>> >                                       I´ve just started using izPack
>> for
>> my applications and I had some
>> > trouble with Windows XP registry entries.
>> >
>> >                                       I have a InstallSpec.xml file for
>> the installer creating procedure
>> > with the following lines
>> >
>> >                                       <?xml version="1.0"
>> encoding="UTF-8" standalone="yes" ?>
>> >                                       <installation version="1.0">
>> >                                          (...)
>> >                                          <native type="izpack" name="
>> ShellLink.dll"/>
>> >                                             <native type="3rdparty"
>> name="COIOSHelper.dll" stage="both">
>> >                                             <os family="windows"/>
>> >                                          </native>
>> >                                          (...)
>> >                                          <resources>
>> >                                             (...)
>> >                                             <res
>> src="./spec/RegistrySpec.xml" id="RegistrySpec.xml"/>
>> >                                             (...)
>> >                                          </resources>
>> >                                          (...)
>> >                                          <listeners>
>> >                                             <listener
>> installer="SummaryLoggerInstallerListener"/>
>> >                                             <listener
>> installer="RegistryInstallerListener"
>>
>> >                                                         
>> uninstaller="RegistryUninstallerListener">
>> >                                                <os family="windows"/>
>> >                                             </listener>
>> >                                          </listeners>
>> >                                          (...)
>> >                                       </installation>
>> >
>> >                                       And a RegistrySpec.xml like this:
>> >
>> >                                       <?xml version="1.0"
>> encoding="UTF-8" standalone="yes" ?>
>> >
>> >                                       <registry>
>> >                                        <pack name="UninstallStuff">
>> >                                         <value name="DisplayName"
>> >
>> > keypath="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$APP_NAME"
>> >                                          root="HKLM"
>> >                                          string="$APP_NAME"/>
>> >                                         <value name="UninstallString"
>> >
>> > keypath="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$APP_NAME"
>> >                                          root="HKLM"
>> >                                         
>> string=""$JAVA_HOME\bin\javaw.exe"
>> -jar
>> > "$INSTALL_PATH\Uninstaller\uninstaller.jar""/>
>> >                                         <value name="DisplayIcon"
>> >
>> > keypath="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$APP_NAME"
>> >                                          root="HKLM"
>>
>> >                                         
>> string="$INSTALL_PATH\icons\SCarimbo.ico"/>
>> >                                         <value name="HelpLink"
>> >
>> > keypath="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$APP_NAME"
>> >                                          root="HKLM"
>> >                                          string="$APP_URL"/>
>> >                                             </pack>
>> >                                       </registry>
>> >
>> >                                       I'm using CheckedHelloPanel, so
>> $APP_NAME is declared. My problem is
>> > that when I uninstall the application, the registry entries are not
>> > erased. The application is still listed as installed in Control Panel
>> ->
>> > Add or Remove Programs.
>> >
>> >                                       Am I doing something wrong?
>> >
>> >                                       Obs.: I've notice that when I
>> uninstall izPack itself, its registry
>> > entries are not erased either.
>> >                                       --
>> >                                       Abraços,
>> >                                       Daniel Silva
>> >
>> >
>> >
>> _______________________________________________
>> >                                       izpack-users mailing list
>> >                                       izpack-users at lists.berlios.de
>> >
>> https://lists.berlios.de/mailman/listinfo/izpack-users
>> >
>> >
>> >
>> >
>> >
>> >
>> >                               --
>> >                               Abraços,
>> >                               Daniel Silva
>> >
>> >
>> >                       _______________________________________________
>> >                       izpack-users mailing list
>> >                       izpack-users at lists.berlios.de
>> >
>> https://lists.berlios.de/mailman/listinfo/izpack-users
>> >
>> >
>> >
>> >
>> >
>> >
>> >               --
>> >               Abraços,
>> >               Daniel Silva
>> >
>> >
>> >
>> >
>> >       --
>> >       Abraços,
>> >       Daniel Silva
>> >
>> >
>> > _______________________________________________
>> > 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/Windows-XP-Registry-Entries-cleaning-up-tf4091026.html#a11766768
>> 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
>>
> 
> 
> 
> -- 
> Abraços,
> Daniel Silva
> 
> _______________________________________________
> 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/Windows-XP-Registry-Entries-cleaning-up-tf4091026.html#a11773078
Sent from the izpack users mailing list archive at Nabble.com.



More information about the izpack-users mailing list