WiseScript Editor Reference 105
WiseScript Actions
To complete the dialog box
z Pathname
Specify the full path to the text file to be edited on the destination computer
(example: %WIN%\Sample.txt).
z Variable
Specify the variable in which to store each line of the text file (example: TEXTLINE).
z Action
Select an action:
Read lines of file into variable
Reads a line into the variable, but does not write it back to the original file.
Update file with new contents of variable
Reads a line into the variable, and at the end of the loop, writes the contents of
the variable back to the line in the text file.
z Make Backup File
Mark this to make a copy of the text file before editing it. A number is appended to
the end of the file name for the backup copies (example: text.001, text.002, and so
on).
The sample script TextFile.wse uses this action. For details on sample scripts, see
ScriptHelp.htm in the Samples subdirectory of this product’s installation directory.
See also:
End Statement on page 76
Read/Write Binary File
This action reads from a binary file to a variable, or writes from a variable to a binary
file. If you write to the file, the existing information in the file is not moved, it is
overwritten.
This action does not support reading or writing non-ASCII characters (characters with
codes above 127).
Note
When a WiseScript is called by a Windows Installer installation, the Windows Installer
installation does not recognize changes that the WiseScript makes to the destination
computer and will not uninstall them. Therefore, you must provide a way to uninstall or
repair such changes. See Uninstalling Changes Made by a WiseScript in the Windows
Installer Editor Help.
To complete the dialog box
z File Pathname
Specify the path of the file to be read (example: %MAINDIR%\File.exe).
z Variable Name
Select or enter the variable that is to be read into or written from.
z File Offset
Enter the number of bytes into the file to start writing or reading. Bytes are
numbered starting with zero.