1

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.

Yan Sklyarenko
  • 31,557
  • 24
  • 104
  • 139
user1283002
  • 391
  • 1
  • 4
  • 12

1 Answers1

1

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.

Yan Sklyarenko
  • 31,557
  • 24
  • 104
  • 139
  • Thank you, I will try this and report back. – user1283002 Jul 19 '12 at 10:23
  • Thank you, I will try this and report back. For the ethical part - I plan to reverse the registry back to the original value after the installation is complete, don't want to change anything for the end user. I'm not a fond of silent installations but this is intended to be deployed by IT on multiple machines so they want to avoid user interaction and make the installation process as bullet-proof as possible. BTW - the installation is checked by IT security to verify I don't insert any threats or break security policies :) – user1283002 Jul 19 '12 at 10:32
  • I know it was not asked in the original question, but if I have two different components that write registry keys - is it possible to execute the CloseApp after one and before the previous? I want to be able to write the registry key back after the app is closed and installation is complete. – user1283002 Jul 19 '12 at 12:02