I have a webapp installer that installs all of its prerequisites, which includes IIS 7 too.
Since IIS doesn\'t come as a prerequisite in a Visual Studio setup projec
You have a couple options here. Pkgmgr works. You can use ServerManagerCmd.exe (Windows Server), Dism.exe (newer OSes) and leverage the flags from the MS site http://technet.microsoft.com/en-us/library/cc722041.aspx.
I would suggest threading out this component and if possible, update the UI with a progress notification/bar. That way your user will know things are progressing along.
Dism.exe is supposed to work with Windows 7, 8, 2008, etc. I would run some tests on a virgin VM with these OSes installed, take a snapshot and then run the installer. You can reapply the snapshot at will and you'll be able to test all the flags you need to make the software work.