Modify Text File - In Archive Action

InstallAnywhere 2018

You can use the Modify Text File - In Archive action to alter text files within an archive (ZIP or JAR). The Modify Text File - In Archive customizer includes the following options:

Modify Text file - In Archive Customizer

Option

Description

Installed Archive

Choose this option to modify files in an archive your installer deploys on the target system. (Available only in the Install and Post-Install sequences.)

Existing Archive

Choose this option to modify files in an archive that already exists on the target system.

Note • Ensure the name and path to the file you specify matches, including case-sensitivity, to the name of the target file.

Archive Path

Type the path to the file you want to modify in the archive.

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

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.

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, or if you leave this 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.

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