是否可以在 WIX 中有两个根目录 [英] Is it possible to have two root directories in WIX

查看:20
本文介绍了是否可以在 WIX 中有两个根目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在 C 和 D 驱动器中部署文件.例如,文件 A 转到驱动器 C,文件 B 转到驱动器 D.我知道 Wix 只允许您拥有一个根目录.有什么办法可以做到吗?

I need to deploy files in both C and D drives. For example File A goes to drive C and File B goes to drive D. I know that Wix allows you to have only one root directory. Is there any way I can accomplish this?

我知道一种解决方案是在 Wix Xml 中将 C 设置为根目录,并通过 Wix Xml 部署进入 C 目录的文件.必须部署到 D 目录的文件必须通过自定义操作进行部署.

I know that one solution is to set C as the root directory in the Wix Xml and deploy files that go to C directory through the Wix Xml. The files that have to deployed to D directory then have to be deployed through a custom action.

但是我想避免使用自定义操作,并希望使用相同的 Wix Xml 将文件部署到(C 和 D 驱动器).

However I want to avoid using Custom Actions and want to deploy files to both (C and D drives) using the same Wix Xml.

推荐答案

整个目录结构应始终包装到TARGETDIR"根目录中.但是没有人会限制您以您需要的方式定义其下的其余结构.请参阅下面的示例:

The entire directory structure should always be wrapped into "TARGETDIR" root. But nobody limits you to define the rest of the structure under it the way you need. See the sample below:

  <Directory Id="TARGETDIR" Name="SourceDir">
     <Directory Id="INSTALLLOCATION" Name="My location">
     ...
     </Directory>
     <Directory Id="DATA_FOLDER" Name="Data">
     ...
     </Directory>
     <Directory Id="DATABASES_FOLDER">
     ...
     <Directory>
  </Directory>

现在您可以将 DATA_FOLDER 或 DATABASES_FOLDER 设置在与 INSTALLLOCATION 不同的驱动器上.对我来说效果很好.

Now you can set DATA_FOLDER or DATABASES_FOLDER to be on a different drive than INSTALLLOCATION. It works fine for me.

这篇关于是否可以在 WIX 中有两个根目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆