OleClean 1.3
An Ole garbage remover program
by Maurizio Ferreira
Warning
Using this program, you can severely damage your registry.
You could experience malfunctioning of your computer, lose valuable data, and need to reformat your disk(s) and reinstall the operating system.
You could lose your job, ruin your marriage, kill your neighbours, overwater your flowers, or cause a global thermonuclear war.
While the author thinks the program behaves correctly, he does not assumes any responsibility.
Use it at your own risk.
Introduction
The purpose of this program is to remove the Ole garbage left in the registry after installing and deinstalling several Ole (Com) dlls.
This program can be especially useful to those who build dlls in Visual Basic.
They know what I mean.
Copyright
The program is (and will always be) FREEWARE .
You are allowed:
- To use it both at home and in organizations.
- To distribute copies to anyone, on the condition that a complete and unmodified copy of the original zip package is provided.
- To include such a package in cd roms on the condition that it is clearly stated that the program is freeware and the name and e-mail address of the author is clearly indicated. Such cd roms can be sold without restrictions, as long as they contain other programs: you may sell those programs but not this one.
You are NOT allowed:
- To modify the program or the documentation in any way or reverse engineer the program.
- To sell it to anyone.
Support
You can send your requests and suggestions to ferreira@split.it. However, I don't promise to answer any letters.
Installation
The program does not require any special installation. Simply copy it and the documentation (this file) in a directory and enjoy it.
The use of the documentation is optional.
While I strongly suggest that you keep (and read) it, the program works without it.
Deinstallation
To deinstall the program, simply delete it and any files it generates.
Except for the generated files (see below), it doesn't write anything in your register or in your computer. (It just removes...)
Files generated
If you set and confirm any option, the program creates or updates a file called OleClean.ini in the same directory
where the program resides.
After any delete operation, the program generates, in the same directory, a backup file having a name in the form YYYYMMDDHHMISS.reg,
where YYYY is the year, MM the month, DD the day, HH the hour, MI the minutes, and SS the seconds of the start of the deletion.
This is a normal text file that contains all the deleted keys and subkeys.
If you haven't changed the .reg file association, double clicking on this file simply reinserts in the registry what was deleted; alternatively, you can open a dos box and issue the command (without quotes) "regedit XXXXXX" (where XXXXXX is the name of the file).
Program usage
The use of the program is straightforward
Simply set up the options inserting the name(s) of your files in the list, check one or more of the autoselect buttons, and confirm the settings.
Before starting the analysis, be sure to be connected to any necessary remote directories if you have registered dlls across different computers.
Having done so, click on the analysis button and review the generated error lists.
You can interrupt a long scan by pressing the Stop button.
After the analysis is completed, you can review the results
by switching from page to page to see the four error categories, and you can
select or deselect individually each entry before clicking on the delete button.
Only the selected entries will be deleted from the registry.
Be careful: the delete button deletes entries on all the pages, not just those on the page you are currently viewing.
Take great care to select only the entries you are sure you want to delete.
Typically, there will be some entries referring to non-existent system files other than those you built.
After a delete operation, you will see the remaining undeleted entries, so that you can select some more and delete them in turn.
When you have deleted all the entries, the delete button will be disabled.
Attention: the delete button does not ask for confirmation - it starts to delete immediately.
Options
The program allows you to set the following options:
Exclude files list
The purpose of this list is to simulate the absence of files without actually deleting them.
During the Scan phase, the entries in the registry referencing those files will be marked as invalid and selected for deletion.
In this way, you can remove entries in the registry referencing those files.
Typically, you will insert the names of your DLL and EXE files.
Take great care to select only your DLL's and not any system dll's.
The program doesn't make any distinction, so you can severely damage your registry if you delete system entries.
You can insert several file names in this list. The Add button allows you to find and add any existing file name, while
the Remove button removes the currently selected file name(s).
You can select more than one name at a time, both in the list and in the open dialog.
You can also insert non-existent file names. Just click on the Add button, go to the directory of your choice, type any name, and click Open.
You cannot insert the name of a non-existent directory; however, you can always manually edit the OleClean.ini file.
In this case, remember that the options are read at program start, so to have effect, you must quit and restart the program.
Ignore Numeric tail
Some entries in the registry have the form [Drive:\]xxx\yyy\zzz, where the actual file name is the yyy part and zzz is a numeric string of undocumented purpose.
If this option is checked, this part is removed before any attempts are made to find the file, either in the exclude list
or on the disk.
Ignore Path
This option applies only to the Exclude file list
If this option is checked, path information in the registry and in the exclude path is ignored
when the program attempts to find a file reference in the Exclude files list.
This is handy when you are not sure what the location of a file was the last time you registered it.
In this way, you can simulate the absence of a file by just typing its name in the exclude list without worrying about locations.
Note that if a file is not found in the Exclude list, the disk is searched using its path as explained in the 'How it works' chapter.
Auto select check boxes
If you activate any check box in this section, during the analysis phase any error encountered will be automatically selected (checked) in the associated error list so that the delete button will delete it.
Error messages
In each error message are reported the registry subkey XXXX with its value YYYY and the default value ZZZZ of such value (in clsid or typelib as indicated).
If the value YYYY is not found in the registry, its default value ZZZZ is indicated with -KEY NOT EXISTING-, while if the key exists but the program is unable to read it, its value is indicated by -UNABLE TO READ VALUE-.
In the result grids, you can see the following messages:
The subkey XXXX YYYY references the file not found ZZZZ
This means that the subkey XXXX of the registry key indicated on the left having the description YYYY (only for type libs) references a file ZZZZ that was not found in the system.
This message can appear in the 'Bad classes' or 'Bad type libs' grid.
The value of subkey XXXX YYYY ZZZZ was found in BAD type libs
The subkey XXXX has the value YYYY (with description ZZZZ) that should be a valid typelib id entry.
Such an id was found in the register but is invalid (this entry should be reported in the bad type lib grid)
This message can appear in the 'Bad interfaces' or 'Bad prog ids' grid.
The value of subkey XXXX YYYY ZZZZ was not found in good type libs
The subkey XXXX has the value YYYY (with description ZZZZ) that should be a valid typelib id entry.
Such an id was not found in the register.
This message can appear in the 'Bad interfaces' or 'Bad prog ids' grid.
The value of subkey XXXX YYYY ZZZZ was found in BAD classes
The subkey XXXX has the value YYYY (with description ZZZZ) that should be a valid clsid id entry.
Such an id was found in the register but is invalid (this entry should be reported in the bad classes grid)
This message can appear in the 'Bad interfaces' or 'Bad prog ids' grid.
The value of subkey XXXX YYYY ZZZZ was not found in good classes
The subkey XXXX has the value YYYY (with description ZZZZ) that should be a valid clsid id entry.
Such an id was not found in the register.
This message can appear in the 'Bad interfaces' or 'Bad prog ids' grid.
How it works
This is a detailed explanation of the inner workings of the program
1) When you press the Analyze button, the program reads all the clsid entries from the registry (from HKEY_CLASSES_ROOT\CLSID) and puts them in a GoodClsId list.
2) For each entry in the list, the program checks whether it has any one of the following subkeys:
InProcServer, InProcServer32, InProcHandler, and InProcHandler32.
If none of these subkeys exists, the key is considered good and nothing happens.
If one or more such keys is found, the program reads the default value of the key (that should be a valid file name) and tries to find the file.
If the filename contains a path, the program uses the complete file name; otherwise, it seeks the file in both the Window and the System directories (as defined by the GetSystemDirectory and GetWindowDirectory API calls)
3) If one (or more) of the above subkeys contains a reference to a non-existent file, the entire
clsid entry is removed from the GoodClsId list and placed in a BadClsId list and an entry is generated in the result list window.
4) The program then reads all the entries from HKEY_CLASSES_ROOT\TypeLib and puts them in a Good TypeLib list
5) For each entry in the list, the program reads all the subkey entries of the key (that should be versions entries) and places them in a temporary list.
6) For each item in this temporary list, the program attempts to read the subsubkeys 0\win16 and 0\win32 that should have a valid file name in their default values.
If such keys do not exist, nothing happens; otherwise, the associated file must be available.
If the file is not found, the key is removed from the good TypeLib list and placed in a Bad TypeLib list and an entry is generated in the results list window.
7) The program then looks at Interfaces.
All the entries from HKEY_CLASSES_ROOT\Interfaces are read into a GoodInterfaces list, and each is then scanned in turn.
For each entry, the program checks three subkeys (if they exist): TypeLib, ProxyStubClsId, and ProxyStubClsId32
The default value of TypeLib must then be found in the GoodTypeLib list.
First whether it appears in the BadTypeLib list is checked, and if found, an error description is generated. Then it is sought in the GoodTypeLib list, and if not found, an error description is generated.
The default value of the other two entries must not be found in the BadClasses list and found in GoodClasses list.
If either of these conditions is false, the interface is removed from the GoodInterfaces list
and placed in the BadInterfaces list, and an entry is generated in the results list window.
8) Finally, the program checks ProgIds
The program reads all the top level subkeys from HKEY_CLASSES_ROOT and puts them in a GoodProgId list.
Then the program filters this list, removing:
- all entries starting with '.' (extensions)
- all entries starting with '*' (default extension)
- the CLSID subkey
- the APPID subkey
- the INTERFACE subkey
The remaining entries are considered valid entries and are eligible for scanning.
For each entry in such a list, the program checks the clsid subkey (if it exists).
The default values of such subkeys must not be in the BadClass list and be in the GoodClass list; otherwise, the ProgId is considered invalid, removed from the GoodProgId list, and placed in a BadProgId list,
while an entry is generated in the results list window.
9) Deletion phase
When you press the delete button, the program scans the four bads lists. If the corresponding check box is selected, the program removes the entry from the register, making a backup copy of each key with (recursively) owned subkeys.
Final notes
- The additional blank green row appearing in the results windows is normal and does not require worrying about.
- Occasionally after clicking on a button in a result list when you change your mind and want to unclick the button, you
will have to move the cursor to a different row and back to the first. I don't plan on fixing this.
- The sequence of operations was discovered by trial and error.
- If you have additional information or a better method to do such cleaning, please let me know.
- This program was written with Delphi 5.
Thanks
Thanks to Wayne Tuttle to have kindly corrected this help file.