Archive: Problem reading registry entry which contains " symbol


Problem reading registry entry which contains " symbol
Hi,

I've been looking about this, but no luck, so:

I'm creating an installer that is going to update an already installed program.

It searchs into the windows registry to get the path of that installed program. The path is stored is a RG_SZ type key named InstallPath, and the value is:

"D:\Programs\Mountain"

NOTE: The value includes the " symbols inside.

I'm using this code to read the key's value

ReadRegStr $R0 HKLM "Software\Mountain" "InstallPath" ;
IfErrors +2
StrCpy $INSTDIR

Below in the script I have this code to install files:

SetOutPath "$INSTDIR"
File "Data\fil1.txt"
File "Data\file2.txt"

I compile the installer without problems, but when the installer starts installing an error message is shown:

Error opening file for writing.
D\Programs\Mountain\fil1.txt
Clic abort to cancel installation, bla bla bla

(Note the : path symbol seems to be lost)

So it seems that the " symbols is not being stored inside $INSTDIR

If I manually delete the " symbols inside that registry key the installer works without problems, installing all the files correctly. But I can't ask the users to do that to install the update, so the " symbols should be stored with the rest of the path.

How can I solve it?

Lot of thanks in advance!


Just use InstallDirRegKey,

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


Lot of thanks! Now it works fine.

Thanks again for your excelent support! :)