My web application typically will be installed to use applicationPoolIdentity:
<iis:WebAppPool Id="MyAppPool" Identity="applicationPoolIdentity" Name="MyAppPool"/>
but I have a class of users that will want to use a specific domain user instead, which I would typically author like this:
<util:User Id="MyUser" Name="[MY_USER]" Domain="[MY_DOMAIN]" Password="[MY_PASSWORD]" CreateUser="no"/>
<iis:WebAppPool Id="MyAppPool" Identity="other" User="MyUser" Name="MyAppPool" />
Making the user interface for this is simple enough, but is there a way to conditionally switch between Identity="applicationPoolIdentity" and Identity="other" without writing a custom action?
Yes, it is possible but you will need to create a component group with two components that have conditionals. As this solution is a bit verbose, I recommend having it in a separate file.
Here is an example, based on https://www.codeproject.com/Articles/115036/Creating-WIX-Installer-for-ASP-NET-Web-Application.