如何在wix中创建目录? [英] How to create a directory in wix?

查看:245
本文介绍了如何在wix中创建目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的要求是在 programdata/test/example 中创建目录.我该如何在wix中做到这一点?

My requirement is to create a directory in programdata/test/example. How can I do that in wix?

推荐答案

按如下所示定义文件夹:

Define the folder like this:

<Directory Id="TARGETDIR" Name="SourceDir">
    <Directory Id="CommonAppDataFolder">
        <Directory Id="TestFolder" Name="test">
            <Directory Id="ExampleFolder" Name="example" />
        </Directory>
    </Directory>
</Directory>

此处的重要部分是Windows安装程序已知的CommonAppDataFolder ID.您可以在 Windows Installer属性参考.

The important part here is the CommonAppDataFolder Id, which is known by Windows installer. You can find the full list of known system folders in the Windows Installer Property Reference.

如果将任何文件安装到该文件夹​​,则将隐式创建该文件.如果没有,您可以通过安装如下组件来强制创建它:

If you install any files to that folder, it will be created implicitly. If not, you can force it to be created by installing a component like this:

<Component Id="CreateTestFolder" Directory="ExampleFolder" Guid="PUT-RANDOM-GUID-HERE">
    <CreateFolder />
</Component>

这篇关于如何在wix中创建目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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