Virtual Filesystem Options
Previous Top Next

See also: When should I modify the cache directory?
See also:
What is a cache file?

Where to find this option:
Menu -> Virtual Files -> Virtual Filesystem Options

clip0528

Cache Overview
Thinstall maintains two caches for code and data; the Data Cache and the DLL Cache.

The Data cache is used when a data file has a property set which requires Thinstall to cache a data file. For example, if a file is marked "Cache on Write", Thinstall will extract the file from your archive to the specified data cache directory. From this point on, reads & writes to the file will be transparently redirected to the cache file. This allows persistant changes to files in the original distribution.

The Dll cache is used to speed up application load times and reduce memory consumption. When the option "Enable Dll file maps" is turned on, Thinstall creates a disk-layout of how a DLL looks when loaded into memory and places this on disk. The DLL is then mapped into memory which reduces the memory footprint size since it's contents are mapped into memory by the operating system as they are used. Memory for virtual DLLs can be share across multiple running instances of your application if the Cache Directory is in a location that other users can read/write from. If a user does not have permission to write to the cache directory or a cache operation fails for other reasons (such as disk full) Thinstall will load the DLL into memory without using caching.


Data Cache Options


Implicitly created virtual directories are shell visible

When you add a virtual file to your to project, for example %InstallPath%\subdir\myfile.txt, Thinstall will automatically create the virtual directory %InstallPath%\subdir if it does not exist on the user's computer. This option sets the default visibility for these implicitly created virtual directories. The default options is allow allow virtual directories to be visible to shell components. This options is bestfor maximum compatability, however it will mean the user may see "phantom" directories when they use File/Open. I.e. They may see directories that only exist in the virtual environment.

For more fine tune control over weither a directories are shell visible or not, you can add virtual directories to your project using File->Add Virtual Directory. Once you've added the virtual directory to your project, you can right-click on it from the file list and individually adjust the visiblility.

The Data Cache Directory
The Cache Directory specifies the name of the directory where files created by Thinstall will be placed. By default these files will be placed in the directory "%InstallPath%" (i.e. the directory where the exe resides). Operations that cause files to be cached include:
· Opening a file with write permission. Because Thinstall cannot write to the running EXE where compressed virtual files are stored, writing to a virtual file will cause the file to be cached to the cache directory. All future operations on that file will be redirected to this cache file. If the cache file is deleted, then operations will revert to the original bundled virtual file included in the EXE.
· Creating a memory map of a file (i.e. CreateFileMapping). Memory maps are sometimes created for DLLs and EXEs that contain ActiveX type libraries. In some cases, programmers may intentionally create memory maps themselves. If a file has "Cache Encrypted" enabled then functions that try to access the file's data through a memory map will see garbage. This may cause some system functions that operate on DLLs or EXEs to fail or crash.
· When loading files remotely from a web server. Any files marked for remote loading will be placed in the cache directory when they are first downloaded.

When a file is cached, a hash value created from its full virtual path is used instead of its original filename to avoid clashes from multiple files with the same filename but different paths.

Setting Cache Filename Extensions

By default, Thinstall will use the filename extension ".ths" for cache files it creates. If you want it to use a different extension you can change "Cache Filename Extension" to any value. Setting this value to blank will cause no filename extension to be added.

Hiding Cache Files
Cached files are uncompressed, and thus any text files would be editable by an end user. If you wish to hide the file's contents from the user, turn on cache encryption by selecting this option from the right-click menu from the file list.


Dll Cache Options

Enable Dll file maps - Checking this box enables Thinstall DLL file map optimization. Dll file maps help reduce an application's memory footprint and speed up load times.

Dll file map cache directory - Controls the location where DLL file maps are placed. Dll filemaps filenames consist of a long string of letters and numbers followed by the extension .thmap. If a DLLs content changes in the future, a different version is placed in the cache. Thinstall uses the DLL's file size, last modified date, and creation date to determine if it needs to update the filemap.

The default cache directory is : %AppData%\%BaseName% Cache, this will expand to "c:\documents and settings\USER\Application Data\MYPROGRAME Cache" where USER is the current logged-in user and MYPROGRAM is the name of your EXE without the .exe extension.


Maxiumum DLL file map cache size - This number (in Megabytes) controls how much space DLL maps can occupy in the DLL file map cache directory. If the total DLL maps exceeds this size, Thinstall will try to delete the oldest map files until the size goes under this amount.