Archive: Test if a registry key is empty


Test if a registry key is empty
Hi,

I would like there is a way to test if a registry key is empty.
What I would like to do with that, is to create some sort of "Package dependency" and prevent the user to remove a package that is needed by other ones.

Example: package A is needed by package B.
==> package B cannot be installed while package A is not installed (From a thread in the forum, I know how to do this)
==> package A cannot be removed while package B is still installed... and here is where this "test if a registry key is empty" comes into action.

I create a subkey "PackagesDependent" for the package A and in it, I store values of the other packages (package B, package C, etc...)
When I remove the package B before package A, I will remove this value from this key "PackagesDependent".
If this subkey is now empty, then, I can remove package A.

So basically, this is what I would like to do.
Maybe, this is not a good approach to this problem (I am still a newbie)... so any help, advices, ideas would be greatly apreciated. :-)
Thanks !


Use EnumRegKey and EnumRegValue.

-Stu


Thanks for your fast reply Stu ! :-)