dhiraj3301
2nd June 2010 04:34 UTC
how to read registry entries from 64 bit systems
Hello,
i have use folllowing commang to read the installed instances of sqlserver 2008
${registry::Read} "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server" "InstalledInstances" $R0 $R1
this works fine for sqlserver for x86 machine,but for x64 machine it will find the Installedinstances from SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server" "InstalledInstances"
but i want registry entries from SOFTWARE\Microsoft\Microsoft SQL Server" "InstalledInstances" so i have used following code
SetRegView 64
${registry::Read} "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\$4" "InstalledInstances" $R0 $R1
but it still shows me data in SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server" "InstalledInstances"
please suggest what i have to do to read entries from "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server" "InstalledInstances"
Thanks,
Dhiraj
MSG
2nd June 2010 08:32 UTC
In the registry plugin thread I see a post stating that REG_MULTI_SZ values aren't properly read from x64 registry. Perhaps that is your problem?
If you want to read a registry value into a string, you can always just use the normal command: http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.2.12
dhiraj3301
2nd June 2010 09:38 UTC
I can not use normal command (Readregstr)because it is not reading multiple values.
I want to read value from "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server" "InstalledInstances"
which are
e.g.
SQLEXPRESS
Sqltest
for reading this value i require ${registry::Read} command,can anyone tell me why SetRegView 64 is not working
Thanks,
Dhiraj
Afrow UK
2nd June 2010 09:57 UTC
SetRegView ensures NSIS opens/creates/deletes keys using KEY_WOW64_64KEY. The registry plug-in does not seem to have a switch to enable the use of KEY_WOW64_64KEY. You need to contact the author.
Stu
dhiraj3301
2nd June 2010 12:56 UTC
can anyone please tell what to do to read registry entry in native section(64 bit section)on 64 bit machine.i have read the blogs but i didn't find exact solution for it
Thanks,
Dhiraj
MSG
2nd June 2010 14:01 UTC
Originally posted by dhiraj3301
I can not use normal command (Readregstr)because it is not reading multiple values.
Have you considered using EnumRegValue?
Afrow UK
3rd June 2010 10:15 UTC
EnumRegValue is for enumerating values in a key not REG_MULTI_SZ.
Stu