我在WIX基本设置配置上遇到了一些问题。 我想将我的文件安装到ProgramFiles / NameOfCompany / NameOfProduct中。 我现在有以下配置:
<?define ProductName="ProductName" ?>
<?define Manufacturer="CompanyName"?>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLLOCATION" Name="$(var.ProductName)">
<Component Id="ProductComponent" Guid="b11556a2-e066-4393-af5c-9c9210187eb2">
<File Id='SampleAppEXE' Name='SampleApp.exe' Source='ClipboardActiveX.dll' Vital='yes' />
</Component>
</Directory>
</Directory>
</Directory>
问题是当我尝试在INSTALLLOCATION目录条目中设置类似于folder1 / folder2的内容时出现以下错误:
The Directory/@Name attribute's value, 'folder1/folder2', is not a valid long name because it contains illegal characters. Legal long names contain no more than 260 characters and must contain at least one non-period character. Any character except for the follow may be used: \ ? | > < : / * ".
我想要这样的东西:
<?define ProductName="ProductName" ?>
<?define Manufacturer="CompanyName"?>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLLOCATION" Name="$(var.Manufacturer)\$(var.ProductName)">
<Component Id="ProductComponent" Guid="b11556a2-e066-4393-af5c-9c9210187eb2">
<File Id='SampleAppEXE' Name='SampleApp.exe' Source='ClipboardActiveX.dll' Vital='yes' />
</Component>
</Directory>
</Directory>
</Directory>
答案 0 :(得分:4)
必须对嵌套目录使用嵌套的Directory元素。像这样:
...
<Directory Id="ProgramFilesFolder">
<Directory Id="Manufacturer" Name="$(var.Manufacturer)">
<Directory Id="INSTALLLOCATION" Name="$(var.ProductName)">
...