Self-registering COM server

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Self-registering COM server

Bill Schwab-2
Blair,

Consider one program (analogous to LiveUpdate) that lives to download and
run installers, and then launches one of the programs it installs; it does
that by writing and running a batch file and then exiting so that the
updater can update itself.  The idea is to have machines that update
themselves every time they reboot, which can be forced (if all is well) from
a remote terminal.

My long-standing COM (exe) server is one of the players.  Its installer
feeds it a /RegServer command line parameter, in response to which it
self-registers and then exits.  The batch file runs various installers and
then finally launches "the" program that runs on the machine.

Problem: the "launchee" attempts to load the COM server, which (as it does
every time) attempts to self-register, only to find that the type library
cannot load, and things come to an unfortunate halt.  Unless I'm being
fooled, it appears to be timing problem, because everything starts fine a
short time later.

One solution would be to modify the installer to allow the COM server to
keep running after it self-registers, and that is probably what I am going
to try next.  Any other ideas?  Does this sound familiar?


Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Self-registering COM server

Bill Schwab-2
Blair,

I think I found it.  Before fixing a snag in the self-registration, I used
an InnoSetup flag to wait at least until the self-registering program became
idle.  With the self-registration working, the correct thing to do is to let
the installer wait for the COM server to exit.  With that change, my
reproducible failure scenario is no longer a problem.  My one lingering (and
largely rhetorical) question is how something like this could strike on five
machines out of five, but that's probably just another corollary to Murphy's
Law.

Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.
[hidden email]