[英]SQL Express 2014 silent installation not working with C#
I have tried the silent installation of SQL Express 2014 with C# pro-grammatically. 我已经在C#的语法上尝试了SQL Express 2014的无提示安装。 Here is the code i tried. 这是我尝试的代码。
string strSQLPath = "C:\\SQLEXPR.exe";
string SQLfn = strSQLPath;
string SQLp = @"/QS SAPWD=""C0mp!ex"" ConfigurationFile=""C:\Configuration.ini""";
ProcessStartInfo psiSQL = new ProcessStartInfo(SQLfn, SQLp);
Process SQLprocess = new Process();
try
{
SQLprocess = System.Diagnostics.Process.Start(psiSQL);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
try
{
SQLprocess.WaitForExit();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
I followed the configuration.ini file preparation from below link. 我按照下面的链接准备了configuration.ini文件。
SQL Server Express Silent Installation SQL Server Express静默安装
I also tried the following argument series. 我还尝试了以下参数系列。
//string SQLp = "/qn INSTANCENAME=SQLEXPRESS ADDLOCAL=ALL";
//string SQLp = @"/qs Action=Install InstanceName=SQLExpress";
//string SQLp = @"/qs Action=Install IAcceptSQLServerLicenseTerms=True Features=SQL,Tools InstanceName=SQLExpress SQLSYSADMINACCOUNTS=""Builtin\Administrators"" SQLSVCACCOUNT=""DomainName\UserName"" SQLSVCPASSWORD=""StrongPassword""";
//string SQLp = "/qs Action=Install Hideconsole Features=SQL,Tools InstanceName=SQLEXPRESS SQLSYSADMINACCOUNTS=Administrators SQLSVCACCOUNT=global\admin SQLSVCPASSWORD=password";
//string SQLp = "/q ACTION=INSTALL INSTANCENAME=SQLEXPRESS ADDLOCAL=ALL ROLE=AllFeatures_WithDefaults ENU=True QUIET=True INSTALLSHAREDWOWDIR=C:\\Program Files (x86)\\Microsoft SQL Server";
None of the command is working for me. 没有任何命令对我有用。 SQL Express Edition is not getting installed at all. 完全没有安装SQL Express Edition。
It does now show any error (may be because of QS command), but finally i dont see any SQL component got installed (referring control panel) 现在它确实显示任何错误(可能是由于QS命令),但是最后我没有看到安装了任何SQL组件(请参阅控制面板)
Please suggest to resolve the issue. 请提出解决问题的建议。
Note: I am using "Express 64BIT\\SQLEXPR_x64_ENU.exe" which has been downloaded from the Microsoft download page. 注意:我使用的是从Microsoft下载页面下载的“ Express 64BIT \\ SQLEXPR_x64_ENU.exe”。
The following command works for me... 以下命令对我有用...
Setup.exe /ACTION=Install /FEATURES=SQL /INSTANCENAME=SQLEXPRESS /SECURITYMODE=SQL /SAPWD="Password1" /SQLSVCACCOUNT="NT AUTHORITY\\SYSTEM" /SQLSYSADMINACCOUNTS="BUILTIN\\ADMINISTRATORS" /IACCEPTSQ LSERVERLICENSETERMS /SkipInstallerRunCheck /QS Setup.exe / ACTION =安装/ FEATURES = SQL / INSTANCENAME = SQLEXPRESS / SECURITYMODE = SQL / SAPWD =“ Password1” / SQLSVCACCOUNT =“ NT AUTHORITY \\ SYSTEM” / SQLSYSADMINACCOUNTS =“ BUILTIN \\ ADMINISTRATORS” / IACCEPTSQ LSERVERLICENSETERMS / SkipInstallerRunCheck / Q
var newPro = Process.Start(sq\SetupfilePath, @"/q /Action=Install /IACCEPTSQLSERVERLICENSETERMS /Hideconsole /Features=SQLEngine /InstanceName=SQLEXPRESS /SQLSYSADMINACCOUNTS=""NT AUTHORITY\SYSTEM"" /SQLSVCACCOUNT=""NT AUTHORITY\SYSTEM"" /BROWSERSVCSTARTUPTYPE=""Automatic""");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.