Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS Launch Condition in WebSetupProject fails to detect IIS 10 on Win10

Our WebSetupProjects (created in VisualStudio 2010) fail to properly detect version of IIS on Win10.

My thought is that it has to do with the way how this condition is spelled out - note the double-quotes:

     (IISMAJORVERSION >= "#5" AND IISMINORVERSION >= "#1") OR IISMAJORVERSION >= "#6"

so even though registry check in HKLM\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters for MajorVersion and MinorVersion returns dword-integer values, they are being coerced into string representation, therefore resulting in "10" being less than "5" or "6" - thus failing the check.

I haven't tried removing double-quotes yet, but am afraid they may be there for a reason (i.e. without them the check won't work properly). Still, will attempt this once i get a chance, and will report on it.

In the meantime, has anyone encountered the same scenario and found how to solve it?

like image 749
Astrogator Avatar asked Oct 30 '22 21:10

Astrogator


1 Answers

Unfortunately there is no nice way to do it. You could change the condition like this: ((IISMAJORVERSION >= "#5" AND IISMINORVERSION >= "#1") OR IISMAJORVERSION >= "#6") OR IISMAJORVERSION = "#10"

The problem is that you would have to update the condition with every new release of Windows.

Maybe you should consider migrating your setup projects to WIX, since setup projects are no longer supported by Microsoft. Using WIX you can implement a custom action to programatically check for the required version of IIS, reading it from the registry and casting it to an integer before comparing.

like image 58
Martín Misol Avatar answered Nov 29 '22 11:11

Martín Misol