"You should never set the dir variable in any
pkgIndex.tcl file.."
I respectfully disagree. It is a local variable in this situation. The OP complained that the $dir var set was wrong. The easiest, if not best, way to fix it is to set the variable within the loading script IMO.
It seems to me that you are making this more difficult
than it is.
However it does not seem now that this was the problem
at all.
Watergirl,
On my win2000 machine with tcl 8.4.xx, I just loaded and
sourced tcom using the method I proposed above with no
problem and no error. There is no reference to a registry
package in the pkgindex file and no other packages were loaded.
It is the same as using any dynamcially loaded library. If you cannot load (first), then source the tcom.tcl files, then you have a legitimate problem.