public static string GetDefaultHomeDir() { if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HOME", EnvironmentVariableTarget.User))) { return(Environment.GetEnvironmentVariable("HOME", EnvironmentVariableTarget.User)); } if (Settings.RunningOnWindows()) { string homePath; if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HOMEDRIVE"))) { homePath = Environment.GetEnvironmentVariable("HOMEDRIVE"); homePath += Environment.GetEnvironmentVariable("HOMEPATH"); } else { homePath = Environment.GetEnvironmentVariable("USERPROFILE"); } return(homePath); } else { return(Environment.GetFolderPath(Environment.SpecialFolder.Personal)); } }
public static string GetDefaultHomeDir() { if (!string.IsNullOrEmpty(UserHomeDir)) { return(UserHomeDir); } if (Settings.RunningOnWindows()) { return(WindowsDefaultHomeDir); } return(Environment.GetFolderPath(Environment.SpecialFolder.Personal)); }
public static void TerminateTree(this Process process) { #if !MONO if (Settings.RunningOnWindows()) { // Send Ctrl+C AttachConsole(process.Id); SetConsoleCtrlHandler(IntPtr.Zero, true); GenerateConsoleCtrlEvent(0, 0); if (!process.HasExited) { System.Threading.Thread.Sleep(500); } if (!process.HasExited) { process.Kill(); } } #else process.Kill(); #endif }