Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I personally recommend using AppCmd.exe (matthewthurlow's first bullet) because you don't have to count on the legacy management components being installed, or risk modifying the configuration XML manually.</p> <p>If you are not comfortable with AppCmd, Mike Volodarsky has a great article on <a href="http://learn.iis.net/page.aspx/114/getting-started-with-appcmdexe/" rel="nofollow noreferrer">Getting Started with AppCmd.exe</a>, and the Microsoft <a href="http://www.iis.net/ConfigReference" rel="nofollow noreferrer">IIS Configuration Reference</a> is excellent, offering UI, Code and AppCmd examples for modifying each of the configuration items (e.g. <a href="http://www.iis.net/ConfigReference/system.applicationHost/applicationPools" rel="nofollow noreferrer">Application Pools</a> ). The <a href="http://www.iis.net/extensions/AdministrationPack" rel="nofollow noreferrer">IIS7 Administration Pack</a> also includes a Configuration Editor that allows you to <a href="http://learn.iis.net/page.aspx/417/using-configuration-editor-generate-scripts/" rel="nofollow noreferrer">generate AppCmd scripts</a> from any existing configuration.</p> <p>To integrate AppCmd into WiX, you need to create and schedule two custom actions for each command. There is general information in the WiX v3 manual <a href="http://wix.sourceforge.net/manual-wix3/qtexec.htm" rel="nofollow noreferrer">documenting this procedure</a>, and I've included a concrete example below.</p> <p>First, you need to set up an immediate action to store the command line in a property:</p> <pre><code>&lt;CustomAction Id="CreateAppPool_Cmd" Property="CreateAppPool" Execute="immediate" Value="&amp;quot;[WindowsFolder]system32\inetsrv\APPCMD.EXE&amp;quot; add apppool /name:&amp;quot;[APP_POOL_NAME]&amp;quot;" /&gt; </code></pre> <p>Next you set up a deferred action which references this property:</p> <pre><code>&lt;CustomAction Id="CreateAppPool" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="ignore" Impersonate="no"/&gt; </code></pre> <p>And finally, you need to schedule these. The immediate action that sets the properties seem to work well after InstallFinalize, and the deferred action works after InstallFiles. I haven't got as far as figuring out rollback actions yet.</p> <p>MapGuide Open Source does this method extensively; you can see the CA scheduling in our <a href="http://trac.osgeo.org/mapguide/browser/trunk/Installer/Installers/MapGuide/MapGuide.wxs#L444" rel="nofollow noreferrer">MapGuide.wxs</a> file, and the CA definition in our <a href="http://trac.osgeo.org/mapguide/browser/trunk/Installer/Libraries/MapGuide%20Web%20Extensions/IIS7.wxs#L9" rel="nofollow noreferrer">IIS7.wxs</a> file.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload