Search code examples
iiswixwindows-installer

Wix installer. How to stop IIS pool


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.


Solution

  • 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