Hi all,

I posted this question some time ago, but didn't get an answer yet.I saw
that Shuli Liss had the same problem with the version registry, so I assume
that there are currently some problems with postings to the newsgroup.

Okay, the question was how to remove entries in the version registry?
Assuming I had installed a package with the registry package name
"myCompany/myPackage" and Version "a.b.c.d", there should be a corresponding
entry in the version registry.
After installation the call InstallTrigger.getVersion("myCompany/myPackage")
should return "a.b.c.d".

So now I would like to uninstall the whole package and especially I would
like to remove the corresponding version
entry, so that getVersion() no longer will return "a.b.c.d". I tried the
following:

// Open version registry
var oRegistry = Components.classes["@mozilla.org/registry;1"];
oRegistry = oRegistry.createInstance(Components.interfaces.nsIRegistry);
oRegistry.openWellKnownRegistry(Components.interfaces.nsIRegistry.Applicatio
nRegistry);

// This works fine so far, but what now??? I assume the following
instructions should be
var oVersionRegistryRootKey =
Components.interfaces.nsIRegistry.VersionRegistry;

// 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??)

// 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??)


Thanks to all, Klaus













Reply via email to