Archive: ReadRegStr problem


ReadRegStr problem
I've used ReadRegStr in the past without any trouble. The problem I'm having is when I try to read a really long registry key. Here is the code that is having trouble:


; check for office 2007 kb950480 and if not found, install it
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\{90120000-003B-0000-0000-0000000FF1CE}_PRJPRO_{5506E95D-E159-482D-ABE2-0A5878B54861}\" ""
${If} $0 != ""
!insertmacro logadd "Skipping installation of hotfix KB950480. It is already installed."
${Else}
!insertmacro logadd "Extracting files."
File office-kb950480-fullfile-x86-glb.exe
!insertmacro logadd "Installing hotfix KB950480"
ExecWait '"$INSTDIR\office-kb950480-fullfile-x86-glb.exe" /quiet /norestart' $0
!insertmacro msierrorhandler $0
${EndIf}


The problem is that ReadRegStr always returns "" as the value for $0 and an error even if that registry path exists. I have used this same code for other shorter registry keys and it works fine.

This is happening on a Windows XP SP2 machine with NSIS 2.36. Thanks in advance for your help.

As long as the string is shorter than 1024 chars, I don't see why it would not work. Make sure the path is correct (do you really want to read the default value and not "UninstallString"?) RegMon might also be able to help out


If I check for UninstallString it works as expected. The reason I checked for the default value was because that was how it is shown in the Help file. I have checked for the default value in several installers and they all worked fine until now. Thanks for the help.


You have a backstroke on the end of the path.

Stu