简体   繁体   English

SQL Express 2014静默安装不适用于C#

[英]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.

相关问题 静默安装 SQL Server 2014 Express - Silent install of SQL Server 2014 Express 使用存储过程或C#同步SQL Server 2014和SQL Server 2014 Express数据库 - Sync SQL Server 2014 and SQL Server 2014 Express database using stored procedure or C# C# 静默安装msi不起作用 - C# Silent installation of msi does not work 将静默SQL Server安装的输出重定向到C#中的标准错误? - Redirect output from silent SQL Server installation to Standard Error in C#? 从C#进行SQL Server 2014 Express Edition数据库备份-SQL错误 - Sql Server 2014 Express Edition database backup from c# - Sql Error 以无提示模式安装SQL Server Express 2008以及C#应用程序 - Install SQL Server Express 2008 in Silent mode along with a C# application 我可以使用ADO.NET和C#在MS SQL Express 2014 LocalDB中创建表吗? - Can I create table in MS SQL Express 2014 LocalDB using ADO.NET and C#? 使用C#静默安装应用程序时跳过向导UI - Skip wizard UI while silent installation of application using C# C#-“用户'用户名'登录失败(SQL Server 2014) - C# - "Login failed for user 'Username'(SQL Server 2014) 有没有办法接受使用 C# 静默安装 a.msi 文件的许可协议? - Is there a way to accept the license agreement to a silent installation of a .msi file using C#?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM