문제

Wix를 사용하여 ASP.NET 웹 사이트의 설치 프로그램을 만들고 있습니다. Wix를 사용하여 IIS에서 ASP.NET 버전을 어떻게 설정합니까?

도움이 되었습니까?

해결책

우리는 이것을 사용합니다 :

먼저 레지스트리에서 .NET Framework 루트 디렉토리를 결정합니다.

<Property Id="FRAMEWORKROOT">
  <RegistrySearch Id="FrameworkRootDir" Root="HKLM"
                Key="SOFTWARE\Microsoft\.NETFramework" 
                Type="directory" Name="InstallRoot" />
</Property>

그런 다음 웹 사이트를 IIS에 설치하는 구성 요소 내부에서

<!-- Create and configure the virtual directory and application. -->
<Component Id='WebVirtualDirComponent' Guid='{GUID}' Permanent='no'>
  <iis:WebVirtualDir Id='WebVirtualDir' Alias='YourAlias' Directory='InstallDir' WebSite='DefaultWebSite'  DirProperties='DirProperties'>
    <iis:WebApplication Id='WebApplication' Name='YourAppName' WebAppPool='AppPool'>
      <!-- Required to run the application under the .net 2.0 framework -->
      <iis:WebApplicationExtension Extension="config" CheckPath="yes" Script="yes"
                    Executable="[FRAMEWORKROOT]v2.0.50727\aspnet_isapi.dll" Verbs="GET,HEAD,POST" />
      <iis:WebApplicationExtension Extension="resx" CheckPath="yes" Script="yes"
                    Executable="[FRAMEWORKROOT]v2.0.50727\aspnet_isapi.dll" Verbs="GET,HEAD,POST" />
      <iis:WebApplicationExtension Extension="svc" CheckPath="no" Script="yes"
                    Executable="[FRAMEWORKROOT]v2.0.50727\aspnet_isapi.dll" Verbs="GET,HEAD,POST" />
    </iis:WebApplication>
  </iis:WebVirtualDir>
</Component>

X64 설치 프로그램의 경우 (이건 중요하다) 64 비트 기계의 32 비트 환경에는 다른 레지스트리 하이브 (및 다른 프레임 워크 루트)가 있기 때문에 Win64 = '예'추가.

<RegistrySearch Id="FrameworkRootDir" Root="HKLM"
        Key="SOFTWARE\Microsoft\.NETFramework" 
        Type="directory" 
        Name="InstallRoot" Win64='yes' />

다른 팁

다음은 씨름 한 후 저를 위해 일한 것입니다.

  <Property Id="FRAMEWORKBASEPATH">
     <RegistrySearch Id="FindFrameworkDir" Root="HKLM" Key="SOFTWARE\Microsoft\.NETFramework" Name="InstallRoot" Type="raw"/>
  </Property>
  <Property Id="ASPNETREGIIS" >
     <DirectorySearch Path="[FRAMEWORKBASEPATH]" Depth="4" Id="FindAspNetRegIis">
        <FileSearch Name="aspnet_regiis.exe" MinVersion="2.0.5"/>
     </DirectorySearch>
  </Property>

  <CustomAction Id="MakeWepApp20" Directory="TARGETDIR" ExeCommand="[ASPNETREGIIS] -norestart -s W3SVC/[WEBSITEID]/ROOT/[VIRTUALDIR]" Return="check"/>

  <InstallExecuteSequence>
     <Custom Action="MakeWepApp20" After="InstallFinalize">ASPNETREGIIS AND NOT Installed</Custom>
  </InstallExecuteSequence>

WebsiteId]와 [virtualdir]는 자신을 정의 해야하는 속성입니다. [VirtualDir]는 전체 웹 사이트가 아닌 응용 프로그램에 대한 ASP.NET 버전을 설정하는 경우에만 필요합니다.

사용자 정의 동작의 시퀀싱이 중요합니다. 설치하기 전에 실행하면 웹 애플리케이션을 사용할 수 없기 때문에 실패하게됩니다.

Chris Burrows 덕분에 ASPNET_REGIIS 실행 파일을 찾는 적절한 예 ( "연결 문자열을 보호하기 위해 Wix를 사용하여"Google).

JB

서버에서 ASP 2.0을 활성화하는 것을 잊지 마십시오

<iis:WebServiceExtension Id="ExtensionASP2" Group="ASP.NET v2.0.50727" Allow="yes" File="[NETFRAMEWORK20INSTALLROOTDIR]aspnet_isapi.dll" Description="ASP.NET v2.0.50727"/>

여기에 소프심이 있습니다

내 대답은 기본적으로 여기에서 볼 수있는 다른 사람들과 동일합니다. 나는 단지 사람들에게 또 다른 예를 제공하고 싶었습니다.

ASP.NET가 처리하는 파일 확장자 수와 각 버전의 목록이 변경되면 가장 신뢰할 수있는 솔루션은 실행하는 것입니다. aspnet_regiis 설치가 끝날 때. 그러나 이것은 롤백이나 제거에 대한 지원이 없다는 것을 의미합니다. IIS에서 새로운 응용 프로그램을 만들고 있습니다. Wix에 의해 삭제되기 때문에 실제로 중요하지 않습니다. 기존 응용 프로그램을 수정하는 경우 레지스트리에서 ASP.NET 버전이 구성된 버전을 확인하고 해당 버전의 실행을 실행할 수 있습니다. aspnet_regiis 변경 사항을 취소합니다.

다음은 Wix 3.5를 사용합니다.

<Fragment>
    <!-- Use the properties in Wix instead of doing your own registry search. -->
    <PropertyRef Id="IISMAJORVERSION"/>
    <PropertyRef Id="NETFRAMEWORK40FULL"/>
    <PropertyRef Id="NETFRAMEWORK40FULLINSTALLROOTDIR"/>

    <!-- The code I'm using is intended for IIS6 and above, and it needs .NET 4 to be
    installed. -->
    <Condition Message="This application requires the .NET Framework 4.0. Please install the required version of the .NET Framework, then run this installer again.">
        <![CDATA[Installed OR (NETFRAMEWORK40FULL)]]>
    </Condition>
    <Condition Message="This application requires Windows Server 2003 and Internet Information Services 6.0 or better.">
        <![CDATA[Installed OR (VersionNT >= 502)]]>
    </Condition>

    <!-- Populates the command line for CAQuietExec. IISWEBSITEID and IISVDIRNAME 
    could be set to default values, passed in by the user, or set in your installer's 
    UI. -->
    <CustomAction Id="ConfigureIis60AspNetCommand" Property="ConfigureIis60AspNet"
                  Execute="immediate"
                  Value="&quot;[NETFRAMEWORK40FULLINSTALLROOTDIR]aspnet_regiis.exe&quot; -norestart -s &quot;W3SVC/[IISWEBSITEID]/ROOT/[IISVDIRNAME]&quot;" />
    <CustomAction Id="ConfigureIis60AspNet" BinaryKey="WixCA" DllEntry="CAQuietExec" 
                  Execute="deferred" Return="check" Impersonate="no"/>
    <InstallExecuteSequence>
        <Custom Action="ConfigureIis60AspNetCommand" After="CostFinalize"/>

        <!-- Runs the aspnet_regiis command immediately after Wix configures IIS. 
        The condition shown here assumes you have a selectable feature in your 
        installer with the ID "WebAppFeature" that contains your web components. The 
        command will not be run if that feature is not being installed, or if IIS is 
        not version 6. It *will* run if the application is being repaired. 

        SKIPCONFIGUREIIS is a property defined by Wix that causes it to skip the IIS
        configuration. -->
        <Custom Action="ConfigureIis60AspNet" After="ConfigureIIs" Overridable="yes">
            <![CDATA[((&WebAppFeature = 3) OR (REINSTALL AND (!WebAppFeature = 3))) 
            AND (NOT SKIPCONFIGUREIIS) AND (IISMAJORVERSION = "#6")]]>
        </Custom>
    </InstallExecuteSequence>
    <UI>
        <ProgressText Action="ConfigureIis60AspNetCommand"
            >Configuring ASP.NET</ProgressText>
        <ProgressText Action="ConfigureIis60AspNet"
            >Configuring ASP.NET</ProgressText>
    </UI>

</Fragment>

이것은 조금 간단합니다. 이것이 기존 AppPool을 업데이트하는 데 작동하는지 모르겠지만 앱 풀을 만들고 .NET 버전을 설정하는 데 효과적입니다.

<iis:WebServiceExtension Id="AMS_AppPool" Name="AccountManagementSVC1" Identity="other"  ManagedPipelineMode="integrated" ManagedRuntimeVersion="v4.0" User="AMS_AppPoolUser" RecycleMinutes="120" />

Wix WebApplicationExtension을 사용하여 다른 방법을 찾았습니다. 전체 솔루션을 확인할 수 있습니다 여기 그리고 여기.

나는 지금까지 Wix를 좋아하지만, 사람은 당신이 찾고있는 것을 찾기 위해 많은 파기가 필요합니다.

  • 먼저 올바른 .NET 버전 폴더를 찾으십시오. DirectorySearch/Filesearch를 사용하여 검색을 수행하십시오.

  • 위의 경로를 사용하여 aspnet_regiis.exe를 호출하고 사용자 정의 작업에서 웹 애호가 버전을 설정하십시오.

    aspnet_regiis.exe -s W3SVC/1/ROOT/SampleApp1

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top