Silent Install of SQL Server Express 2012 from Inno Setup - sql-server-2012

I am trying to install SQL Server Express 2012 silently from my application installer created using Inno Setup. When running the following command from the command line, SQL Server Express 2012 is installed as I want only showing progress of the install but not allowing the user to enter any input.
Command line command that works:
C:\Users\Jason\Desktop>SQLEXPR_x86_ENU.exe /ACTION=Install /INSTANCENAME=MYINSTANCE /INSTANCEID=MYINSTANCE /QS /HIDECONSOLE /INDICATEPROGRESS="False" /IAcceptSQLServerLicenseTerms /SQLSVCACCOUNT="NT AUTHORITY\NETWORK SERVICE" /SQLSYSADMINACCOUNTS="builtin\administrators" /SKIPRULES="RebootRequiredCheck"
In order to do this from my Inno Setup script I have the following code:
Exec(installName,
'/ACTION=Install /INSTANCENAME=MYINSTANCE /INSTANCEID=MYINSTANCE /QS /HIDECONSOLE /INDICATEPROGRESS="False" /IAcceptSQLServerLicenseTerms /SQLSVCACCOUNT="NT AUTHORITY\NETWORK SERVICE" /SQLSYSADMINACCOUNTS="builtin\administrators" /SKIPRULES="RebootRequiredCheck"',
'',
SW_SHOW,
ewWaitUntilTerminated,
ResultCode);
where installName = SQLEXPR_x86_ENU.exe
When run from the Installer the SQL Server Express 2012 installer starts but after the first information dialog it then shows the SQL Server Installation Center window and the user has to select the type of installation before the installer continues. They also have to agree to the license agreement which was not required when running directly from the command line.
Any ideas on how to run the installer silently from Inno Setup?

change from "BUILTIN\Administrators" to "BUILTIN\Users" will be fine.

The problem is probably with passing command line params to SQLEXPR_x86_ENU.exe
If you run extracted SQL setup.exe with your command linie all should be OK. But if you pass a command line through SQLEXPR_x86_ENU.exe it first extracts installer and then runs it with modified command line - one pair of quotation marks "" is removed (or rather it passes only first string as params). That's why whole command line params for setup.exe should be placed in additional quotation marks ""
Your command line should looks like this one (starts with ' and " and finishes with " and'):
'"/ACTION=Install /INSTANCENAME=MYINSTANCE /INSTANCEID=MYINSTANCE /QS /HIDECONSOLE /INDICATEPROGRESS="False" /IAcceptSQLServerLicenseTerms /SQLSVCACCOUNT="NT AUTHORITY\NETWORK SERVICE" /SQLSYSADMINACCOUNTS="builtin\administrators" /SKIPRULES="RebootRequiredCheck""'

Related

Install SQL Server Express silently

I am trying to create a .bat file to install SQL Server 2014 Express silently, and with my own options, but each time it runs, it quits in the middle.
Here is my command:
C:> SQLEXPR_x86_EN /ACTION=Install /QS /BROWSERSVCSTARTUPTYPE=Automatic
/ADDCURRENTUSERASSQLADMIN=True /IACCEPTSQLSERVERLICENSETERMS
/FEATURES=SQLEngine /SQLSVCSTARTUPTYPE=Automatic
/INSTANCENAME="MX_SERVER_SQL" /NPENABLED=1 /TCPENABLED=1
/AGTSVCACCOUNT="NT AUTHORITY\Network Service"
/SQLSVCACCOUNT="NT AUTHORITY\Network Service"
/SQLSYSADMINACCOUNTS=BUILTIN\Administrators /SECURITYMODE=SQL
/SAPWD=My_123456
Why does it not run to the end?
ERROR > The installation starts but somewhere after start to load the files it quits and stops the installation and nothing installed
It didn't run to the end because it probably encountered a failure during setup! To diagnose setup failures, look at the setup log files.
Specifically, file path %programfiles%\Microsoft SQL Server\120\Setup Bootstrap\Log.
based on your sa password i would think it doesn't meet server complexity requirements.

WIX SQL Server Express SP1 execution in MSI

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="[SQLEXPRINSTANCENAME]" /IACCEPTSQLSERVERLICENSETERMS /FEATURES=SQLEngine /TCPENABLED=1 /SQLSVCACCOUNT="NT AUTHORITY\Network Service" /SQLSYSADMINACCOUNTS="Builtin\Administrators" /BROWSERSVCSTARTUPTYPE="Automatic" /AGTSVCACCOUNT="NT AUTHORITY\Network Service" /SQLSVCSTARTUPTYPE="Automatic""
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.
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.
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;

SQL Server 2008 Express Prerequisite fails

I have an application which has SQL Server 2008 Express as a prerequisite.
The installation fails in Windows 8 Pro however with the following error message:
Installing using command
'C:\Users\Ranjith\AppData\Local\Temp\VSD26C2.tmp\SqlExpress2008\SQLEXPR32_x86_ENU.EXE'
and parameters '/q /hideconsole /action=Install /features=SQL
/instancename=SQLEXPRESS /enableranu=1 /sqlsvcaccount="NT
Authority\Network Service" /AddCurrentUserAsSqlAdmin
/skiprules=RebootRequiredCheck' Process exited with code -2068643839
Status of package 'SQL Server 2008 Express' after install is
'InstallFailed'
What does the exit code -2068643839 mean?
NOTE: Tried posting in social.msdn.microsoft.com with not much responses.

How to Silently Install SQL Server 2008 Express In InstallShield 2010

I use InstallShield 2010 to create my setup.
My program needs SQL Server 2008 Express. So I added "Microsoft SQL Server 2008 Express SP1 (x86)" in the redistributables section.
Then in "Edit Prerequisites" => "Application To Run" tab, I insert this statement in a textbox:
SQLEXPR32_x86_ENU.exe /qs /ACTION=Install /FEATURES=SQLENGINE /INSTANCENAME=MSSQLSERVER
/SQLSVCACCOUNT="NT AUTHORITY\SYSTEM" /SQLSVCPASSWORD="YesYes"
/SQLSYSADMINACCOUNTS="Builtin\Administrators"
/AGTSVCACCOUNT="NT AUTHORITY\Network Service" /IACCEPTSQLSERVERLICENSETERMS=true
http://i46.tinypic.com/a0a343.jpg
But when I run the setup, after some minutes I see this message and SQL Server 2008 Express isn't installed.
http://i50.tinypic.com/2krcr9.jpg
Now how can I completely install SQL Server 2008 Express in silent mode?
[UPDATE]
Problem Solved:
I Do 3 Steps To Solved My Problem:
1- Restart My Computer
2- Delete "/IACCEPTSQLSERVERLICENSETERMS=true" From Statement
3 - Delete /SQLSVCPASSWORD="YesYes" From Statement
I am not sure /IACCEPTSQLSERVERLICENSETERMS requires a boolean value at all?... I just include the statement, without a parameter value and it works.
After several hour trying,I have done it:
1.In InstallShield2010,Go to:"Installation Designer" Tab->Application Data->Redistributable
2.Find the “Microsoft SQL Server 2008 Express SP1 (x86 & x64Wow)” from the list and right click on it and click on "Edit Prerequisite" .
3.In “Application to Run” write:
/qs /INSTANCEID=”SQLEXPRESS” /ACTION=”Install” /FEATURES=SQLENGINE /INSTANCENAME=”SQLEXPRESS” /SQLSVCACCOUNT=”NT AUTHORITY\SYSTEM” /SQLSYSADMINACCOUNTS=”Builtin\Administrators” /ADDCURRENTUSERASSQLADMIN
in “Specify command line for the application”.
For more information,Please take a look at:
http://www.hadirobati.com/wpEn/silent-install-of-sql-server-2008-express-in-installshield/

sqlcmd not working during setup (innosetup)

nice to meet you, i always lurk here as soon as i get some problem; but now it seems i'm having some strange issue i didn't find any trace here.
Using InnoSetup i created a setup that runs, as long as others, 2 Batches;
The first one installs SQL EXPRESS 2008 With tools (%n are parameters passed with innosetup):
C:\omi\setup\sql\setup.exe /QS /ACTION=Install /FEATURES=SQL,Tools /INSTANCENAME=%1 /SQLSVCACCOUNT="NT AUTHORITY\Network Service" /SQLSVCSTARTUPTYPE="Automatic" /IACCEPTSQLSERVERLICENSETERMS /SECURITYMODE=SQL /SAPWD="omicron" /TCPENABLED=1
PAUSE
And it seems to end successfully.
The issue comes with the second batch:
sqlcmd -d master -S .\%1 -q "CREATE DATABASE arca ON ( FILENAME = N'C:\omi\db\arca_Data.MDF' ), ( FILENAME = N'C:\omi\db\arca_Log.LDF') FOR ATTACH"
PAUSE
since the prompt tells that sqlcmd is not recognised as internal or external command, nor executable or batch.
what dazzles me is the fact that if i write the same command manually, is work perfectly.
It seems doesn't detect it in the system's PATH
within one installation session and is executed under a user which doesn't see the PATH environment which has been changed.
First it is executed under /SQLSVCACCOUNT="NT AUTHORITY\Network Service" then it seems that it uses a different user. It looks like it sets the PATH variable only for the Network Service user.