Search code examples
iis-7nsis

Identifiy IIS 7 using NSIS


Is there a way to identify the current version of IIS / using NSIS?

I need a way to add some special behaviour to my installer in case of IIS 7.


Solution

  • In our NSIS installer, we check the MajorVersion and MinorVersion DWORD values found under "HKLM\SOFTWARE\Microsoft\InetStp". This is the way I found others doing it online.

    You could do something like:

        ClearErrors
        ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\InetStp" "MajorVersion"
        ReadRegDWORD $1 HKLM "SOFTWARE\Microsoft\InetStp" "MinorVersion"
        IfErrors skip
    
        IntCmp $0 7 0 skip 0
    
        // do special IIS stuff here
    
    skip: