B4J Question JShell - run program with administrator privileges

Roberto P.

Well-Known Member
Licensed User
Longtime User
Hi

I want to launch the tomcat installer from a utility developed with B4J, but it returns an error message because the administrator privileges are missing.
can anyone tell me what parameters should I enter?


B4X:
Sub btnInstallTomCat_Click
    Dim aFile As String     =     File.DirApp & "\" & mFolderDownload & "\" & mFileExeTomCat
    
    Dim shl As Shell
    'shl.Initialize("shl",aFile, Null)
    shl.Initialize("shl", aFile , Array As String("-jar")) ', "Server_report.jar"))
    shl.WorkingDirectory = File.DirApp & "\" & mFolderDownload & "\"
    shl.Run(1000) 'set a timeout of 10 seconds
    
End Sub

Sub shl_ProcessCompleted (Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String)
    
    Log($"SSH_CmdExecuted at ${DateTime.Time(DateTime.Now)}: "$)
    
    Log("Success " & Success)
    Log("exit code " & ExitCode)
    Log("Stdout " & StdOut)
    Log("strerr " & StdErr)

End Sub



thank
regards
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…