Virtual Registry
Previous  Top  Next


Thinstall Registry information exists in 3 forms:

· Build format - This is unicode text files such as HKEY_LOCAL_MACHINE.txt, the build process converts this format into the embedded format.  
· Embedded format (read-only) - This is compressed and stored inside the application EXE file in a binary format.  
· Sandbox format (read-write) - This stores the differences from the embedded format as the application makes registry writes  


Packaged/Compiled Format
After you build a package, all registry values and files will exist in a read-only image inside of the EXE you are distributing.. At runtime the read-only image presents a view of the registry for new users of a package. As the application modifies the registry, these changes will be saved in the sandbox persistent file with the extension .tvr. The VRegTool utility can be used to list and modify data contained in a .tvr file.

Build Format
This is what registry data looks like after you perform setup capture. In this format, each registry subkey will map directly to a directory on your build filesystem. Each registry value also maps directly to a file. An example view looks like this:

c:\mypackage\HKEY_LOCAL_MACHINE\Software\ApplicationX\Value1.txt
c:\mypackage\HKEY_CLASS_ROOT\.txt

Registry subkey & value name -> Filename mapping  
Because registry subkeys and value names can have some characters which do not map to filenames, any unmappable character must be escaped in the filename like this:  
 
Registry Subkey: HKEY_CLASS_ROOT\*.*  
Maps to filename: c:\mypackage\HKEY_CLASS_ROOT\#42.#42  
Because the character '*' is not a valid filename character, it has been escapped ass #42  
Because '#' is used to escape characters, it must also be escaped.  
 
To represent a default value, the filename ##default is used.  
 
Note: FAT32 versus NTFS  
FAT32 has severe limits on maximum filename lengths, it is highly recommend that you store all build registry data either on a NTFS drive or use a short parent directory name to store registry build data.  
At runtime FAT32 limitations will not impact the registry.  

Registry Value data  
Registry files are saved as plain txt or Unicode text. Unicode text files start with the two byte sequence hex(ff),hex(fe). Notepad and Wordpad will automatically text unicode/ansi text files.  
 
TYPE=VALUE  
 
TYPE can be one of the following:  
REG_NONE, REG_SZ, REG_EXPAND_SZ, REG_BINARY, REG_DWORD, REG_DWORD_LITTLE_ENDIAN, REG_DWORD_BIG_ENDIAN, REG_MULTI_SZ, REG_RESOURCE_LIST, REG_FULL_RESOURCE_DESCRIPTOR, REG_RESOURCE_REQUIREMENTS_LIST  
 
If type is string data (REG_SZ, REG_EXPAND_SZ, or REG_MULTI_SZ), then VALUE will be listed as sequence of characters terminated by a newline or carriage return character. Any unprintable character should be escaped into 2 hex characters:  
 
REG_SZ=This is a line#0awith a carriage return as part of the data#00  
REG_MULTI_SZ=This is a line1#00This is line2#00#00  
 
Additionally escaped characters  
because the '#' represent an escape character, all '#' characters must also be escaped.  
the '%' is used for Thinstall macro expansion, it must also be escaped when it the value should remain unexpanded.  
 
Example Macro expansion:  
REG_SZ=%ProgramFilesDir%\ApplicationX\control.ocx  
at runtime, when the program accesses this registry value, it will be expanded by Thinstall