<p>I have a really simple ASP.NET web application and a web setup project that deploys the project output and content files to a virtual directory in IIS.</p>

<p>What I want is for the MSI to automatically disable Anonymouse Access for that virtual folder in IIS. </p>

<p>I suspect it can probably be done by writing some code in a custom action DLL, that would be acceptable, but is there any way to do it within the the settings of the web setup project?</p>

Taken from technet
The property for anonymous access is
  unfortunately not available through
  Web setup projects. For this reason,
  you must:
Write a custom installer to enable or disable anonymous access.
Pass the necessary parameters from the setup wizard to the installer at
  run time.