Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 19th April 2001, 01:49   #1
pim42
Junior Member
 
Join Date: Apr 2001
Posts: 3
searching a file for a string and changing that string....

can this be done? I asked this before and no one answered.

i would like to search for say C:\winamp\test\test and change it to %TargetDir%\test\test where %TargetDir% is the target dir (duh)


pim42 is offline   Reply With Quote
Old 19th April 2001, 01:57   #2
rm'
Banned
 
rm''s Avatar
 
Join Date: Jul 2000
Posts: 11,361
CopyFiles C:\Winamp\test\test\*.* %TargetDir%\test\test
Delete C:\Winamp\test\test\*.*
RMDir C:\Winamp\test\test

Messy, but it should work.
rm' is offline   Reply With Quote
Old 19th April 2001, 03:07   #3
pim42
Junior Member
 
Join Date: Apr 2001
Posts: 3
I meant to search for a string of text in the file... your solution seems to be moving files themseleves.
pim42 is offline   Reply With Quote
Old 19th April 2001, 03:10   #4
Edgewize
Member
 
Join Date: Apr 2001
Posts: 89
I think what he means is inside a data file, he has a string that says "C:\Program Files\MyApp". But if the application is installed in another location, like "D:\MyApp", the prebuilt data file will be wrong. He is wondering if there is a command to to search-and-replace inside a file that you have extracted.

The short answer is no, it can't be done. But a better answer is that yes, you can do it *but* you will have to write a program that does this yourself. I have a search-and-repace program of my own which I use, its about 15kb and runs silently, but it is so heavily dependant on my datafile structure that it would be useless to anyone else. I have a feeling that most people will find it easier to create customized programs like this than to try to find a generic solution.
Edgewize is offline   Reply With Quote
Reply
Go Back   Winamp 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