The simplest solution is this: don't use the Registry.
That's a much better idea than you think: use of the Registry is more restricted than it was, and becoming more restricted with time, not easier. So what works now, may not work in future, as you have noticed with Win 7 / Win 10. And that is for good reason: too many apps were misusing it and causing damage, or extreme bloat.
Instead of using the registry, use a configuration file, or store it in a "safe" folder:
Where should I store my data?[
^] suggests some and shows the code to access them.