谢谢大家的建议。使用它们并进行更多的研究,我能够为我提出一个完美的解决方案。
1)将TCL脚本文件作为资源添加到项目中,并将Build Action设置为其“属性”中的“内容”。
2)获取路径TCL脚本(甚至从已发布的版本安装后):
string makeScriptPath = System.Windows.Forms.Application.StartupPath + "\\Resources\\make.tcl";
3)使用所有必需的变量构建运行命令,并把它传递给可以执行常规它。
localCommand = String.Format("tclsh \"{0}\" --librarytype {1} --makeclean {2} --buildcode {3} --copybinary {4} --targetpath \"{5}\" --buildjobs {6} --products {7}",
makeScriptPath, library, makeClean, buildCode, copyBinary, targetPath, buildJobs, activeProducts);
runNewProcess(localCommand);
其中:
private void runNewProcess(string command)
{
System.Diagnostics.ProcessStartInfo procStartInfo =
new System.Diagnostics.ProcessStartInfo("cmd", "/k " + command);
procStartInfo.RedirectStandardOutput = false;
procStartInfo.UseShellExecute = true;
procStartInfo.CreateNoWindow = true;
// Now we create a process, assign its ProcessStartInfo and start it
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo = procStartInfo;
proc.Start();
}
这给了一些额外的津贴。由于该文件包含在应用程序中,但仍然是一个单独的实体,因此可以对其进行调整和修改,而无需重新构建,重新发布和重新安装该应用程序。
我明白了。你能否扩展一下如何去做这件事? – radensb