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.