Axarydax
Axarydax

Reputation: 16603

Where to store application settings shared between using x86 and x64

we are preparing for using windows x64 for our installations,but we are facing a problem about storing application settings(user and machines). Currently we store them in windows registry - HKLM and HKCU hives.

The problem is that there will possibly be both x86 apps and x64 apps,and x86 apps cannot access 64 bit registry. We could store everything in 32-bit registry (visible as wow64 in x64 app). Or we can store settings in a file -sqlite or sql server compact database to avoid concurrency hazards.

Do you have any advice? If yes,what is it? :)

Upvotes: 0

Views: 183

Answers (1)

Leo Davidson
Leo Davidson

Reputation: 6143

32-bit apps can access the 64-bit registry. See the REGSAM argument of APIs like RegOpenKeyEx

Also note that only certain areas of the registry are partitioned so you may not have to do anything, depending on where things are stored.

As for whether you should use the registry or move to something completely different, that's quite an open-ended question. If you're happy with the registry other than this issue with 64-bit then I'd say stick with it and just use the REGSAM arguments to explicitly point to the 64-bit registry if and as required. (Or vice versa, make your 64-bit apps look in the 32-bit registry.)

Upvotes: 1

Related Questions