WiX instaler: Read value from SQL

I'm new to WiX installer but I need to solve a situation. After searching for some time I haven't found any solution.

I need to read a value from SQL Server while running the WiX installer and keep it, but I'm not sure if it is possible. All I've found are 'updates' or 'insert' query examples, but no 'select'.

Has someone done something like this?


When you need to read something from somewhere during the installation process, you have several options:

Obviously, if you need to read something from SQL Server, custom action is the only choice for you. So, to tell it short, you should create an immediate custom action which will read the data you need and place it to the property (or a number of properties). You should use this property later in your installation.

Try to avoid custom actions as much as you can, but if you have no other choice, still try to find the tested ones. For this particular case, take a look at the Community MSI extensions.

Although you might solve this particular problem fast, I would still encourage you to dive deeper into the topic and understand how Windows Installer (the underlying technology behind WiX Toolset) works. Start from MSDN.

You could use the registry extended stored procedures to insert the value you need into the registry and then do a Registry search to pull the values into your installer.

As the blog post says the sp's are undocumented and thus unsupported but if it works for you it will save writing a custom action.

Need Your Help

Android display image to gridView from URL with Picasso

java android image gridview picasso

I have a database with table image, i have atribut id_image(int), image_name(string)

How to assign the x-axis position of a node in a Sankey Diagram (D3) from the json file

javascript json d3.js sankey-diagram

I finally found a Sankey Diagram in D3 that allows movement of the nodes across the x-axis, but I would like to assign a value from the json file to fix the position in particular places.