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:

Spaces:
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_no_spaces
"this has spaces"
this_#25_has_a_hex_character_expansion
%InstallPath%\this_has_a_macro_expansion




KEYNAME OPTIONAL_KEYFLAGS
{
value VALUE_NAME VALUE_TYPE VALUE (optional)

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

HKEY_CLASSES_ROOT\CLSID\{03078DCC-B164-4E99-B460-E353DB4287E6}
{
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:
[HKEY_LOCAL_MACHINE\SOFTWARE\Sets]

[HKEY_LOCAL_MACHINE\SOFTWARE\Sets\set1.06.02]

[HKEY_LOCAL_MACHINE\SOFTWARE\Sets\set1.06.02\Settings]
"Data"=hex:24,d7,22,bf,bb,f6,01,39,12,6a,cd,f9,b9,2a,\
13,33,77,16,0b,60,1e,04,92,ad,c9,66,ee,91,06,59,b8,\
2e,3a,66,b9,c6,16,83,d8

Thinstall .Threg format:
HKEY_LOCAL_MACHINE\SOFTWARE\Sets
{
subkey set1.06.02
{
subkey Settings
{
value "Data" 03 24d722bfbbf60139126acdf9b92a133377160b601e0492adc966ee910659b82e3a66b9c61683d8
}
}
}