Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iis 使用Wix安装web应用程序_Iis_Wix - Fatal编程技术网

Iis 使用Wix安装web应用程序

Iis 使用Wix安装web应用程序,iis,wix,Iis,Wix,因此,我试图安装一个web应用程序,我偶然发现了这个问题:。当我尝试将其应用于我自己的应用程序时,我得到一个错误: W:\projectlocation\IsInstallationComponents.wxs(6,0):错误LGHT0204:ICE18:组件的键路径:“SiteInstallationComponent”是目录:“WEBDIRECTORY”。目录/组件对必须列在CreateFolders表中。 我一直想弄清楚这件事。以下是受影响文件中的内容: <?xml version

因此,我试图安装一个web应用程序,我偶然发现了这个问题:。当我尝试将其应用于我自己的应用程序时,我得到一个错误: W:\projectlocation\IsInstallationComponents.wxs(6,0):错误LGHT0204:ICE18:组件的键路径:“SiteInstallationComponent”是目录:“WEBDIRECTORY”。目录/组件对必须列在CreateFolders表中。

我一直想弄清楚这件事。以下是受影响文件中的内容:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension">
  <Fragment>
    <DirectoryRef Id="WEBDIRECTORY">
      <Component Id="SiteInstallationComponent" Guid="MY GUID">
          <iis:WebVirtualDir Id="ProductVirtualDirectory" Alias="[PRODUCTVERSION]" Directory="WEBDIRECTORY" WebSite="DefaultWebSite"/>
      </Component>
    </DirectoryRef>

    <iis:WebSite Id='DefaultWebSite' Description='Default Web Site' Directory='WEBDIRECTORY'>
      <iis:WebAddress Id="AllUnassigned" Port="80" />
    </iis:WebSite>
  </Fragment>
</Wix>

关于我的例子的几个注释。首先,我知道GUID是错误的,我从上面的示例中删除了它,这样它就不会被google索引,也不会被那些想找出类似东西的人重用。在我的代码中,我有一个正确的GUID。我还将产品名称改为“产品”,以避免任何类型的IP问题

关于我需要做什么才能让代码正常工作,有什么想法吗?

叹气

好的,我在互联网络中找到了以下线索:

基本上,我需要更改我的组件,使其看起来像这样:

  <Component Id="SiteInstallationComponent" Guid="MY GUID">
      <CreateFolder />
      <iis:WebVirtualDir Id="ProductVirtualDirectory" Alias="[PRODUCTVERSION]" Directory="WEBDIRECTORY" WebSite="DefaultWebSite"/>
  </Component>


我喜欢Wix,但有时它会让我发疯。

我想我应该再加一点。在我的例子中,我需要修改一个配置文件,作为带有XmlConfig操作的补丁的一部分。我遇到了最初的问题,并试图通过在其中粘贴CreateFolder元素来解决它。但这有个问题。如果您的组件是修补程序的一部分,则将CreateFolder条目放入修补程序中会使其生效。这意味着你不能回滚补丁

我最终做的是为组件创建一个不同的组件。我给了它一个注册表项作为KeyPath,它就不再为CreateFolder条目困扰我了。这意味着在安装和卸载时,它将执行您希望它执行的任何操作,并使用您提供给它的注册表项跟踪组件是否已安装

<RegistryKey Root="HKLM" Key="[REGISTRYKEY]\Settings\[TITLE]" Action="createAndRemoveOnUninstall">
  <RegistryValue Action="write" Type="integer" Name="MACHINEMEMORYLIMIT" Value="1" KeyPath="yes"/>
</RegistryKey>


(在本例中,REGISTRYKEY和TITLE是我们传递给安装程序的两个属性)

请注意,Guid值:
Guid=“PUT-Guid-HERE”
是有效的,特别是对于示例