Skip to content
⌘ NSIS Forum Archive

How do you do this?

3 posts

killcheck#

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?
deguix#
To fix this problem, see the code below:

InstallDirRegKey HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\trainz.exe" "Path" 
This is the same thing that you made, without the error (ReadRegStr can be only inside sections or functions).