Scripting Overview
DotFix NiceProtect includes a flexible scripting engine, called DotFix Script, designed to automate pre-protection and post-protection operations. This allows seamless integration into your build process: a script can run right before the file is processed and again after the protected binary is written.
Scripting enables you to automate tasks such as renaming PE sections, injecting custom protection signatures, editing the PE header, stripping unwanted resources, computing MD5/SHA-256 checksums, running external tools (for example signtool), and launching your installer build.
The scripting language provides a comprehensive set of commands for modifying PE file structures, working with files, the registry, INI and XML data, executing external programs, and invoking functions from external DLLs. It supports variables, decimal and hexadecimal arithmetic, conditions with logical operators, and flow control.
A script is plain text, executed one command per line. Each line is a command followed by comma-separated parameters. Lines beginning with ;, # or ! are comments. A script run returns 0 if it finished without errors, or 1 if any error was recorded, so a faulty script can fail your build.
The output file of the current job is available to the script through the predefined variable @output. Other predefined variables are @windows, @temp, @current (each a directory with a trailing backslash) and @crlf (a line break). Prefix any variable name with @ to insert its current value into a parameter.