如何静默安装SQL Server 2012本地数据库 [英] How to install SQL server 2012 local db silently

查看:283
本文介绍了如何静默安装SQL Server 2012本地数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道你的人都像我一样更新,想与2012年的Visual Studio合作,你心中有激情可以在更大的尺寸和时间上表现出来。

但sql server出现问题2008年表示,安装速度非常慢,微软为最终用户计算机上的本地数据库创建了sql local db 2012,安装速度非常快。

那么现在呢?

问题是vs 2010不支持新的先决条件,因此哪个安装程序可以安装此msi软件包。我搜索了7天。没有!他们只是安装sql server 2012 express对用户来说太大了。

所以我找到了一种通过system.process安装它的方法,但它不能安静地安装,那是因为许可证,我试了这么多,没有任何结果,任何人都可以帮助我吗?



我的代码:

  public   bool  fncInstal32( string  sMSIPath)
{
try
{
Console.WriteLine( 开始安装应用程序);
流程流程= 流程();
process.StartInfo.FileName = msiexec.exe;
process.StartInfo.Arguments = string .Format( / qf / i \{0} \ALLUSERS = 1 IACCEPTSQLNCLILICENSETERMS = YES,sMSIPath);
process.Start();
process.WaitForExit();
Console.WriteLine( 应用程序安装成功!);
return true ; // 如果流程成功结束,则返回True
}
catch
{
Console.WriteLine( 有安装应用程序时遇到问题!);
return false ; // 如果流程失败,则返回False
}
}





当我将qf更改为qb时,它将无法安装!为什么?

qf = full gui

qb =无声模式

解决方案

ProcessStartInfo inf = new ProcessStartInfo( SqlLocalDB.msi,/ qn IACCEPTSQLLOCALDBLICENSETERMS = YES){UseShellExecute = true,WindowStyle = ProcessWindowStyle.Normal};



System.Diagnostics.Process.Start(inf );

I know you people are all updated like me, wants to work with visual studio 2012 and there is passion in your heart for better performance in size and time.
But the problem arise with sql server 2008 express , it is very slow in installation and Microsoft created sql local db 2012 for local databases on end user computers to be very fast in installation.
So what now?
The problem is vs 2010 is not supporting new prerequisites, So which installer can install this msi package. i searched 7 days for this. nothing! they just install sql server 2012 express that is so big and bad for user.
So i find a way to instal it by system.process, but it can't be instal silently and that's because license, i tried so much, without any result, can anyone help me here?

my code:

public bool fncInstal32(string sMSIPath)
      {
          try
          {
              Console.WriteLine("Starting to install application");
              Process process = new Process();
              process.StartInfo.FileName = "msiexec.exe";
              process.StartInfo.Arguments = string.Format(" /qf /i \"{0}\" ALLUSERS=1  IACCEPTSQLNCLILICENSETERMS=YES", sMSIPath);
              process.Start();
              process.WaitForExit();
              Console.WriteLine("Application installed successfully!");
              return true; //Return True if process ended successfully
          }
          catch
          {
              Console.WriteLine("There was a problem installing the application!");
              return false;  //Return False if process ended unsuccessfully
          }
      }



When i change qf to qb it won't install silently!! why?
qf= full gui
qb= silent mode

解决方案

ProcessStartInfo inf = new ProcessStartInfo("SqlLocalDB.msi", "/qn IACCEPTSQLLOCALDBLICENSETERMS=YES") { UseShellExecute = true, WindowStyle = ProcessWindowStyle.Normal };

System.Diagnostics.Process.Start(inf);


这篇关于如何静默安装SQL Server 2012本地数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆