2012-04-11 57 views
1

我试图覆盖使用NSIS在我的应用程序config文件的现有价值。NSIS WriteIniStr

我想改变 '端点地址= “HTTP://DefaultWebService.asmx”'

为 '端点地址= “HTTP://MyWebService.asmx”'

我的配置文件看起来像这样:

<?xml version="1.0" encoding="utf-8"?> 
<configuration> 
<system.serviceModel> 
<client> 
    <endpoint address="http://DefaultWebService.asmx" 
    binding="customBinding" bindingConfiguration="MyServiceSoap12" 
    contract="WebServiceProxies.MyServiceSoap" name="MyServiceSoap12" /> 
</client> 
</system.serviceModel> 
</configuration> 

在我NSIS我使用:

WriteIniStr "$MyApp.exe.config" "system.serviceModel" "endpoint address" "endpoint address="http://MyWebService.asmx" 

但是这只是增加了

[system.serviceModel] 
endpoint address=http://MyWebService.asmx 

到.config文件的底部。

我哪里错了?

感谢

回答

2

的问题是,你使用WriteIniStr哪些更新.ini文件和application.config是一个XML文件。您需要使用诸如this插件之类的东西。