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 config 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 can add custom dialogs to the UI sequence in a built-in WixUI dialog set. To do so, you must define a <UI/> element for your new dialog. Then, you must copy the contents of the <Fragment/> that includes the definition of the dialog set that you want to customize from the WiX source code to your project.
WiX was the first Microsoft project to be released under an open-source license, the Common Public License. Initially hosted on SourceForge, it was also the first Microsoft project to be hosted externally.
You'll need to do three things:
Create a custom property:
<Wix>
<Product ...>
<Property Id="SQLSERVER" /> ...
</Product>
</Wix>
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.
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="ConnectionString"[\]]/@connectionString" Value="[SQLSERVER]" Permanent="yes" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With