Wix user interface for installing SQL database

This is my first wix project. I downloaded wix 3.6 rc. My installation project includes 2 wcf projects and 1 silverlight. Everything works fine with the default Wix user interface. But now I need to add sql database to it. It works fine with default values ​​as below:

<Component Id='SqlComponent' Guid='8B72C159-1477-4A58-AFAE-E94D756BFFA6'> <CreateFolder/> <sql:SqlDatabase Id='SqlDatabase' Database='master' Server='.' CreateOnInstall='yes' DropOnUninstall='no' ContinueOnError='yes'> <sql:SqlScript Id='CreateTable' BinaryKey='CreateTable' ExecuteOnInstall='yes' /> <sql:SqlScript Id='CreateTable1' BinaryKey='CreateTable1' ExecuteOnInstall='yes' /> </sql:SqlDatabase> </Component> 

But I need to provide a user interface for the SQL database path, database name, username and password if no user and password are specified, then use a Windows user.

Just to learn how to add custom ui, I tried the following: but it displays the custom ui right away. But I want it to show specifically for installing the sql database.

 <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes"> <Text>Ready to Install</Text> </Control> <Control Id="Install" Type="PushButton" X="304" Y="243" Width="56" Height="17" Default="yes" Text="Install"> <Publish Event="EndDialog" Value="Return" /> </Control> 

I think, as soon as I get it to show the user interface exactly where I want, my next requirement will be able to get user input for the database path, name, user and password and pass this information to the script, I also don’t know , how to do it.

0
source share
2 answers

Finally, I found an article on wix here How to add a user interface

After a long struggle to understand how wix works, the above codeproject link helped me understand. A particularly important part explaining the creation of the user interface (MyWebUI.wxs in this article) is the life saver.

+2
source

Read the WiX UI extension in .chm format. Choose the set of dialogs that best suits your installer. Then you can configure it accordingly. Suppose you want to configure a set of WixUI_Advanced dialog boxes:

  • Download WiX Source Code
  • Browse to the source UI extension code located at src\ext\UIExtension\wixlib .
  • Copy and rename the * WixUI_Advanced.wxs * file to something else, for example * WixUI_Advanced_Custom.wxs *.
  • Open the .wxs file and be sure to rename the user interface identifier to <UI Id="WixUI_Advanced_Custom"> .
  • Add * WixUI_Advanced_Custom.wxs * to your installation project.

Now you can refer to your own dialog set in the same way as you would refer to other dialogs in the extension of the interface. But the user interface is not completely configured, it just provides the same functions as the WixUI_Advanced settings set. To add a new dialog box, you need to create a new .wxs using the wix source as an example. Take a look at any of the dialogs in src\ext\UIExtension\wixlib for reference. Then specify your dialog box in * WixUI_Advanced_Custom.wxs *, adding and modifying <Publish> elements to determine when your dialog box is displayed.

+3
source

All Articles