Most problems can be found by enabling the option "Log Major Errors", rebuilding your program, running it, and then looking at the text file thinstall.log.
Diagnosing Programs Using log files
The thinstall.log file is text that can be opened using Wordpad or any text editor. Looking at the log file, you will see something like this:
005440 f20 FindFirstFileW C:\thinstest\eric\XPdebug\output\system.mdb -> ffffffff '*** no_files_found' 005441 f20 CreateFileA 'C:\thinstest\eric\XPdebug\output\system.mdb' (external open)
-> ffffffff (*** failed) 005443 f20 RegOpenKeyExA 0x80000000 HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-000000000000} (KEY_QUERY_VALUE KEY_ENUMERATE_SUB_KEYS KEY_NOTIFY ) -> 0x2 (key=0x0) (*** system open failed ***)
005444 f20 CoCreateInstanceEx {00000000-0000-0000-0000-000000000000}.(no such class) context=0() (finish) -> 80070057 ( E_INVALIDARG) *** failed
005445 f20 RegOpenKeyExA 0x80000002 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Debug (KEY_QUERY_VALUE ) -> 0x2 (key=0x0) (*** system open failed ***)
005446 f20 RegOpenKeyExW 0x80000001 HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\App Management (KEY_QUERY_VALUE ) -> 0x2 (key=0x0) (*** system open failed ***)
005447 f20 RegOpenKeyExW 0x80000002 HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\App Management (KEY_QUERY_VALUE ) -> 0x2 (key=0x0) (*** system open failed ***) 005448 f20 CoCreateInstance {3FF292B6-B204-11CF-8D23-00AA005FFE58}.FoxOLEDB 1.0 Object context=3(CLSCTX_INPROC_SERVER CLSCTX_INPROC_HANDLER ) -> 80040154 (REGDB_E_CLASSNOTREG) *** failed 005449 f20
RegOpenKeyExA 0x80000000 HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-000000000000} (KEY_QUERY_VALUE KEY_ENUMERATE_SUB_KEYS KEY_NOTIFY ) -> 0x2 (key=0x0) (*** system open failed ***)
005450 f20 CoCreateInstanceEx {00000000-0000-0000-0000-000000000000}.(no such class) context=0() (finish) -> 80070057 ( E_INVALIDARG) *** failed
005451 f20 RegCloseKey 0x714 HKEY_UNKNOWN (*** key already closed or not seen before)
005452 f20 RegCloseKey 0x704 HKEY_UNKNOWN (*** key already closed or not seen before)
005453 f20 RegCloseKey 0x6d4 HKEY_UNKNOWN (*** key already closed or not seen before)
Most of the statements do not refer to any real problem. For example anything that mentions {00000000-0000-0000-0000-000000000000}, or system registry keys under Software\Microsoft or Software\Policies is not likely to be an error.
005440 f20 FindFirstFileW C:\thinstest\eric\XPdebug\output\system.mdb -> ffffffff '*** no_files_found'
This says, the application asked Windows if the file system.mdb exists and Windows and Thinstall say that it does not. Either you have not added system.mdb to your Thinstall project, or the virtual path of the file does not match the path for which the application is looking. In this case, we probably want the virtual path %InstallPath%\system.mdb, assuming we can the applicaiton from the directory C:\thinstest\eric\XPdebug\output
Another thing to watch out for - if you enable the file option "Invisible to search / enum", the file will not be visible to FindFirstFile. 005441 f20 CreateFileA 'C:\thinstest\eric\XPdebug\output\system.mdb' (external open) -> ffffffff (*** failed) Like the statement above, this says the application tried to open the file system.mdb, but failed.
005448 f20 CoCreateInstance {3FF292B6-B204-11CF-8D23-00AA005FFE58}.FoxOLEDB 1.0 Object context=3(CLSCTX_INPROC_SERVER CLSCTX_INPROC_HANDLER ) -> 80040154 (REGDB_E_CLASSNOTREG) *** failed This line indicates the application tried to create the COM object " FoxOLEDB 1.0 Object"but failed. Some of the reasons a COM object might fail to be created include:
1. You did not record a virtual registry script for the COM object.
Check to make sure you have a .threg file in your project that contains the string: HKEY_CLASSES_ROOT\CLSID\{3FF292B6-B204-11CF-8D23-00AA005FFE58}
2. The virtual path in the .threg file refers to the wrong virtual path of the file in your project.
Check to make sure the the .threg file has the same virtual path as your virtual file. For example, in the .threg file it should have lines that look like this:
...
subkey InprocServer32
{
lastwrite 903431cd76a9c301 value "" 01 %InstallPath%\Flash.ocx value ThreadingModel 01 Apartment
}
....
You should have the file flash.ocx in your project file. When you double-click on it, the virtual path should read %InstallPath%\Flash.ocx
005451 f20 RegCloseKey 0x714 HKEY_UNKNOWN (*** key already closed or not seen before)
005452 f20 RegCloseKey 0x704 HKEY_UNKNOWN (*** key already closed or not seen before)
005453 f20 RegCloseKey 0x6d4 HKEY_UNKNOWN (*** key already closed or not seen before)
This statement is telling us the application is trying to close a registry key that does not exist. In this particular case this was due to a bug in the program where it closed the key more than once. This behaviour will not affect the operation of Thinstall, but it is a good idea to fix this bug.