如何使用WixToolset v3.11修改json

时间:2017-09-21 12:11:50

标签: .net json wpf wix windows-installer

我想修改现有json文件中的值。

当我运行安装程序时,我输入指向我的API的服务器名称。 输入服务器名称后,我想在应用设置json文件中添加该值。

enter image description here

enter image description here

enter image description here

2 个答案:

答案 0 :(得分:1)

<强>(溶液)

http://dotnetbyexample.blogspot.ro/2010/11/wix-configurable-search-replace-custom.html

您需要创建一个wix项目(Custom Action Class Library)创建逻辑, 之后,你需要在Product.wxs(安装程序项目)中使用dll,就像在示例中一样。

祝你好运!

PS:如果你想从文件中更改一个属性,你应该有这样的东西:

enter image description here

答案 1 :(得分:0)

WixJsonExtension是WiX扩展,它提供了在安装过程中修改JSON文件的方法。 awk '{for(i=NF-8;i<=NF;i++){print $i}}' input.file 元素的工作原理与JsonFile元素非常相似。