配置文件上的 WiX 搜索和替换 [英] WiX Search and Replace on a configuration file
问题描述
我正在尝试使用 WiX 进行安装,我需要使用自定义 WiX 对话框的条目修改配置文件(不是 XML 或 INI).
I'm trying to make an install using WiX and I need to modify a configuration file (not XML or INI) with entries that a customized WiX dialog.
有什么好办法吗?我是否需要制作 VB 脚本自定义操作?
Is there a good way to do this? Do I need to make a VB script custom action, perhaps?
以下是 wxs 文件的相关部分:
Below is the relevant bits of the wxs file:
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLLOCATION" Name="MyApp">
<Component Id="ap_cfg" KeyPath="yes" Guid="...">
<File Id="CONFIGFILE" Source="myConfig.cfg" />
</Component>
</Directory>
</Directory>
</Directory>
推荐答案
Search & 没有构建替换 Wix 中的构造,您需要编写自定义操作.
我建议您不要使用 VBScript,而是使用 DTF 这将使您能够在 .net 中编写自定义操作并在 Visual Studio 下对其进行调试.
There is no build in Search & Replace construct in Wix, you will need to write a custom action.
I suggest that instead of using VBScript you will use DTF which will enable you to write the custom action in .net and debug it under Visual Studio.
这篇关于配置文件上的 WiX 搜索和替换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!