Question

I've writen a Custom Action in WiX 3.7 and now when i want to connect to a Database (Firebird) somewhere it just returns out of the function, i've debugged now for more then an hour, but could not figure it out where exactly the problem is

Database db;
        try
        {
            db = new Database(@"C:\Cedex2\DB\CEDEX.FDB", DatabaseOpenMode.Transact);
            Debuging.Log("step0");
        }
        catch (Exception ex)
        {
            Debuging.Log(ex.Message);
        }
        try
        {
            string sqlScript = "";
            Debuging.Log("step1");
            using (StreamReader reader = new StreamReader(@"C:\Cedex2\DB\script1.sql"))
            {
                try
                {
                    sqlScript = reader.ReadToEnd();
                }
                catch (Exception ex)
                {
                    Debuging.Log(ex.Message);
                }
            }
            Debuging.Log(sqlScript);
            db.Execute(sqlScript);
            Debuging.Log("step2");
            db.Close();
            Debuging.Log("closed");
        }
        catch (Exception ex)
        {
            Debuging.Log(ex.Message);
        }

The script exists and the DB-File too. Something have to happen before logging("step0"), because this won't end up in my loging-file. if i manually throw an exception before new Database() it will go in the catch and log. What could be wrong? if it would be a compiler-error, why it doesnt end up in my catch?

The Database-File has also no new Windows-Lastmodified date after running through the Custom Action

Was it helpful?

Solution

What is the fully qualified namespace of your "Database" class? Are you trying to use Microsoft.Deployment.WindowsInstaller.Database to open a Firebird database? If so, that class only opens Windows Installer databases. ( I suspect you are. )

Take a look at:

Firebird: .NET — Examples of use

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top