Guest User

Untitled

a guest
Nov 18th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. // Flag if java is installed
  2. private bool _isInstalling;
  3.  
  4. public bool JavaIsInstalled
  5. {
  6. get { return _isInstalling; }
  7. set { _isInstalling = value; }
  8. }
  9.  
  10. public void executeCmdCommand(string argument)
  11. {
  12. var arg0 = argument; // Path
  13.  
  14. System.Diagnostics.Process process = new System.Diagnostics.Process();
  15. System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
  16. startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
  17. startInfo.FileName = "cmd.exe";
  18. startInfo.Arguments = "/C " + arg0;
  19. process.StartInfo = startInfo;
  20.  
  21. // Set flag that it is installing
  22. MessageBox.Show("is installting");
  23. _isInstalling = true;
  24. process.Start();
  25.  
  26. MessageBox.Show("finished installing");
  27. // Set flag that is finished installing
  28. _isInstalling = false;
  29. }
Add Comment
Please, Sign In to add comment