user145400
user145400

Reputation: 1084

Wix Managed Bootstrapper Application: When do the Detect* events fire?

As soon as my Wix MBA starts up (actually in the main view's codebehind constructor), I set event handlers for a bunch of Detect* events in the BA:

LogDetect("Setting bootstrapper detection handlers");
bootstrapperApplication.DetectRelatedBundle += BootstrapperOnDetectRelatedBundle;
bootstrapperApplication.DetectPackageComplete += BootstrapperApplicationOnDetectPackageComplete;
bootstrapperApplication.DetectRelatedMsiPackage += BootstrapperOnDetectRelatedMsiPackage;
bootstrapperApplication.DetectPriorBundle += BootstrapperOnDetectPriorBundle;
bootstrapperApplication.DetectMsiFeature += BootstrapperApplicationOnDetectMsiFeature;
bootstrapperApplication.DetectComplete += BootstrapperApplicationOnDetectComplete;
bootstrapperApplication.DetectBegin += BootstrapperApplicationOnDetectBegin;

then I make the call to Detect():

LogDetect("Beginning detection of existing installations...");
bootstrapperApplication.Engine.Detect();

Inside of these handlers I only make calls to LogDetect(). I know that LogDetect() works because those two calls I have outside of the handlers do log the messages, however no other messages are logged by LogDetect() which means the handlers are never called.

I figured at least DetectBegin and DetectComplete would fire.

I thought the events would be fired shortly after I make the call to Detect(). When does it actually happen?

Edit: If I look in the logfile in the user's temp directory it does show that Detect is happening. Those log entries are not mine (they are marked iXXX where the i stands for internal I presume).


(Sidenote: there's this somewhat related question, the fact that it hasn't been answered is not very promising... Wix Bootstrapper: Sequence of Bootstrapper events)

Upvotes: 1

Views: 998

Answers (1)

user145400
user145400

Reputation: 1084

It looks like they were firing all along; they were simply trying to do work on a different thread :/

Upvotes: 1

Related Questions