Extraction / Caching
Previous Top Next


Extracting / Caching options control how and when a virtual file is extracted to the real file system.

clip0189


Extracting to the Hard Drive

Cache on write / memmap
When the program tries to write or memory map the file in question it will be sent to the cache. Cache files are always stored in the cache directory. ( More info about Caching)

Extract on write / memmap
When the program tries to write or memory map the file in question it will be extracted to the harddrive using its virtual filename path. If the Installer has been included in the project, and the option "Delete on Uninstall" is enabled, then a log entry is made to remove the file during uninstall. If the virtual filename path does not exist, Thinstall will try to create the path and add any directories created to the uninstall log. If the virtual filename path cannot be created the operation that tried to open or memory map the file will fail with an error code returned to the application.

Extract during install
- The program installer must be enabled for this option to work.
- The file will be extracted to its virtual path and any directories needed to create that path will also be created.
- If "Overwrite disk if newer internal" is turned on, then the extraction will not occur if the file already exists on disk and has the same or newer last-modified date.

Extract on Start
- This will try to extract the file everytime the program is run.
- The file will be extracted to its virtual path and any directories needed to create that path will also be created.
- If "Overwrite disk if newer internal" is turned on, then the extraction will not occur if the file already exists on disk and has the same or newer last-modified date.

Never cache or extract file
This option tells Thinstall to fail any operation that would try to write or memory-map this file.


Controlling extracted file versions

Overwrite disk if newer internal
This option causes Thinstall to check for the presence of an external file. If an external file exists with a newer or equal file time, the internal version is not extracted. If the internal and external files are DLL/OCX files which contain DLL Version numbers, the DLL Version numbers are consulted first. If DLL version numbers can not be compared, the two file's creation time is consulted.


Always overwrite disk version
Thinstall will not always overwrite the external file if it exists. This option should never be used to place DLLs in the system directory newer DLL versions may be replaced by older versions.

Never overwrite disk version
Thinstall will never replace an external file with an internal version.


Cleaning up extracted or cached files

Delete on Uninstall
The installer must be included to use this option. When selected, if the file is cached or extracted at any time (install or runtime), then an entry will be added to the uninstall log so the file is deleted during uninstall.

Delete on Program Exit
If the file is cached or extracted during the program's execution, it will be deleted when the program quits.

Delete on File Close
***Currently not working!***


Don't delete cache / extraction
This option can be used if you want to leave extracted files behind after your program has uninstalled.



When your application tries to download, write to, or memory map a virtual file (i.e. a file bundled with the EXE), Thinstall cannot modify the internal version of the fill so it will perform one of the following options:

· Extract the file. The file is decompressed to its full path as specified in "Virtual Path." For example %TEMP%\test.dat will be extracted to the Windows TEMP directory for the current user. Future reads and write to this filename will use the "real" external file unless the read order is set to "Internal Only".

· Cache the file. The file is decompressed and optionally encrypted to the "cache directory." Instead of using the filename specified for the file, Thinstall takes the hash of the full virtual path and creates a unique filename. For example c:\dir\test.dat might be extracted to the cache directory as sv4jzb6svmt77.ths. If cache encryption is turned on, the file's contents will be transparently encrypted . The application continues to view the file contents normally, but external applications will see garbage. Future reads and writes to the specified file will be redirected to the newly created cache file.

· Never Extract File. In this case Thinstall will cause the original operation to fail.


Cache Encryption

Cache encryption allows you to hide the contents of any file that Thinstall extracts to the cache directory from external programs. Any cache file with cache encryption turned on will be transparently decrypted and encrypted by your Thinstall application as it reads and writes to the file making the file appear normal.

If you plan to memory map the file, or use a function that uses memory mapped files you should not enable cache encryption or the application will see the encrypted data. The .NET loader uses memory mapped files to load DLL files - in that particular case you should enable Never Cache/Extract for .NET DLL files.

While the encryption used by Thinstall should be enough to prevent most people from accessing the file's data, it is "crackable" because the decryption key must be stored with your program. Because of this, encryption should not be used to store highly confidential information where monetary loss could result in the contents being disclosed.