Modify Text File - Single File Action

InstallAnywhere 2017

Edition • This information applies to the Premier edition of InstallAnywhere.

You can use the Modify Text File - Single File action to modify a text file on the target system. The Modify Text File - Single File customizer includes the following options:

Modify Text File - Single File Customizer

Option

Description

Installed File

Select this option if you want the installer to modify a file the installer deploys on the target system. Click the Choose Target button to open the Choose a Text File dialog box and select the installed file you want the installer to modify.

Available only in the Install and Post-Install sequences.

Existing File

Select this option if you want the installer to modify a file that already exists on the target system. Enter the name of the file in the text box.

New File

Select this option if you want the installer to create a new text file on the target system. Enter the name of the file in the text box.

Change Line Endings To

Specify the type of line ending to use in the text file:

User’s Platform (Default)
Mac OS
UNIX
DOS/Windows

To ensure that the line endings conform to the native line endings for the target system, choose User’s Platform.

Source File Encoding

Enter the encoding type of the source file that you are modifying. For a list of supported encoding types, view the Supported Encodings page for the version of Java you are using.

Java 1.4

http://download.oracle.com/javase/1.4.2/docs/guide/intl/encoding.doc.html

Java 1.5

http://download.oracle.com/javase/1.5.0/docs/guide/intl/encoding.doc.html

Java 1.6

http://download.oracle.com/javase/6/docs/technotes/guides/intl/encoding.doc.html

Java 1.7

http://download.oracle.com/javase/7/docs/technotes/guides/intl/encoding.doc.html

Note • Note the following regarding file encoding:

Retention of the existing encoding type is not supported.
There will not be any build time validation.
The result of applying an encoding type will be written to the log file.

Destination File Encoding

Enter the encoding type of the destination file to be saved after it has been modified by the Modify Text File action. For a list of supported encoding types, view the Supported Encodings page for the version of Java you are using:

Java 1.4

http://download.oracle.com/javase/1.4.2/docs/guide/intl/encoding.doc.html

Java 1.5

http://download.oracle.com/javase/1.5.0/docs/guide/intl/encoding.doc.html

Java 1.6

http://download.oracle.com/javase/6/docs/technotes/guides/intl/encoding.doc.html

Java 1.7

http://download.oracle.com/javase/7/docs/technotes/guides/intl/encoding.doc.html

If the encoding type you enter in the Destination File Encoding field is invalid or unsupported, then system default encoding will be applied.

If you leave the Destination File Encoding field blank, then UTF‑8 encoding will be attempted. If the installer fails to apply UTF-8, then system default encoding will be applied.

Note • Note the following regarding file encoding:

Retention of the existing encoding type is not supported.
There will not be any build time validation.
The result of applying an encoding type will be written to the log file.

Additional Text

Use this option to instruct the installer to add additional text to text file. Choose one of the following options:

Prepend—Select this option to add additional text to the beginning of the text file. Then enter the desired additional text in the box.
Append—Select this option to add additional text to the end of the text file. Then enter the desired additional text in the box.
None—Select this option if you do not want the installer to add any additional text.

Substitute InstallAnywhere variables in file

Select to replace any InstallAnywhere variables with their values. When this option is selected, the installer changes any strings in the text file that match InstallAnywhere variables to the values of those variables.

Create backup

Select to create a backup of an existing or installed file prior to modification.

The backup file name is determined by adding .backup to the original file name.
Backup files are not removed by the uninstaller.

Search and replace strings

If you want the installer to search for specific text strings in the text file and replace them with replacement strings, select this option and then click Configure to open the Configure Search and Replace Strings dialog box.

On the Configure Search and Replace Strings dialog box, click Add to define the Search For and Replace With text. When this action runs, the installer locates all instances of the Search For text and replaces them with their corresponding Replace With text.

See Also