1

I faced with the problem in my WIX installer: how can I stop specific IIS application pool during repair, change or update? Description: Deliver and deploy Web Application, run repair. Dialog appears that says that w3wp process locks files. In addition, because of requirements I cannot just hide that message and I cannot change Web Application.

enter image description here

What I tried to do:

  1. I tried to stop service "W3SVC" with ServiceControl and it works excellent! But what I really need to do is to stop only one specific IIS pool.
  2. I consider the way to write my own custom action to stop app pool, but as I know, I cannot schedule it before InstallValidate. Please, correct me if I'm wrong.

Please, help me overcome this issue.

2 Answers2

1

You can use quiet execute custom action to shell out to appcmd to stop an app pool. You are right though, you wouldn't always be elevated prior to InstallValidate.

https://technet.microsoft.com/en-us/library/cc732742(v=ws.10).aspx

I suspect this is probably a false alarm and will resolve itself later in the installer. I would look at the various was to suppress this dialog. Maybe this would help:

WiX: Avoid showing files-in-use dialog and just prompt for reboot at end of install

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
0

First of all, please accept my great thanks!

As I understand, there are just two options to overcome the issue:

  1. Add <ServiceControl Id="iisServiceControl" Name="W3SVC" Start="both" Stop="both" />, in case of you agree to stop the whole service
  2. Add set property<Property Id="MSIRESTARTMANAGERCONTROL" Value="Disable" Secure="yes" /> and schedule your custom actions to stop/start your AppPool.

I guess to use options 2 due to the requirements. BUT, as I think, the best solution would be to say that after InstallValidate validator should just ignore some kind of processes filtering them by the name.