No announcement yet.

Search and Replace

  • Filter
  • Time
  • Show
Clear All
new posts

  • Search and Replace

    Is it possible to do a search and replace of a text file after it is installed?

    I would like to search for certain text in a text configuraton file and then replace it with the %AppDir% variable .

  • #2
    Re: Search and Replace

    There's currently no search and replace action in Setup Factory, therefore what you will need to likely do is use the Text File actions to accomplish it.

    For example, you could use the "Find Text Line" action to find the line number in the file that contains the target text.
    Next you would use the "Get Text Line" to read the line into a variable to perform the modification.
    You would then use use the "Delete Text Line" to delete the current line of text from the file and the "Insert Text Line" to insert the new line of text.

    That's the basic framework to use. If it's an INI file, you could then use some of the INI file actions if you know where it is.

    Hope that helps.