Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

commented Jun 23, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.