Archive: Problem copying files after reading from registry


Problem copying files after reading from registry
Hi
I am trying to copy a file from a given location to another location, the value of the latter I am retrieving from the registry

Here is the code snippet
ReadRegStr $R0 HKLM "SOFTWARE\IBM\Wireless Client" "InstallPath"

;CopyFiles "C:\PROGRAM FILES\capwin\wecm\artour.ini" "C:\PROGRAM FILES\IBM\Wireless Client\"
CopyFiles $INSTDIR\wecm\artour.ini $R0


This code is not working, whereas if I use the commented line for CopyFiles in the code snippet that works fine.

Any help will be greatly appreciated.


Maybe the file doesn't exist. Try:

CopyFiles "C:\PROGRAM FILES\wecm\artour.ini" \
"C:\PROGRAM FILES\IBM\Wireless Client\"

If you look at my code snippet I did mention that the copyfiles explicitly works fine. But my problem was that the commented out line does not work.
Well if the file did not exist, then the explicit copyfiles would not work either !!!


It that case $R0 doesn't contain the right value.


Any idea on how to print the value of $R0 to check what it contains ?


[edit]Use MessageBox to show $R0 and $INSTDIR[/edit]

What's the exact content of $INSTDIR and $R0? You might need to add a back-slash after $R0 to make sure Windows understands you want to copy the file into that folder and not name it as that folder. If you're adding a back-slash at the end of the line, don't forget to quote because if the last char is \ the next line will be considered as an extension of the first.