Hello,
I'm struggling to find consistencies across platforms due to registry virtualization. When running through my PB 2017 IDE, the following code works, but when I compile as 32bit or 64bit app, and run the exe, it does not find the product code.
RegistryGet(HKEY_LOCAL_MACHINE\Software\WOW6432Node\Min-U-Script Pro", "Product Code", RegString!, gs_product_code)
Additionally, when I look at the registry, the path looks completely different:
Computer\HKEY_USERS\S-1-5-21-1312213260-3357453489-502601113-1001\Software\Classes\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\Min-U-Script Pro
Please help with a registry strategy which will work across platforms.
TIA,
Mitch
gs_regpath="HKEY_LOCAL_MACHINE\Software\WOW6432Node\"
li_ret=RegistrySet(gs_regpath + "\Min-U-Script", "regtest", RegString!, "test " + string(now(),"hh:mm"))
li_ret=RegistryGet(gs_regpath + "\Min-U-Script", "regtest", RegString!, ls_regtest)
MessageBox("debug",ls_regtest)
When I run this from the exe, it fails. I get a -1 returned. If I run my exe as administrator, then it writes and reads. If I then run again, not as administrator, then it only reads, but fails on the write. So can I no longer write to the registry when not running as administrator? Additionally, it does not seem to matter if I have the path as:
gs_regpath="HKEY_LOCAL_MACHINE\Software\WOW6432Node\"
or
gs_regpath="HKEY_LOCAL_MACHINE\Software\"
Thanks,
Mitch
That is correct; you must have ADMIN rights in order to write directly to the non-virtual sections of the Windows Registry.
Olan