IISMAJORVERSION and IISMINORVERSION are set despite IIS being removed

不羁的心 提交于 2019-12-12 21:01:30

问题


I'm creating an installer that has a dependency on IIS being installed. To test I'm using a virtual machine running Windows Server 2008 R2 which has the web server role installed.

My installer checks whether IIS is installed using this conditional;

<PropertyRef Id="IISMAJORVERSION" />
<PropertyRef Id="IISMINORVERSION" />
<Condition Message="Install requires IIS version 7.5 or later">
  <![CDATA[Installed OR (IISMAJORVERSION AND ((IISMAJORVERSION = "#7" AND IISMINORVERSION >= "#5") OR IISMAJORVERSION > "#7"))]]>
</Condition>

The installer runs as expected, however, I also wanted to test the condition by removing IIS and making sure the installer displayed the condition message.

I removed IIS by going into the Server Manager console and deleting the Web Server role (in its entirety).

When I rerun my installer and log at the installer log file the IISMAJORVERSION and IISMINORVERSION are still being set with the values #7 and #5 respectively despite IIS not being installed any more.

AppSearch: Property: IISMAJORVERSION, Signature: IIsMajorVersionSearch
MSI (c) (88:F4) [14:25:16:687]: Note: 1: 2262 2: Signature 3: -2147287038 
MSI (c) (88:F4) [14:25:16:687]: PROPERTY CHANGE: Adding IISMAJORVERSION property. Its value is '#7'.
AppSearch: Property: IISMINORVERSION, Signature: IIsMinorVersionSearch
MSI (c) (88:F4) [14:25:16:703]: Note: 1: 2262 2: Signature 3: -2147287038 
MSI (c) (88:F4) [14:25:16:703]: PROPERTY CHANGE: Adding IISMINORVERSION property. Its value is '#5'.

The installer has been built using WIX v3.10.3.3007.

Is the IIS uninstall not removing registry entries that it should, or is this a WIX issue?


Update 1

The WIX properties IISMAJORVERSION and IISMINORVERSION are populated based upon the values of the registry entries MajorVersion and MinorVersion in the folder HKLM\SOFTWARE\Microsoft\InetStp. When removing the Web Server role only two registry entries from this folder were actually removed (MetabaseSetMajorVersion and MetabaseSetMinorVersion). All the others remained including the two used by WIX.

The other registry entries in HKLM\SOFTWARE\Microsoft\InetStp were only removed once the Windows Process Activation Service was removed as well.

With this in mind I'm not sure using IISMAJORVERSION and IISMINORVERSION is always reliable as it's possible to get values back when there isn't a vlaid IIS installation.

来源:https://stackoverflow.com/questions/45691727/iismajorversion-and-iisminorversion-are-set-despite-iis-being-removed

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!