c#
private Process _Client;
private Process _Server;
private List<Process> _ChildProcesses = new List<Process>();
public MainWindow()
{
InitializeComponent();
// Path to MonacoLuau folder
string monacoLuauPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "MonacoLuau");
string nodeModulesPath = System.IO.Path.Combine(monacoLuauPath, "node_modules");
// Check if node_modules exists
if (Directory.Exists(nodeModulesPath))
{
string clientPath = System.IO.Path.Combine(monacoLuauPath, "Client");
string serverPath = System.IO.Path.Combine(monacoLuauPath, "Server");
_Client = StartProcess(clientPath, "run dev");
_Server = StartProcess(serverPath, "run dev");
// Track child processes of server and client
_ChildProcesses.AddRange(GetChildProcesses(_Client));
_ChildProcesses.AddRange(GetChildProcesses(_Server));
}
else
{
// Handle npm install logic
RunNpmInstall(monacoLuauPath);
}
}