I have a WiX install project that includes IIS setings for virtual directory and application settings with an application pool. After initial install, the customer will change the application pool identity from default network service set in wxs.
How can I build an update installer that can update web files, but not change the IIS settings, application pool identity back to network service?
ComponentGroupRef Id="WebPublishCmp" is the initial heat output of the web files to publish.
I have tried to build a minor upgrade using Torch and Pyro, but I am having issues with Torch diff not detecting changes (this is another issue for another Stack Overflow question).
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension">
<?include Config.wxi ?>
<Product
Id="E3105F82-0460-4C3C-8F6C-778405E81F61"
Name="Website"
Language="1033"
Version="1.0.0.1"
Manufacturer="Website"
UpgradeCode="E3105F82-0460-4C3C-8F6C-778405E81F61">
<Package
InstallerVersion="200" Compressed="yes" />
<Media
Id="1"
Cabinet="media1.cab"
EmbedCab="yes" />
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION" />
<UIRef Id="CustomWixUI_InstallDir"/>
<FeatureRef Id="InitialFeature"/>
</Product>
<Fragment>
<Feature Id="InitialFeature" Title="Initial (Full)" Level="1">
<ComponentGroupRef Id="WebPublishCmp"/>
<ComponentRef Id="IIS.Component"/>
</Feature>
<Feature Id="WebFilesFeature" Title="Website (Files)" Level="1">
<ComponentGroupRef Id="WebPublishCmp"/>
</Feature>
</Fragment>
<Fragment>
<Component Id="IIS.Component" Guid="6FAD9EC7-D2B0-4471-A657-C8AF5F6F707F" KeyPath="yes" Directory="INSTALLLOCATION">
<iis:WebSite Id="DefaultWebSite" Description="$(var.WebSiteName)" Directory="INSTALLLOCATION" >
<iis:WebAddress Id="AllUnassigned" Port="80"/>
</iis:WebSite>
<iis:WebAppPool Id="WebsiteAppPool" Name="App" Identity="networkService" />
<iis:WebVirtualDir Id="My.VirtualDir" Alias="App" Directory="INSTALLLOCATION" WebSite="DefaultWebSite">
<iis:WebApplication Id="Application" Name="App" WebAppPool="WebsiteAppPool"/>
</iis:WebVirtualDir>
</Component>
</Fragment>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLLOCATION" Name="Website">
</Directory>
</Directory>
</Directory>
</Fragment>
</Wix>
I am using:
- WiX 3.5, 3.6
- Visual Studio 2010
I apologize ahead of time for the long answer:
I recommend keeping your Website and Content in two separate features and then giving them the option of supplying any variables needed for installation via UI or command line parameters. If you use the "Remember Property" pattern, then you can recall the variables used when changing or upgrading an installation (read all the way through the last comments, there is a slightly simpler way of doing it).
This allows the person installing the product to set up everything with the given variables or set up the IIS website on their own and install only website content.
This also jives well with MajorUpgrades. I don't currently see upgrade information in code you provided, so you should look into MajorUpgrades vs patches (major upgrades are much easier)
Remember, variables accessed by $(var.name) are used at MSI compile time, whereas public variables accessed via brackets [MY_VARIABLE] are used at install time. Public variables can be exposed through the MSI UI, or provided to msiexec via command line (I use this for silent installs and/or specifying a log file)
Here is a summary of the examples included below:
Configuration.wxi:
Product.wxs:
IISConfiguration.wxs:
UIFlow.wxs:
UIDialogs.wxs: