Archive: How do you do this?


How do you do this?
I'm trying to write a script that will read the "Path" string in a registry key and use that as the InstallDir.

ReadRegStr $1 HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\trainz.exe" "Path"
InstallDir $1


On compiling the code however, it comes up with "Error: Can't add entry, no section or function is open!"

What am I doing wrong and how do I fix it?

To fix this problem, see the code below:

InstallDirRegKeyHKLM"Software\\Microsoft\\Windows\\CurrentVersion\\AppPaths\\trainz.exe""Path"

This is the same thing that you made, without the error (ReadRegStr can be only inside sections or functions).

Thanks, that worked. I missed a section of the docs when I was reading through them.