謝謝大家的建議。使用它們並進行更多的研究,我能夠爲我提出一個完美的解決方案。
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