// This file is part of the OWASP O2 Platform (http://www.owasp.org/index.php/OWASP_O2_Platform) and is released under the Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
using System;
using System.IO;
using System.Text;
using System.Linq;
using System.Diagnostics;
using System.Reflection;
using Microsoft.Win32;
using System.Xml;
using System.Xml.Serialization;
using System.Windows.Forms;
using System.Collections;
using System.Collections.Generic;
using O2.Kernel;
using O2.Kernel.ExtensionMethods;
using O2.DotNetWrappers.ExtensionMethods;
using O2.DotNetWrappers.DotNet;
using O2.DotNetWrappers.Windows;
//O2File:_Extra_methods_Misc.cs
namespace O2.XRules.Database.Utils
{
public static class _Extra_Windows_ExtensionMethods
{
}
public static class _Extra_Processes_ExtensionMethods
{
public static string startProcess_getConsoleOut(this string processExe)
{
return processExe.startProcess_getConsoleOut("");
}
public static string startProcess_getConsoleOut(this string processExe, string arguments)
"[executeH2_or_O2_in_new_Process] could not find O2 or H2 script to execute: {0}".error(scriptFile);
return null;
}
public static Process executeH2_as_Admin_askUserBefore(this string scriptName)
{
if ("It looks like your current account doesn't have the rights to run this script, do you want to try running this script with full priviledges?".askUserQuestion())
return scriptName.executeH2_as_Admin();
return null;
}
public static Process executeH2_as_Admin(this string scriptToExecute)