Skip to content

Write text (or variables) to a file

This action lets you write information to a text file; for example to set initial options for your program or store information about the package's execution, such as the user's name or the destination directory. All variables can be stored into the text file (additional settings for your application for example).

Another alternative: replace variables in file

Property Name Data Type Description
AppendCRLFAtEnd Boolean If true, write the string to the file and add an 'end of line' character.
Contents String String that should be added to the file. Can accept variables.
Filename String Path to the file (text file) that the package should create or modify (the filename does not necessarily require the .txt extension).

Do not use this custom action for writing large amounts of data. The Contents property is limited to 4096 wide characters. You can repeat this action several times for the same file and with different content, since contents is added to the end of the existing file.

Notes:

  • If the text file exists, the string is added at the end.

  • The uninstaller will not remove this file unless you specify it.

  • All existing variables and resource strings are replaced.

All available actions