Question

I want my installer to close all IExplorer instances and then perform an install. To close IE I need to add a registry key so all tabs will be closed without a dialog and then I use <util:CloseApplication... /> to close the IE instances.

Both CloseApplication and the Component that registers the key works well. My problem is how to schedule them so the CloseApplication will be executed only after the registry key is added.

The only place I could put the <util:CloseApplication... /> without errors was under <Product...>. The order of Component executions is determined by:

<Feature..><ComponentRef../></Feature..>

I can't figure out how I can control the execution order of the <util:CloseApplication... /> element and delay it until the registry key is set.

Was it helpful?

Solution

The <util:CloseApplication> element is translated into a number of custom actions. One of them is WixCloseApplications which actually schedules the deferred CA to do the job. By default it is scheduled before InstallFiles, and you can try to re-schedule it after WriteRegistryValues:

<InstallExecuteSequence>
  ...
  <Custom Action="WixCloseApplications" After="WriteRegistryValues" />
  ...
</InstallExecuteSequence>

I didn't do this in real installation, so you'd better play with it and test thoroughly to make sure it closes the applications as expected after re-scheduling.

UPDATE: it was a technical side of the question. There's also the ethical one :)

AFAIU, what you're trying to do is to change the IE setting with your installation. I don't think it is a good user experience. Imagine you set up your browser the way you like, and suddenly it changes one of those settings. You'll never know that some unrelated installation did it, and you'll blame Microsoft in this sin. :)

So, try to re-think this part of the installation architecture. Probably, you might want to add a launch condition to check that IE setting and inform the user.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top