Alstom
21st November 2006 10:13 UTC
Replacing part of directory with user input in text file
hi, I got a problem here.
How do we replace a part of the directory in the installer with a directory user key in in a text file.
Here part of my script:
CopyFiles "$1\work\file.txt" "$2\subfile"
This is a exampleof what i want to replace with :
{C:\my personal folder} in my text file into $1 or $2
User should be able to change the directory name in the text file and the installer should be able to change accordingly.
Is there such a way to do it??
Million Thanks in advance!!!
Afrow UK
21st November 2006 11:44 UTC
Have you looked at FileOpen in the documentation?
-Stu
Alstom
22nd November 2006 03:40 UTC
Yes but i want to copy 2 different text input by the user in the same file and use the first 1 to be part of the source directory and the second 1 to be the destination directory.
Now i am able to read the line i want from the file.txt but was unsuccessful to copy the files from the source to the destination.
I had try a few ways but found out the problem is with the $R0 in the source directory.
Why i could write the same for $R1 in the SetOutPath but not in the source directory???
Below is part of the script:
${LineRead} "$Desktop\file.txt" "1" $R0 ;Read line 1
${LineRead} "$Desktop\file.txt" "2" $R1 ;Read line 2
SetOutPath $R1\My_Folder\Personal
CopyFiles "$R0\File\file1.xml" "$OUTDIR"
SetOutPath $R1\My_Folder\Personal
CopyFiles "$R0\RELEASE\file2.dll" "$OUTDIR"
Alstom
22nd November 2006 07:02 UTC
hi, I found the ans to this too. just need to trim the var.
;)