Hello fellow LoveCoders,
After a long search, I came to the conclusion that I will have to create a LiveCode external with a function that can probe for the existence of a value in the Windows 32-bit registry. And so I did!
I wrote a "regValueExists" function that takes 3 arguments: pRootKeyName, pSubKeyPath, pValueName
and returns true if the value exists in the registry, or false if it doesn't exist.
I've attached the external to this post. To use it in LiveCode, do the following:
- Extract the Zip-archive and copy "windowsregistry.dll" to the following 2 folders on your computer:
<User Extensions>/Externals
<User Extensions>/Runtime/Windows/x86-32/Externals
where <Users Extensions> is the location specified in "Edit > Preferences > Files & Memory > User Extensions". If one or both of the "Externals" folders above don't exist then you should create them first.
- Edit the "Externals.txt" file in each of the "Externals" folders above, adding the following line:
windowsregistry external,windowsregistry.dll
If the "Externals.txt" file does not exist in one or both of the "Externals" folders, then you should create it.
- Restart LiveCode.
Remember to also add a reference to this external in the properties of each stack that utilise it, or else it won't work in a standalone, e.g. Externals\windowsregistry.dll
After the above steps, you can call the "regValueExists" function to probe for the existence of a specified value in the Windows 32-bit registry, as in the following example:
Code: Select all
put regValueExists("HKEY_CURRENT_USER", "SOFTWARE\myCompany", "myValue") into tValueExists
For some reason it works as part of a script, but not in the message box. Nevertheless, it works

.
I hope someone else finds this useful. I needed it because I needed to probe for the existence of the registry value before changing it with the setRegistry function.
Kind regards,
Gerrie
010100000110010101100001011000110110010100111101010011000110111101110110011001010010101101010100011100100111010101110100011010000010101101001010011101010111001101110100011010010110001101100101