Question

I am creating a WIX installer, and in my Product.wxs file I am including SQLEXPR_x64_ENU.exe in the products install directory. I am calling the install command via a custom action like this:

<Property Id="SQLEXPRINSTANCENAME" Value="SQLEXPR" />
<CustomAction Id="SqlInstall"
              FileKey="SqlInstaller"
              ExeCommand="/Q /HIDECONSOLE /ACTION=Install /INSTANCENAME=&quot;[SQLEXPRINSTANCENAME]&quot; /IACCEPTSQLSERVERLICENSETERMS /FEATURES=SQLEngine  /TCPENABLED=1 /SQLSVCACCOUNT=&quot;NT AUTHORITY\Network Service&quot; /SQLSYSADMINACCOUNTS=&quot;Builtin\Administrators&quot; /BROWSERSVCSTARTUPTYPE=&quot;Automatic&quot; /AGTSVCACCOUNT=&quot;NT AUTHORITY\Network Service&quot; /SQLSVCSTARTUPTYPE=&quot;Automatic&quot;"
              Execute="immediate"
              Return="check"
              Impersonate="yes" />

and later in the execute sequence declaration I have:

<InstallExecuteSequence>
  <Custom Action="SchedXmlFile" After="InstallFiles">1=1</Custom>
  <Custom Action="SqlInstall" After="InstallFinalize">INSTALLSQLYN = "Yes"</Custom>
  <RemoveExistingProducts After="InstallInitialize" />
 </InstallExecuteSequence>

It runs the installer fine, but SQL Server Express will start to hang, and therefore hang the entire MSI.

If I take this command line and copy it to the command prompt the installation finishes.

The MSI verbose logging option does not indicate anything and there is no summary file for the SQL Server install Log.

So I am basically stuck not knowing why the installer gets stuck, and I have no idea what to do!

If somebody knows a simpler way of including the installer to an MSI let me know? Or if you can help me figure out why it fails? I did not bootstrap it (that works but doesn't allow me UI to question the user to install SQL or not, know how to conditionally run exepackage from a confirmation dialog in the bootstrapper?). I intend on chaining this MSI I am making into a bootstrapper for my products installer.

Était-ce utile?

La solution 2

What worked for me was running SQL Server Express 2008 R2 SP1 installer from C# immediate custom action within my own installer. The custom action started new process - that sql express installer executable with command line parameters. See example below. This worked on Windows Server 2008 and Win7. The problem here is that for Windows 8 \ Server 2012 you will need SQL Server Express 2008 R2 SP2 because SP1 throws "known compatibility issues" warnings. And in SP2 they changed the installer so that it hangs on ExecuteStandardTimingsWorkflow step. This is the major blocker for me at the moment.

            using (var myProcess = new Process
                {
                    StartInfo =
                        {
                            FileName = prcssFilePath /*path to the SQLEXPR_x64_ENU.exe or SQLEXPR32_x86_ENU.exe*/,
                            Arguments = cmdLineArgs ?? string.Empty,
                            WindowStyle = (hideWnd) ? ProcessWindowStyle.Hidden : ProcessWindowStyle.Normal
                        }
                })
            {
                if (runAsAdministrator)
                {
                    myProcess.StartInfo.Verb = "runas";
                }
                myProcess.Start();
                myProcess.WaitForExit();
                return myProcess.ExitCode;

Autres conseils

You cannot run another installer from within an msi as it will already have an open transaction. You will need to use a bootstrapper to check for and install SqlExpress before your msi is run.

Check out the bundle/burn docs here.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top