开发者

wix custom dialog for config edit

hi i'm trying make a setup msi for my application with wix v3 I have a problem about this task; I need a user input that will be stored in my application's confi开发者_开发知识库g file (for example i need a dialog for sql connection string and the user input will be written in application config file.)

I tried to google but got nothing worked

Any help is greatly appreciated.


You'll need to do three things:

  1. Create a custom property:

    <Wix>
     <Product ...>
       <Property Id="SQLSERVER" /> ... 
     </Product>
    </Wix>
    
  2. Add a custom dialog to your Wix UI to capture the user input and store it to a property. This tutorial should help you with that.

  3. In the component that installs your web.config file, use the XmlFile element to update your web.config with the value of your property:

     <util:XmlFile Id="UpdateConnectionStringInConfigSection" File="[ROOT_DRIVE]inetpub/wwwroot/$(var.ProductName)/web.config" Action="setValue" ElementPath="/configuration/connectionStrings/add[\[]@name=&quot;ConnectionString&quot;[\]]/@connectionString" Value="[SQLSERVER]" Permanent="yes" />
    
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜