Registry Script File Format
Previous Top Next

Thinstall uses a text file format to represent registry keys. The file format is different from .reg files produced by REGEDIT.EXE. For information on how to import REGEDIT script, click here.

Any file added to your project with the filename extension .threg is treated as a virtual registry script. Virtual registry scripts are typically automatically recorded by Thinstall ( how to record a registry script), but you can create your own registry scripts using a text editor. A registry script typically list registry keys

File Format

Notes about strings:

Strings that contain spaces must be surrounded by "". Strings that contain the character " or %, must escape the character.

Escape codes:
Character escape codes are represented as #XX where XX is a 2 digit hex number represented the character.
Some character that must always be escaped because they have other meanings when not escaped. These charaters include:
#0a - newline character (\n)
#0d - carriage return (\a)
#25 - Percent character (%)
#23 - Hash character (#)

Macro expansion:
Strings containing '%' will be macro-expanded at load-time. For example %InstallPath% expands to the directory where the current running EXE is located.

Example strings:

"this has spaces"


VALUE_NAME = named value or "" for the default value for KEYNAME
VALUE_TYPE = 2 digit hex number representing the data-type for VALUE01 is a text-string
VALUE = If VALUE_TYPE is 01, then value is a string - otherwise VALUE is represented as a text hex string

subkey SUBKEY_NAME (optional)

SUBKEY_NAME Indicated the name of the subkey that exists under KEYNAME

classname CLASS_NAME (optional)

CLASS_NAME indicates the registry class name for KEYNAME
(most registry keys do not have or need a classname)

lastwrite WRITE_TIME (optional)

WRITE_TIME = 64 bit number in text hex, representing a Windows FILETIME structure
(very few applications consult the lastwrite time for registry keys, this field can be safely discarded)

If no OPTIONAL_KEYFLAGS are specified the system registry is not modified. Click here for more details on optional registry key flags.
For an example of how to install registry keys on the system, see this page.

Example script

value "" 01 ZipNet.cZMessage Sets the default string of {03078DCC-B164-4E99-B460-E353DB4287E6} to type string (01) and value ZipNet.cZMessage

subkey "Implemented Categories" Adds a subkey called "Implemented Categories", note "" are required because of space in name
subkey {40FC6ED5-2438-11CF-A3DB-080036F12502} This subkey has no values

subkey LocalServer32
value "" 01 "%InstallPath%\ZipNet.exe"
subkey ProgID
lastwrite 80d00666a0f3c201
value "" 01 ZipNet.cZMessage
subkey Programmable
subkey TypeLib
value "" 01 {42D8FBCF-EBB7-4835-8AC2-222560E50FAD}
subkey VERSION
value "" 01 6.0
lastwrite e0de0966a0f3c201 optional, lastwrite is usually not needed


Example conversion of REGEDIT .reg script file with binary data

Regedit .reg:



Thinstall .Threg format:
subkey set1.06.02
subkey Settings
value "Data" 03 24d722bfbbf60139126acdf9b92a133377160b601e0492adc966ee910659b82e3a66b9c61683d8