Replace within files
Replaces substrings and variables within files. This command replaces all variables of the type #varname# with their values in the specified files. Additionally, you can specify any strings to be replaced, and their new values.
Optionally, you may add comments here describing the purpose of this element.
Choose a path to the file.
APPLICATION DATA PATH - Program subfolder in Application Data folder.
CDROM PATH - CD or DVD drive.
CUSTOM PATH - The path must be defined in the filename control.
INSTALL PATH - Default installation path.
SETUP FILE PATH - The path to where setup executable file is running.
SYSTEM PATH - Windows system directory.
TEMPORARY PATH - The temporary folder of the installation #tempinstpath#. It is a subfolder genteeXX in the default temporary user's folder #temppath#.
WINDOWS PATH - Windows directory.
Filename or Wildcard
The name or the wildcard or file to be replaced. If you selected CUSTOM PATH, specify the full path to the file.
Replace within files command
You can specify a condition that should be met for the action to be performed. If the condition is false then the command is skipped. See How to use If Condition for more details.
Checked this checkbox if the files are in UTF-8 encoding.
Replace within files dialog box
What to find
The string that will be replaced.
The new string, which will replace the found string.
If you check the "HEX Values" checkbox in the list, then the "What to find" and "Replace with" fields can be filled with hexadecimal values (00-FF). For example, you can replace the 0D or 0A values to the 0D0A values, or the 00 value to the 0D0A values, otherwise reading as a text file will not be possible. If a file contains 0x00 values, then the following values cannot be read as text.
The "Resulting variable" in the list will contain the number of occurences of the current text in the file and the filename separated by semicolon. (It can be useful if the filename contains any wildcard.) The variable #repfile_rep_allcount# contains the number of replaced texts in the current file and the filename separated by semicolon. (It can be useful if the filename contains any wildcard.) The variable #repfile_count# contains the number of found files. (It can be useful if the filename contains any wildcard.)
You can specify a condition for this action.