Click here to Skip to main content
14,486,801 members
Rate this:
Please Sign up or sign in to vote.
See more:
I am trying to do a silent install for sql 2017 express. it starts and creates all the folders but then it acts like its done and doesn't actually install the sql server.
I have attached to code I am using.

What I have tried:

  Process p = new Process();
  string pathUser = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\SQLEXPRADV_x64_ENU.exe";
  p.StartInfo.FileName = pathUser;
//  string arg = "/QS /ACTION = Install /IACCEPTSQLSERVERLICENSETERMS=\"True\" /ENU=\"True\" /UIMODE=\"Normal\" /INSTALLSHAREDDIR=\"C:\\Program Files\\Microsoft SQL Server\" INSTALLSHAREDWOWDIR=\"C:\\Program Files(x86)\\Microsoft SQL Server\" INSTANCEDIR=\"C:\\Program Files\\Microsoft SQL Server\" /SQLTELSVCSTARTUPTYPE=\"Automatic\" /INDICATEPROGRESS=\"False\" /IACCEPTROPENLICENSETERMS=\"True\" /FEATURES =\"SQLENGINE, REPLICATION, SQL_INST_MR, FULLTEXT, CONN, BC, SDK\" /INSTANCENAME = SQLEXPRESS /AGTSVCACCOUNT =\"NT AUTHORITY\\NETWORK SERVICE\" /AGTSVCSTARTUPTYPE =\"Disabled\" /SQLSVCACCOUNT =\"NT Service\\MSSQL$SQLEXPRESS\" /SQLSYSADMINACCOUNTS =\"BUILTIN\\ADMINISTRATORS\" /SECURITYMODE =\"SQL\" /SAPWD =\"CampAcc\"";
  string arg = "/QS ACTION=\"Install\" ROLE =\"AllFeatures_WithDefaults\" SUPPRESSPRIVACYSTATEMENTNOTICE=\"False\" ENU=\"True\" QUIET=\"True\" QUIETSIMPLE=\"False\"";
  arg += " UpdateEnabled=\"False\" FEATURES=\"SQLENGINE, REPLICATION, SQL_INST_MR, FULLTEXT, CONN, BC, SDK\" UpdateSource=\"MU\" INSTANCENAME=\"SQLEXPRESS\"";
  arg += " INSTALLSHAREDDIR = \"C:\\Program Files\\Microsoft SQL Server\" INSTALLSHAREDWOWDIR = \"C:\\Program Files (x86)\\Microsoft SQL Server\"  INSTANCEID = \"SQLEXPRESS\"";
  arg += " SQLTELSVCACCT = \"NT ServiceSQLTELEMETRY$SQLEXPRESS\" SQLTELSVCSTARTUPTYPE = \"Automatic\" INSTANCEDIR = \"C:\\Program Files\\Microsoft SQL Server\"";
  arg += " AGTSVCACCOUNT=\"NT AUTHORITYNETWORK SERVICE\" AGTSVCSTARTUPTYPE=\"Disabled\" COMMFABRICPORT=\"0\" COMMFABRICNETWORKLEVEL=\"0\" COMMFABRICENCRYPTION=\"0\"";
  arg += " MATRIXCMBRICKCOMMPORT=\"0\" SQLSVCSTARTUPTYPE=\"Automatic\" FILESTREAMLEVEL=\"0\" ENABLERANU = \"True\" SQLCOLLATION=\"SQL_Latin1_General_CP1_CI_AS\"";
  arg += " SQLSVCACCOUNT=\"NT ServiceMSSQL$SQLEXPRESS\"  SQLSVCINSTANTFILEINIT=\"False\" SQLSYSADMINACCOUNTS = \"BUILTIN\\ADMINISTRATORS\" SQLTEMPDBFILECOUNT = \"1\"";
  arg += " SQLTEMPDBFILESIZE = \"8\" SQLTEMPDBFILEGROWTH = \"64\" SQLTEMPDBLOGFILESIZE = \"8\" SQLTEMPDBLOGFILEGROWTH = \"64\"";
  arg += " ADDCURRENTUSERASSQLADMIN=\"True\" TCPENABLED=\"0\" NPENABLED=\"0\" BROWSERSVCSTARTUPTYPE=\"Disabled\" IACCEPTSQLSERVERLICENSETERMS=\"True\" SAPWD = \"Mystrongpassword\"";
  MessageBox.Show("Ready to install");
  p.StartInfo.Arguments = arg;

  p.StartInfo.CreateNoWindow = false;
  // Process the secret works.
  p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
  p.Start();

  p.WaitForExit();
Posted
Comments
phil.o 18-Mar-20 23:47pm
   
Find the log file generated during installation. This is the only place where you could find some useful informations about what is happening.
Debugging the application and double-checking the final content of the arg variable would be a plus, too.
ZurdoDev 19-Mar-20 7:59am
   
What does the log say?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100