问题
I have an innosetup installer that needs to create an IIS Virtual Directory. In order to create the virtual directory, IIS Management Service must be enabled.
How do I check which Windows Features are enabled? The best solution would be to check a registry setting, but other methods that are possible via innosetup are fine.
The solution should work with XP, Vista, Win7, Win2003 server and Win2008 server (32 and 64 bit).
回答1:
I don't know offhand how to generically tell which features are installed. In the specific case of IIS, you can tell by looking for this registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp
IIS is installed if that key exists. If the key is missing, IIS is not installed.
More details here.
来源:https://stackoverflow.com/questions/7601605/find-out-if-iis-is-installed-by-examining-the-registry