Old 18th May 2003, 09:41   #1
killcheck
Junior Member
 
killcheck's Avatar
 
Join Date: May 2003
Location: Australia
Posts: 2
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.

code:
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?
killcheck is offline   Reply With Quote
Old 18th May 2003, 10:46   #2
deguix
Major Dude
 
deguix's Avatar
 
Join Date: Dec 2002
Location: Everett - MA, USA
Posts: 1,354
Send a message via ICQ to deguix
To fix this problem, see the code below:

PHP Code:
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).

My Wiki Pages

Working now on:
New projects. (language: any)
deguix is offline   Reply With Quote
Old 18th May 2003, 12:48   #3
killcheck
Junior Member
 
killcheck's Avatar
 
Join Date: May 2003
Location: Australia
Posts: 2
Thanks, that worked. I missed a section of the docs when I was reading through them.
killcheck is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump