[wix-users] Update ActionText table in MSI DB using Immediate CA before LaunchConditions

Ven H venh.123 at gmail.com
Tue Jul 24 05:46:03 PDT 2018


I need to clear out the Description column values for some of the actions
from the ActionText table in the msi db. For this, I created an Immediate
CA to be triggered before Launch Conditions. I followed the links below to
do the update with the below code, but I am not able to get it working. I
keep getting the error, "Function failed during execution.".

https://stackoverflow.com/questions/27604823/updating-table-in-msi-file

https://stackoverflow.com/questions/19252620/how-to-change-productcode-using-microsoft-deployment-windowsinstaller

using (Database db = session.Database)
                {
                    if (db.Tables.Contains("ActionText"))
                    {
                        string actionName = "Name of the Builtin Action";
                            //db.Execute("UPDATE ActionText SET Description
= '' WHERE Action = '" + actionName+ "'"); // not working

                            string query = "SELECT * FROM ActionText WHERE
Action = '" + actionName + "'";
                            View view = db.OpenView(query);
                            view.Execute();
                            using (Record record = view.Fetch())
                            {
                                record.SetString("Description", " ");
                                view.Modify(ViewModifyMode.Assign, record);
//error here
                                db.Commit();
                                //view.Update(record); // this is also not
working
                                //view.Close();
                            }
                       }
                   }

Can anyone please help?


More information about the wix-users mailing list