Dorival
Dorival

Reputation: 689

Recycle Application Pool via WiX

I'm using WiX 3 to setup my Web Application and most of the cases I'm just installing new versions of the project on the top of the current version, like upgrading the web app every week or so.

I wonder if is there a way to explicit ask IIS to Recycle a given Application Pool via WiX (remove-and-create-again it's not suitable in my case), if not, do we have a way to work around to accomplish that?

Upvotes: 2

Views: 1429

Answers (1)

KMoraz
KMoraz

Reputation: 14164

Create a custom action that calls appcmd.exe with the recycle command.

In your case:

<Product>
  . . . 

  <CustomAction Id="CA_RecycleAppPool" 
      Execute="deferred" 
      Impersonate="no" 
      Return="check" 
      Directory="TARGETDIR" 
      ExeCommand="[SystemFolder]inetsrv\appcmd recycle apppool /apppool.name:&quot;[APPPOOLNAME]&quot;" />


  <InstallExecuteSequence>
    <Custom Action="CA_RecycleAppPool" Before="InstallFinalize" />
  </InstallExecuteSequence>
</Product>

Upvotes: 5

Related Questions