Files
effector.main/Supervisor/Utility/ExecProcessManager.vb
T
Emmanuele Sassi fad64bb5b4 - implementata lista macchine configurabili
- aggiunte funzioni lua
- corretta esportazione funzioni per plugin
- aggiunta funzione che lancia eseguibile per cam
2024-08-09 11:42:31 +02:00

29 lines
952 B
VB.net

Module ExecProcessManager
Friend Function ExecProcess(sFileName As String, sMainLuaPath As String, sArguments As String) As Boolean
' lancio esecuzione programma
Dim bResult As Boolean = True
Dim Proc As New Process()
Proc.StartInfo.FileName = sFileName
Proc.StartInfo.RedirectStandardInput = False
Proc.StartInfo.RedirectStandardOutput = False
Proc.StartInfo.Arguments = 1.ToString() & " """ & sMainLuaPath & """ """ & sArguments & """"
Proc.StartInfo.UseShellExecute = False
Proc.StartInfo.CreateNoWindow = True
Dim ExecCounter = 0
If Proc.Start Then
While Not Proc.HasExited
If ExecCounter >= 100 Then
bResult = False
Proc.Kill()
Exit While
End If
Threading.Thread.Sleep(100)
ExecCounter += 1
End While
End If
Return bResult
End Function
End Module