如何使用wix在子文件夹中创建2个文件夹
How to create 2 folders inside a subfolder using wix
刚开始接受 WIX,我正在尝试为我的 c# wpf 应用程序创建一个安装程序。
我想在我在 programdata 文件夹中创建的子文件夹中创建 2 个文件夹。
以下代码只会创建 1 个文件夹 'data' 而不会 'log'。
请问我做错了什么?
谢谢
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="EmptyFolderExample" Language="1033" Version="1.0.0.0" Manufacturer="WixExamples" UpgradeCode="b9f6f617-7d4c-4b9a-a165-24bd869ce1e9">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes" />
<Feature Id="ProductFeature" Title="EmptyFolderExample" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="CommonAppDataFolder">
<Directory Id="INSTALLFOLDER" Name="InformedWorker">
<Directory Id="EmptyDataFolderDir" Name="Data" />
<Directory Id="EmptyLogFolderDir" Name="Log" />
</Directory>
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="EmptyDataFolderDir">
<Component Id="CMP_MyEmptyDataDir"
Guid="85DAD4AE-6404-4A40-B713-43538091B9D3"
KeyPath="yes">
<CreateFolder />
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents2" Directory="EmptyLogFolderDir">
<Component Id="CMP_MyEmptyLogDir"
Guid="a4594ec9-3101-4627-8ee7-d60d0a9b1f63"
KeyPath="yes">
<CreateFolder />
</Component>
</ComponentGroup>
</Fragment>
您需要添加一个带有 Directory="EmptyLogFolderDir" 的组件,就像您对数据所做的那样。
刚开始接受 WIX,我正在尝试为我的 c# wpf 应用程序创建一个安装程序。
我想在我在 programdata 文件夹中创建的子文件夹中创建 2 个文件夹。
以下代码只会创建 1 个文件夹 'data' 而不会 'log'。
请问我做错了什么?
谢谢
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="EmptyFolderExample" Language="1033" Version="1.0.0.0" Manufacturer="WixExamples" UpgradeCode="b9f6f617-7d4c-4b9a-a165-24bd869ce1e9">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes" />
<Feature Id="ProductFeature" Title="EmptyFolderExample" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="CommonAppDataFolder">
<Directory Id="INSTALLFOLDER" Name="InformedWorker">
<Directory Id="EmptyDataFolderDir" Name="Data" />
<Directory Id="EmptyLogFolderDir" Name="Log" />
</Directory>
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="EmptyDataFolderDir">
<Component Id="CMP_MyEmptyDataDir"
Guid="85DAD4AE-6404-4A40-B713-43538091B9D3"
KeyPath="yes">
<CreateFolder />
</Component>
</ComponentGroup>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents2" Directory="EmptyLogFolderDir">
<Component Id="CMP_MyEmptyLogDir"
Guid="a4594ec9-3101-4627-8ee7-d60d0a9b1f63"
KeyPath="yes">
<CreateFolder />
</Component>
</ComponentGroup>
</Fragment>
您需要添加一个带有 Directory="EmptyLogFolderDir" 的组件,就像您对数据所做的那样。