Replace Text in File

From InstallJammer Wiki

Jump to: navigation, search

The Replace Text in File action will replace text strings in a file with other strings as based on a string map. This is useful for writing out configuration files with virtual text values from InstallJammer.

Contents

[edit] Standard Properties

See Standard Action Properties.

[edit] Advanced Properties

[edit] Files

A list of files or patterns separated by a ;. Any pattern or file that is a relative path is automatically made relative to <%InstallDir%>.

[edit] Line Feed

The type of linefeeds for the specified files. The following choices are available:
  • Auto - choose the linefeeds based on the target install platform.
  • Unix - Use UNIX linefeeds (lf)
  • Windows - Use Windows linefeeds (crlf)

[edit] String Map

A string map is a list of strings in pairs separated by whitespaces. Each string in a string map has a corresponding string to map it to. Strings with spaces should be placed in quotes to show that they are to be treated as a single string. See the example below for a sample string map.

[edit] Examples

The following values would convert all instances of @@INSTALL_DIR@@ to our installation directory and all instances of the string "replace this string" with "our new string" in a file called config.cfg. It will also convert linefeeds to UNIX (lf) linefeeds.

Files:      config.cfg
Line Feed:  Unix
String Map: "@@INSTALL_DIR@@" <%InstallDir%>
            "replace this string" "our new string"
Personal tools