2017-12-15 27 views
0

우리 응용 프로그램 IISversion> = 10을 설치하지 않는 wix 설치 프로그램에서이 문제가 있습니다. IISVersion에서 작동합니다. < 10.시작 조건, 사용자 지정 작업 및 속성

이 링크는 github에서 발견되었습니다. https://github.com/wixtoolset/issues/issues/5276 이 링크는 IISRegistryversion이> = IISRequiredVersion 인 경우 ActionResult.Success를 반환하는 사용자 지정 액션을 추가 할 것을 제안합니다. 하지만 다음과 같은 오류가 발생합니다. 이 오류가 로그에서 발생한 후 작업 수행 : LaunchConditions

작업 시작 12:46:02 : LaunchConditions. 변수가 설정되지 않았거나 사용자 지정 작업이 호출되지 않습니다. 사용자 지정 작업에 일부 로깅을 설정했지만 자세한 정보를 기록하더라도 아무 것도 로깅하지 않습니다.

이 조건을 평가하기 전에 실행 조건/사용자 지정 동작이 호출되고 있는지 확인하려면 어떻게해야합니까? 누구든지 제발 제안 할 수 있을까요? Product.wxs 그것은 조건없이 작동

<InstallExecuteSequence> 
    <Custom Action="CA.DS.CreateScriptDirCommand" Before="InstallFinalize"> 
     <![CDATA[NOT Installed AND (&Feature.DatabaseServer.Database = 3)]]> 
    </Custom> 
    <Custom Action="Iis.CheckInstalledVersion.SetProperty" Before="LaunchConditions" > 
     <![CDATA[NOT Installed AND &Feature.WebServer.WebServices = 3]]> 
    </Custom> 
    <Custom Action="Iis.CheckInstalledVersion" After="Iis.CheckInstalledVersion.SetProperty" > 
     <![CDATA[NOT Installed AND &Feature.WebServer.WebServices = 3]]> 
    </Custom> 
</InstallExecuteSequence> 
<Condition Message="This application requires IIS [Iis.RequiredVersion] or higher. Please run this installer again on a server with the correct IIS version."> 
    <![CDATA[Iis.IsRequiredVersion > 0]]> 
</Condition> 


<Fragment> 
    <CustomAction Id='Iis.CheckInstalledVersion.SetProperty' Property='Iis.CheckInstalledVersion' Execute='immediate' Value='' /> 
    <!--Note: Changed "Execute" from "deferred" to "immediate", to avoid error "LGHT0204: ICE77: Iis.CheckInstalledVersion is a in-script custom action. It must be sequenced in between the InstallInitialize action and the InstallFinalize action in the InstallExecuteSequence table"--> 
    <!--Note: Changed "Impersonate" from "no" to "yes", to avoid warning "LGHT1076: ICE68: Even though custom action 'Iis.CheckInstalledVersion' is marked to be elevated (with attribute msidbCustomActionTypeNoImpersonate), it will not be run with elevated privileges because it's not deferred (with attribute msidbCustomActionTypeInScript)"--> 
    <CustomAction Id='Iis.CheckInstalledVersion' BinaryKey='B.WixCA' DllEntry='CheckInstalledIISVersion' Execute='immediate' Return='check' Impersonate='yes' /> 
    <Component 
</Component> 
</Fragment> 


    [CustomAction] 
    public static ActionResult CheckInstalledIISVersion(Session session) 
    { 
     try 
     { 
      session.Log("* Starting to check installed IIS version"); 
      const int IisRequiredVersion = 7; 

      string IISMajorVersionFromRegistry = session["IISMAJORVERSION"]; 
      session.Log(string.Format("*!*! DEBUG; CheckInstalledIisVersion; IIS major version: {0}", IISMajorVersionFromRegistry)); 
      string iisMajorVersionNumeric = IISMajorVersionFromRegistry.Replace("#", string.Empty); 
      int iisMajorVersion = int.Parse(iisMajorVersionNumeric, CultureInfo.InvariantCulture); 

      bool isRequiredVersion = iisMajorVersion >= IisRequiredVersion; 

      // Setting the required version as a custom property, so that it can be used in the condition message 
      session["IIs.RequiredVersion"] = IisRequiredVersion.ToString(CultureInfo.InvariantCulture); 
      // Setting the results of the check as "bool" 
      session["Iis.IsRequiredVersion"] = isRequiredVersion ? "1" : "0"; 

      return ActionResult.Success; 
     } 
     catch (Exception ex) 
     { 
      session.Log(string.Format("CheckInstalledIisVersion; Error occured SC: {0}", ex.Message)); 
      return ActionResult.Failure; 
     } 
    } 

을 보는 방법

enter image description here

이입니다. 조건은 실행되기 전에 실행됩니다

답변

1

"설치 대상"상태가 원가 계산 후 (종종 기능에서 기능을 선택하기 전까지) 설정되지 않기 때문에 Feature.WebServer.WebServices = 3 기능 검사가 작동하지 않습니다 대화 상자). 따라서 CA는 호출되지 않습니다.

아마도이 점을 재고하고 CostFinalize 이후에 IIS에 대한 검사를 강제로 수행 한 다음 IIS가 설치/실행되지 않는다는 경고를해야합니다. 따라서 IIS를 검색하여 무조건 속성을 설정하고 사용하지 않아야합니다 그것은 발사 조건으로. & Feature.WebServer.WebServices = 3이고 IIS 버전이 너무 낮 으면 경고를 보냅니다.

는 기능 동작 조건 문서와 CostFinalize에 대한 참조를 참조하십시오 :

https://msdn.microsoft.com/en-us/library/windows/desktop/aa368012(v=vs.85).aspx

+0

재미를!. 고맙습니다. – user575219

+0

세션 [ "Iis.IsRequiredVersion"] = isRequiredVersion? "1": "0"; 조건이 & Feature.WebServer.WebServices = 3이고 Iis.IsRequiredVersion> '0'인 경우 Iis.IsRequiredVersion은 '1'또는 '0'일 수 있기 때문에? & Feature.WebServer.WebServices = 3 AND Iis.IsRequiredVersion> 0이어야합니까? – user575219