wolfram
9th July 2010 15:37 UTC
HKCR\AppID registry write problem
Hi Guys,
I am writing a registry key to HKey_Class_Root\AppID directory.
Here is my script:
WriteRegStr HKCR "AppID\myregister" "(Default)" "myregistervalue"
The issue is, when I ran my NSIS script, windows process monitor (procmon.exe) showed the installer tried to open HKey_Class_Root\AppID\myregister registry key, got "NAME NOT FOUND" as return, and wrote to HKey_Current_User\Software\Classes\AppID\myregister instead.
Now when I looked in registry editor, the key was written to "HKey_Class_Root\AppID\myregister", which was the intended destination.
But when I ran the installed application, the application could not open the "HKey_Class_Root\AppID\myregister" registry key, which is inline with what windows process monitor (procmon.exe) showed during installation.
I am wondering what could possibly cause this. Any help would be appreciated.
Zinthose
9th July 2010 15:48 UTC
You can't use "(Default)" for the default value.
Use..
WriteRegStr HKCR "AppID\myregister" "" "myregistervalue"
instead.
wolfram
9th July 2010 16:29 UTC
Zinthose:
Thanks. But the issue still persists.
Zinthose
9th July 2010 16:49 UTC
Are you sure the app is reading the same value? Double check the registry keys. Is the application reading from a key named "(Default)" or is it reading the default key?
If you are wrapping an existing installer, like an MSI, changing the installation context could fix it. ALLUSERS=1
Is the application encountering a possible security context issue? Try running the installed application as an administrator and check.
Also, you could try and write to the HKLM classes as it is essentially the same thing.
WriteRegStrHKLM
"SOFTWARE\Classes\AppID\myregister""""myregistervalue"
Anders
9th July 2010 17:32 UTC
HKCR is actually a merged view of HKCU\software\classes and HKLM\software\classes, so in processs monitor, you might see reads for both if HKCU is empty etc
wolfram
13th July 2010 19:34 UTC
Hey thanks everyone. I checked for "default" variable name, and wrote to HKLM, it solved the problem:).