Update app.config from WIX setup?

后端 未结 1 1226
闹比i
闹比i 2020-12-19 13:46

I am trying Wix 3.6 and this is how it looks right now :


&         


        
相关标签:
1条回答
  • 2020-12-19 14:13

    You could add in a reference to the WixUtilExtension.dll to the installer project, then use XmlFile to update the app.config like:

    <Property Id="SERVICEADDRESS" Value="http://serviceaddress"/>
    
    <util:XmlFile Id="UpdateBaseAddress" 
      Action="setValue" 
      File="[DirApplication]$(var.app.config)"
      SelectionLanguage="XPath" 
      Permanent="yes"
      ElementPath="/configuration/applicationSettings/...."
      Name="baseAddress" Value="[SERVICEADDRESS]" />
    

    Note that you'll need to set the directory and the name of the .config file (you could just use $(var.ProjectName.TargetFileName).config which should work it out for you automatically

    0 讨论(0)
提交回复
热议问题