【问题标题】:WIX- support multiple Instance of Web App on IISWIX- 支持 IIS 上的多个 Web App 实例
【发布时间】:2016-04-05 07:40:09
【问题描述】:

我正在使用 wix 创建我的 msi 安装程序。安装程序将在 IIS 中创建一个新的应用程序池和虚拟目录来运行我的 Web 应用程序。

现在,我正试图在同一台机器上同时拥有多个网络应用实例(相同版本或更高版本)。

-Wix 支持这种东西吗?

-我可以在每次安装时动态创建多个应用程序池和虚拟目录吗?因为目前 appPool 的名称、虚拟目录和目标文件夹都硬编码在 Product.WXS 文件中。

【问题讨论】:

    标签: wix wix3.7 windows-installer wix3.8


    【解决方案1】:

    我认为您甚至无法多次执行安装,它只会尝试卸载、修改或修复您以前的安装或执行升级。 但是关于应用程序池或网站名称,您可以在安装过程中在功能选择对话框中指定它,以便有文本框,您可以在其中写下网站或应用程序池的名称

    <Control Id="WebsiteName" Type="Text" X="..." Y="..." Width="..." Height="..."  Text="Website name :" Indirect="no" >
          <Condition Action="hide">Installed</Condition>
        </Control>
        <Control Id="WebsiteName" Type="Edit" X="..." Y="..." Width="..." Height="..." Property="WEBSITENAME" Text="{50}" Indirect="no" >
          <Condition Action="hide">Installed</Condition>
    </Control> 
    

    您需要在 Product.wxs 中指定您的属性

    <Property Id="WEBSITENAME" Value="YourDefaultWebSiteName" Secure="yes">
      <RegistrySearch Id="FindWebSiteName" Root="HKCU"
                      Key="SOFTWARE\YourCompany\YourProduct"
                      Name="WebsiteName" Type="raw"/>
    </Property>
    <Property Id="APPPOOL" Value="0" Secure="yes">
      <RegistrySearch Id="FindWixSetupInstallation" Root="HKCU"
                      Key="SOFTWARE\YourCompany\YourProduct"
                      Name="webAppPool" Type="raw"/>
    </Property>
    

    您需要在创建应用程序池和网站名称的设置中指定它

    <iis:WebSite Id="DefaultWebSite" Description="Default Web Site">
      <iis:WebAddress Id="AllUnassigned" Port="80" />
    </iis:WebSite>
    <DirectoryRef Id="YourDirectory" >
      <Component Id="CMP_CONFIG" Guid="{YOURGUID}" KeyPath="yes">
        <iis:WebVirtualDir Id="WebsiteName" Alias="[WEBSITENAME]" Directory="YourDirectory" WebSite="DefaultWebSite">
          <iis:WebApplication Id="YourApplicationApp" Name="[WEBSITENAME]" WebAppPool="[WEBSITENAME]" />
          <iis:WebDirProperties Id="YourApplicationDirProp" Script="yes" Execute="yes" Read ="yes" DefaultDocuments="Default.aspx"/>
        </iis:WebVirtualDir>
      </Component>
    </DirectoryRef>
    

    如果你想创建桌面快捷方式

     <DirectoryRef Id="DesktopFolder">
          <Component Id="YourWebsiteAppDesktopShortcut" Guid="{YOURGUID}">       
            <RegistryValue Root="HKCU"
                          Key="SOFTWARE\YourCompany\YourProduct"
                          Name="YourWebsiteApp"
                          Type="integer"
                          Value="1"
                          KeyPath="yes"/>
    
            <util:InternetShortcut Id="WebSiteDesktopShortcut"
                                   Directory="DesktopFolder"  
                                   Name="YourWebsiteAppName" 
                                   Target="http://localhost/[WEBSITENAME]/" 
                                   Type="url" />
            </Component>
        </DirectoryRef>
    

    您只需要在您的 Product.wxs 中注册所有这些组件引用 ID

    【讨论】:

    • 如果每个安装包都有新的 GUID,您可以拥有应用的多个实例。
    • 缺少设置 WebsiteName 和 webAppPoll?
    猜你喜欢
    • 1970-01-01
    • 2017-11-25
    • 2015-01-14
    • 2012-04-14
    • 1970-01-01
    • 2010-09-14
    • 2016-03-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多