以编程方式静默安装SQL Server compact .MSI C# [英] Silent install SQL server compact .MSI programmatically C#
问题描述
我的项目依赖于SQL Server Compact 3.5.1,因此我希望它能够自动安装而无需任何用户交互,以便为非常基本的用户提供便利。
这两个.msi是SSCERuntime_x86-ENU.msi,SSCERuntime_x64-ENU.msi,它们将位于.exe的同一个文件夹中
我尝试了很多示例代码但是他们不允许我默默安装.msi,任何帮助都将不胜感激。
我尝试过:
试试
{
string installCommandString =/ i {0} / qn;
流程流程=新流程();
ProcessStartInfo startInfo = new ProcessStartInfo();
process.StartInfo = startInfo;
startInfo.UseShellExecute = false;
startInfo.RedirectStandardError = true;
startInfo.FileName =SSCERuntime_x86-ENU.msi;
startInfo.Arguments = string.Format(installCommandString,SQL Server MSI Path);
process.Start();
}
catch(例外情况)
{
MessageBox .Show(ex.Message,Error);
}
Well my project depends on SQL Server Compact 3.5.1 , so I want it to be installed automatically and without any user interaction to make it easy for very basic users.
The two .msi are SSCERuntime_x86-ENU.msi , SSCERuntime_x64-ENU.msi and they'll be located in the same folder of the .exe
I've tried many sample codes but they didn't allow me to silent install the .msi , any help would be appreciated.
What I have tried:
try
{
string installCommandString = "/i {0} /qn";
Process process = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo();
process.StartInfo = startInfo;
startInfo.UseShellExecute = false;
startInfo.RedirectStandardError = true;
startInfo.FileName = "SSCERuntime_x86-ENU.msi";
startInfo.Arguments = string.Format(installCommandString, "SQL Server MSI Path");
process.Start();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error");
}
推荐答案
所以我希望它能够自动安装而无需任何用户交互,以便为非常基本的用户提供便利。
so I want it to be installed automatically and without any user interaction to make it easy for very basic users.
防止静默安装是一种安全措施功能。
将它作为恶意软件活动来解决,所以不要指望这里有帮助。
Preventing silent installation is a security feature.
getting around it as malware activity, so don't expect mush help here.
这篇关于以编程方式静默安装SQL Server compact .MSI C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!