Delete lines from file
This command allows you to delete one or multiple lines from a text file. The command deletes a fragment of text between specified lines (including those lines). You can use this command to delete fragments from ini files or hosts settings files. If you have added some data to these files and bounded them with special comment-lines, you can delete the added fragments during deinstallation with this command. It does not search for perfect matches of beginning and ending lines—it compares along lines. For example, if you entered # my comment as the beginning line, the line # my comment version 2 will be considered the beginning of a fragment. If there are several fragments with the specified conditions, they will all be deleted.
Description
Optionally, you may add comments here describing the purpose of this element.
Path
Choose the 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
Enter the name of the file, from which you need to delete the specified lines. If you use a CUSTOM PATH, the full path to the file should be specified.
Encoding
Select if the file is UTF-8 or Unicode encoded.
Remove BOM characters
Check this checkbox if you want remove the UTF-8 or Unicode BOM characters from the beginning of the files.
Delete lines from file command
Beginning line
Enter the line, after which lines should be deleted.
Ending line or number
Enter line, up to which lines should be deleted. You can also enter a number of lines to be deleted instead of a specific line. If nothing is entered, only the beginning line will be deleted.
If Condition
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.