Klaus Ruehl wrote:
>
> Okay, the question was how to remove entries in the version registry?
There are several bugs, but the intention is
-- there should be an uninstaller
-- getVersion/compareVersion should only returns versions if
the named package is still present on disk.
Neither of these work, the first is simply unimplemented and a series of
bugs (28896,64835, 53845) knock out the second .
> // That would be nice. Unfortunately there are only predefined settings in
> the interface for the Users and Common branch. (Mmh, okay I suppose that the
> version registry has its own branch in the registry, but maybe I am wrong.
> But if I am right, what would be the correct key for the
> VersionRegistryRootKey here??)
see
http://lxr.mozilla.org/seamonkey/source/modules/libreg/src/reg.h#58
> // Okay, next step: Remove the requested package entry and save changes
> oRegistry.removeKey(oVersionRegistryRootKey, "myCompany/myPackage");
> oRegistry.pack();
> oRegistry.flush();
> // Mmmh and again I am not sure, if this will really do the job ;-( And by
> the way: Where is the close() method in nsIRegistry??)
The registry will close automatically when the refcount on the nsIRegistry
goes to zero. If you release the registry you don't really need to do
flush() -- that will be done automatically when it closes. flush() is more
for cases where you're keeping the registry open for a long while but are
paranoid about making sure changes get physically saved to disk.
-Dan Veditz