Archive: Missing ReplaceInFile.nsh / StrRep.nsh


Missing ReplaceInFile.nsh / StrRep.nsh
Where can I find the missing files, written in Subject-Field??? I searched now for more than 3hours.

Plz help


must not have searched very hard :o
http://www.google.com/search?q=replaceinfile.nsh
http://nsis.sourceforge.net/ReplaceInFile
"For your convenience, I suggest you save the following macro and the function together in one file as ${NSISDIR}\Include\ReplaceInFile.nsh and simply include it somewhere in your script"

i.e. use notepad or some other text editor (I'd recommend HMSoft NISedit) and copy/paste from that webpage into the file - then save as ReplaceInFile.nsh .


Aaah, now i understand, I thought these files are there, but I must made them self.

Thx 4 ur help


Sorry when I write once again, but I did, like you say, but this happens.


you have to write a full valid script to use those macros. e.g.


OutFile "test.exe"
Section
!insertmacro ReplaceInFile "myfile.txt" "foo" "bar"
SectionEnd

I think I'm an idiot, 'cause now comes this failure:


Processed 1 file, writing output:
Error: resolving install function "StrReplace" in function "RIF"
Note: uninstall functions must begin with "un.", and install functions must not
Error - aborting creation process


Did you !include StrRep.nsh?

Stu


i can't find such an file, but this i write in subject.
i missed the replaceinfile.nsh and the strrep.nsh.
but the replaceinfile.nsh is now there. i only miss the strrep.nsh now.


The ReplaceInFile Wiki page specifically tells you that you need to include it and even gives you a link...

Stu


where the hell is this link, and why is it so difficult to post the source??, of the StrRep.nsh-File. In my Program-Dir i can't find it.


Please find it yourself ON THE WIKI at http://nsis.sourceforge.net/ReplaceInFile. Why should we post the source when there is a link to it on there?

Stu


Now i got all the missing files, but i have another problem.

i must replace a path in a file, but it's not:

C:\test\test2

it's:

test$\test2

but the path will be read from Directory-Page and is saved in $SELECT_DIR, so if i replace "blablabla" with $SELECT_DIR stands the C:\test\test2, but i want test$\test2 and i don't know the path before it changed in DirPage. And for one replace in this file i need the whole path and the other replace in this file is such described like above.

What shall i do?


There are many string manipulation functions included with NSIS. Look under Appendix E in the user manual.

Stu