When you use WiX to create a new website in IIS 6 it creates it with an Identifier or Site Id of one more than the last website that was created (this is the same as IIS 5). If you create it manually then IIS sets the Identifier to a number based on the hash of the site name - the algorithm for this is explained here on Mike Poulson's blog:
http://blogs.msdn.com/mpoulson/archive/2006/03/06/544893.aspx. To summarise it creates the hash and then if that Identifier is in use it just adds one until it finds an unused Identifier.
This method of creating Identifier's based on the hash of the name is very useful when you have a farm of servers as it means that the Identifier is not dependent on the order in which installs are run. For in house websites you can arrange for the website names to have unique hash values and be sure that all servers in a farm are identical and even build servers with a subset of the sites that again are identical to the original install. The identifier is also used for log file path, so on a farm of servers it helps if the logs are all in known folders. This Id is also used as the key to the session state so must be the same on all servers.
I think the website creation needs a parameter for SiteId which by default works as it currently does to avoid breaking existing installs. It should be possible to set this to default (as it works now), iis6hash or a specific numeric value.
I have attached a modified v2 scaweb.cpp that implements the IIS6 hashing method.
scaweb.cpp with IIS 6 site Id hash
Moving to WiX v4. We just aren't going to nail this now.
Now allow the WebSite/@Id to be set. Skipped doing all the hashing since it isn't deterministic for uninstall. Setting the SiteId should enable the scenario very well. Honestly, SitId works pretty well in all "controlled environment" cases.
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 21 days (the time period specified by
the administrator of this Tracker).