我使用wix创建了一个安装程序。默认情况下,该应用程序会安装在Program Files文件夹下。我需要在c:目录下创建一个文件夹,并将我的应用程序安装在其中。
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="WINDOWSVOLUME" >
<Directory Id="INSTALLLOCATION" Name="WIXDemoApp">
</Directory>
</Directory>
</Directory>
<SetDirectory Id="WINDOWSVOLUME" Value="c"/>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
<Component Id="MyApplication.exe">
<File Source="$(var.MyApplication.TargetPath)" Name="MyApp.exe" Id="MYAPPEXE" KeyPath="yes" />
<!-- TODO: Insert files, registry keys, and other resources here. -->
</Component>
</ComponentGroup>
</Fragment>
我遇到了以下错误 "
error LGHT0094: 在片段 'Fragment' 中未解析符号 'Directory:INSTALLFOLDER'
"。
更新:
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="WindowsVolume" >
<Directory Id="INSTALLLOCATION" Name="WIXDemoApp">
</Directory>
</Directory>
</Directory>
<SetDirectory Id="WindowsVolume" Value="c"/>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLLOCATION">
<!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
<Component Id="MyApplication.exe">
<File Source="$(var.MyApplication.TargetPath)" Name="MyApp.exe" Id="MYAPPEXE" KeyPath="yes" />
<!-- TODO: Insert files, registry keys, and other resources here. -->
</Component>
</ComponentGroup>
</Fragment>
这给我带来了另一个错误"error LGHT0204: ICE99: 目录名称:WindowsVolume与MSI公共属性之一相同,可能会导致意想不到的副作用。
"。我在Google上搜索并参考了这个和这个来解决问题。但对我来说没有用,仍然出现相同的错误:"error LGHT0204: ICE99: 目录名称:WindowsVolume与MSI公共属性之一相同,可能会导致意想不到的副作用。"。有什么想法是什么问题呢?