Modify Text File - Single File Action
InstallAnywhere 2024 R2
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:
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 text file that already exists on the target system. Enter the path of the text 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 path of the text file in the text box. |
|||||||||||||
Change Line Endings To |
Specify the type of line ending to use in the text file:
To ensure that the line endings conform to the built-in 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 11 |
https://docs.oracle.com/en/java/javase/11/intl/supported-encodings.html |
|||||||||||||
Java 17 |
https://docs.oracle.com/en/java/javase/17/intl/supported-encodings.html |
|||||||||||||
Java 21 |
https://docs.oracle.com/en/java/javase/21/intl/supported-encodings.html |
|||||||||||||
Note:Note the following regarding file encoding:
|
||||||||||||||
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 11 |
https://docs.oracle.com/en/java/javase/11/intl/supported-encodings.html |
|||||||||||||
Java 17 |
https://docs.oracle.com/en/java/javase/17/intl/supported-encodings.html |
|||||||||||||
Java 21 |
https://docs.oracle.com/en/java/javase/21/intl/supported-encodings.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:
|
||||||||||||||
Additional Text |
Use this option to instruct the installer to add additional text to text file. Choose one of the following options:
|
|||||||||||||
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.
|
|||||||||||||
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
Customizing the Pre-Install Sequence
Adding Actions to the Install Sequence
Customizing the Post-Install Sequence
Adding Uninstall Categories and Actions to the Uninstall Sequence