I have an MSI installer for my product which needs the MSOLEDBSQL driver to run. I am trying to include the driver installation as part of the main installer and not as a pre-requisite (which is how it was being handled till now).
Following is the code I have written to install the driver within my main installer's code :
public static void InstallSQLDriver()
{
Logger.LogInfo("Installing the MSOLEDBSQL Driver");
ProcessStartInfo startInfo = new ProcessStartInfo("msiexec.exe", $"/i msoledbsql.msi /quiet IAcceptMSOLEDBSQLLicenseTerms=YES /qn ACCEPTEULA=1 /norestart ALLUSERS=1");
startInfo.Verb = "runas";
startInfo.UseShellExecute = true;
try
{
Process proc = Process.Start(startInfo);
proc.WaitForExit();
if (proc.ExitCode == 0)
{
Logger.LogInfo("MSOLEDBSQL Driver Installation successful");
}
else
{
Logger.LogInfo("MSOLEDBSQL Driver Installation failed. Process ended with code : " + proc.ExitCode);
}
}
catch (Exception ex)
{
Logger.LogInfo("MSOLEDBSQL Driver Installation failed with error : " + ex.Message);
}
}
However, running this gets me an error with exit code 1618 in my log saying : Another installation is already in progress. Complete that installation before proceeding with this install.
I know that we can't run 2 MSIs concurrently, but are there any changes we can make to do what I am trying to do. Does anyone know how to avoid using a pre-requisite installation before I can start my main application's installer?