Is it possible to auto-restart an B4J-programm ?
Sub Process_Globals End Sub Sub AppStart (Args() As String) Dim shl As Shell Try shl.Initialize("shl", "java.exe" , Array As String("-jar", "Your.jar")) shl.WorkingDirectory = File.DirApp shl.Run(-1) Catch Log(LastException.Message) End Try End Sub Sub shl_ProcessCompleted (Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String) If Success Then Log(StdOut) End If End Sub 'Return true to allow the default exceptions handler to handle the uncaught exception. Sub Application_Error (Error As Exception, StackTrace As String) As Boolean Return True End Sub
Sub ExitButton_Click Dim sf As Object = xui.Msgbox2Async("Proggi wird neu gestartet !","Neustart","OK","","Abbruch", Null) Wait For (sf) Msgbox_Result (Result As Int) If Result = xui.DialogResponse_Positive Then Dim shl As Shell Try shl.Initialize("shl", "java.exe" , Array As String("-jar", "YourRestart.jar")) shl.WorkingDirectory = File.DirApp shl.Run(-1) Catch Log(LastException.Message) End Try Log("Neustart!!!") ExitApplication End If End Sub
hello erel it is possible to have two executables (2 programs in the same project). I am trying for the client to have a program and when it detects an update, download and initialize again similar to Visual Studio's ClickOnce. I've searched the forum a lot and this is the most similar thing I findYou can create another program that starts the first program after 1-2 seconds. Start the second program with jShell and call ExitApplication.