使用 Wix 安装 Web 应用程序

发布于 2024-09-18 14:30:02 字数 1324 浏览 2 评论 0原文

所以我正在尝试安装一个网络应用程序,我偶然发现了这个问题: 使用WiX创建IIS虚拟目录。当我尝试将其调整为我自己的应用程序时,出现错误:

W:\projectlocation\IssInstallationComponents.wxs(6,0):错误 LGHT0204:ICE18:组件的 KeyPath:“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。我还将产品名称更改为“Product”以避免任何类型的 IP 问题。

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

So I'm trying to install a web application and I stumbled upon this question: Using WiX to create an IIS virtual directory. When I try to adapt this for my own app, I get an error:


W:\projectlocation\IssInstallationComponents.wxs(6,0): error LGHT0204: ICE18: KeyPath for Component: 'SiteInstallationComponent' is Directory: 'WEBDIRECTORY'. The Directory/Component pair must be listed in the CreateFolders table.

I'm stuck trying to figure this out. Here's what I have in the affected file:

<?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>

A couple of notes on my example. First, I know that the GUID is wrong, I removed it from the sample above so that it doesn't get indexed by google and reused by someone looking to figure out something similar. In my code, I have a correct GUID. I also changed the product name to "Product" to avoid any kind of IP issues.

Any ideas on what I need to do to get this code working?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

烈酒灼喉 2024-09-25 14:30:02

叹气

好吧,我在互联网上挖掘并发现了以下线程:http://www.mail-archive.com/[电子邮件受保护]/msg03 483.html< /a>

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

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

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

sigh

Okay, I went digging through the interwebs and found the following thread: http://www.mail-archive.com/[email protected]/msg03483.html

Basically I need to change my component so that it looks like this:

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

I love Wix, but sometimes it drives me crazy.

动次打次papapa 2024-09-25 14:30:02

我想我要补充一点。就我而言,我需要使用 XmlConfig 操作修改配置文件作为补丁的一部分。我遇到了最初的问题,并尝试通过在其中粘贴 CreateFolder 元素来解决它。但这有一个问题。如果您的组件是补丁的一部分,则在其中放置一个 CreateFolder 条目会使其 不可卸载。这意味着您无法回滚补丁。

我最终做的是为组件创建一个不同的 KeyPath 。我给了它一个注册表项作为 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 是我们传递给安装程序的两个属性)

Thought I'd add a bit to this. In my case I needed to modify a config file as part of a patch with an XmlConfig action. I ran into the original problem and also tried to work around it by just sticking a CreateFolder element in there. But there's a hitch with that. If your component is part of a patch, putting a CreateFolder entry in there makes it not uninstallable. That means you can't roll back the patch.

What I ended up doing was creating a different KeyPath for the component. I gave it a registry key as the KeyPath and it stopped bothering me about the CreateFolder entry. This means that it will do whatever you want it to do on install and uninstall and use the registry key you gave it to track whether or not the component is installed.

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

(In this case REGISTRYKEY and TITLE are two properties we passed into the installer)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文