Archive: Check which Opera version is installed/Cannot read Opera HKLM key


Check which Opera version is installed/Cannot read Opera HKLM key
Hi,

I have following problem. I have plugin for Opera and want to install it with NSIS. To check Opera "Plugin Path" I'm reading registry entries with ReadRegStr. But unfortunately Opera 9.x keeps its reg in HKCU and Opera 10.x keeps its reg in HKLM. I can read HKCU but cannot read HKLM (but only for Opera). Below sample code - commented entry is red properly. Changing spaces (in Opera reg) to no spaces results nothing. I'm running installer with admin rights:


ReadRegStr $0 HKCU "Software\Opera Software" "Plugin Path"
MessageBox MB_OK "$0"
# ReadRegStr $1 HKLM "Software\RegisteredApplications" "Firefox"
ReadRegStr $1 HKLM "Software\Opera Software" "Plugin Path"
MessageBox MB_OK "$1"
${If} $0 != ""
StrCpy $0 $INSTDIR
${ElseIf} $1 != ""
StrCpy $1 $INSTDIR
${Else}
MessageBox MB_ICONSTOP "Opera nie jest zainstalowana."
Abort
${EndIf}

It's extremely unlikely that an admin wouldn't have read-access to that regkey, so if ReadRegStr doesn't read anything, that probably means the regstring doesn't exist (or is empty).


The problem is, that this registry exists... I have another installers created and ReadRegStr allways work.


Maybe Opera 10 is a 64bits application? That would require you to use SetRegView 64. NSIS is a 32bits application so it obviously uses 32bits registry.

http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.7.6


Ok, I've got solution. This error was because of manually created reg entry in HKLM. I have exported it, deleted and re-imported and now it works fine (but I'm unable to see this reg with regedit... nevermind).