【发布时间】:2018-06-08 19:42:49
【问题描述】:
在我的 C# 应用程序中,我以静默模式运行一些设置。问题是我想让用户选择目标安装目录但不知道如何。
这是可以正常工作但安装在默认目录中的静默安装:
void RunSilentSetup(string executableFilePath)
{
ProcessStartInfo startInfo = new ProcessStartInfo()
{
CreateNoWindow = false,
UseShellExecute = true,
FileName = executableFilePath,
WindowStyle = ProcessWindowStyle.Hidden,
Arguments = "/s /v/qn"
};
using (Process exeProcess = Process.Start(startInfo))
{
exeProcess.WaitForExit();
int exitcode = exeProcess.ExitCode;
if (exitcode == 0)
{
Console.WriteLine("Installation was successfully completed");
}
else
Console.WriteLine("one or more errors occurred during the installation");
}
}
但我需要类似的东西:
void RunSilentSetup(string executableFilePath, string targetDir)
{
.
.
.
Arguments = "/s /v/qn"+targetDir,
.
.
.
}
这里是设置参数:
【问题讨论】:
标签: c# installshield