Skip to content

Instantly share code, notes, and snippets.

@adunkman
Created November 2, 2012 19:20
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save adunkman/4003724 to your computer and use it in GitHub Desktop.
Save adunkman/4003724 to your computer and use it in GitHub Desktop.
Wix commands to auto-initialize an IIS website
<!-- Requires Application Initialization module in IIS 7.5 or (built in already to) IIS 8. -->
<!-- http://www.iis.net/downloads/microsoft/application-initialization -->
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product>
<!-- ... -->
<InstallExecuteSequence>
<Custom Action="CA.AppPoolSetStartMode" Before="InstallFinalize">NOT (REMOVE="ALL")</Custom>
<Custom Action="CA.ApplicationSetPreloadEnabled" Before="InstallFinalize">NOT (REMOVE="ALL")</Custom>
</InstallExecuteSequence>
<CustomAction Id="CA.AppPoolSetStartMode" Execute="deferred" Impersonate="no" Return="check" Directory="TARGETDIR"
ExeCommand="[SystemFolder]inetsrv\appcmd set apppool /apppool.name:&quot;Clinical.Landing AppPool&quot; /startMode:AlwaysRunning" />
<CustomAction Id="CA.ApplicationSetPreloadEnabled" Execute="deferred" Impersonate="no" Return="check" Directory="TARGETDIR"
ExeCommand="[SystemFolder]inetsrv\appcmd set app /app.name:&quot;Clinical.Landing/&quot; /preloadEnabled:true" />
<!-- ... -->
</Product>
</Wix>
@seansong327
Copy link

This is really helpful to me. Thank you!
But for my instance, I have to add another two custom actions to stop then start the apppool, so that the site method Application_Setup can be executed immediately.
Besides, somehow NOT (REMOVE="ALL") not work for me, it will execute both in install and uninstall process. So I use this NOT Installed AND NOT REMOVE.

@RKhan12345
Copy link

@seansong327 can u share the two custom actions that u have used for stating and stoping the apppool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment