WIX 中的目录元素

发布于 2024-09-08 18:55:49 字数 678 浏览 1 评论 0原文

我需要对 *.wxs 文件中的目录结构进行一些澄清。据我所知,它将文件安装在我们在目录元素中指定的目录中。它还有其他用途吗?

如果它确实描述了将安装产品的目录结构,那么如果用户在安装程序中具有浏览选项,将会发生什么。

如果我不想在 .msm 文件中包含任何目录结构,我该怎么办?

http://schemas.microsoft.com/wix/2003/01/wi'>

      <Directory Id='TARGETDIR' Name='SourceDir'>
         <Directory Id='MyModuleDirectory' Name='.'>
            <Component Id='MyModuleComponent' Guid='87654321-4321-4321-4321-110987654321'>
               <File Id='readme2' Name='readme2.txt' src='readme2.txt' />
            </Component>
         </Directory>
      </Directory>
    </Module>
</Wix>

I need some clarification on the directory structure in *.wxs files. As far as i know it install the files in the directory that we have specified in the directory element. Does it have any other use?

If it does describe the directory structure where the product will be installed, than what will happen if the user has a browse option in the installer.

what will i have to do if i don't want any directory structure in my .msm file?

http://schemas.microsoft.com/wix/2003/01/wi'>

      <Directory Id='TARGETDIR' Name='SourceDir'>
         <Directory Id='MyModuleDirectory' Name='.'>
            <Component Id='MyModuleComponent' Guid='87654321-4321-4321-4321-110987654321'>
               <File Id='readme2' Name='readme2.txt' src='readme2.txt' />
            </Component>
         </Directory>
      </Directory>
    </Module>
</Wix>

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

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

发布评论

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

评论(1

望笑 2024-09-15 18:55:49

有几点:

1) 您的 MSM 中必须有一个目录,因为每个组件都必须属于一个目录。

2) 当您将模块合并到安装程序中时,您将模块目录关联/重定向为安装程序中目录的子目录。例如:

<!-- in your MSI .wxs -->
<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="ProgramFilesFolder">
    <Directory Id="CompanyFolder" Name="DeploymentEngineering">
      <Directory Id="INSTALLLOCATION" Name="Fireworks">
        <Merge Id="FireworksMM" SourceFile="..." DiskId="1" Language="1033">

这意味着 INSTALLLOCATION 将具有默认值:

[ProgramFilesFolder]DeploymentEngineering\Fireworks

由于模块的目录值为“.” INSTALLLOCATION 作为它的父目录,它也将具有默认值 [ProgramFilesFolder]DeploymentEngineering\Fireworks

如果用户点击浏览按钮并将 INSTALLLOCATION 的值更改为另一个目录,一切都会好起来,因为模块目录仍然是 INSTALLLOCATION 的子目录值为“.”。

有道理吗?

A couple of points:

1) You must have a directory in your MSM as every component must belong to a directory.

2) When you merge the module into your installer, you associate / redirect the modules directory to be a child of a directory in your installer. For example:

<!-- in your MSI .wxs -->
<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="ProgramFilesFolder">
    <Directory Id="CompanyFolder" Name="DeploymentEngineering">
      <Directory Id="INSTALLLOCATION" Name="Fireworks">
        <Merge Id="FireworksMM" SourceFile="..." DiskId="1" Language="1033">

This means INSTALLLOCATION will have a default value of:

[ProgramFilesFolder]DeploymentEngineering\Fireworks

Since the module's directory has a value of '.' and INSTALLLOCATION as it's parent, it will also have a default value of [ProgramFilesFolder]DeploymentEngineering\Fireworks

If a user hits the browse button and changes the value of INSTALLLOCATION to another directory all will be fine because the modules directory is still a child of INSTALLLOCATION with a value of '.'.

Make sense?

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