diff --git a/Source/Core/General/FileLockChecker.cs b/Source/Core/General/FileLockChecker.cs index ec3e6f0d442e1c8871661d3e634be90648346566..840fbe593d625c605141e18c0767dccfc7dd0f20 100644 --- a/Source/Core/General/FileLockChecker.cs +++ b/Source/Core/General/FileLockChecker.cs @@ -153,8 +153,7 @@ namespace CodeImp.DoomBuilder { result.Processes = new List<Process>((int)pnProcInfo); - // Enumerate all of the results and add them to the - // list to be returned + // Enumerate all of the results and add them to the list to be returned for(int i = 0; i < pnProcInfo; i++) { try @@ -175,22 +174,29 @@ namespace CodeImp.DoomBuilder foreach(Process process in result.Processes) { - result.Error += Path.GetFileName(process.MainModule.FileName) - + " (\"" + process.MainModule.FileName - + "\", started at " + process.StartTime + ")" - + Environment.NewLine + Environment.NewLine; + string processpath = string.Empty; + try + { + // All manner of exceptions are possible here... + processpath = process.MainModule.FileName; + }catch {} + + result.Error += process.ProcessName + + " (" + (!string.IsNullOrEmpty(processpath) ? "\"" + processpath + "\"" : "") + + ", started at " + process.StartTime + ")" + + Environment.NewLine; } } } else { - result.Error = "Error " + res + ". Could not list processes locking resource."; //mxd + result.Error = "Error " + res + ". Could not list processes locking the resource."; //mxd return result; } } else if(res != 0) { - result.Error = "Error " + res + ". Could not list processes locking resource. Failed to get size of result."; //mxd + result.Error = "Error " + res + ". Could not list processes locking resource. Failed to get result size."; //mxd return result; } } diff --git a/Source/Core/General/MapManager.cs b/Source/Core/General/MapManager.cs index 0f083b3f36d6c8976235f45226d7a1d6243c65da..a0baba22b9676b28a31700238530a57f29ec06b8 100644 --- a/Source/Core/General/MapManager.cs +++ b/Source/Core/General/MapManager.cs @@ -830,7 +830,7 @@ namespace CodeImp.DoomBuilder { if(checkresult.Processes.Count > 0) { - string rest = "Press 'Retry' to close " + (checkresult.Processes.Count > 1 ? "all processes" : "the process") + string rest = Environment.NewLine + "Press 'Retry' to close " + (checkresult.Processes.Count > 1 ? "all processes" : "the process") + " and retry." + Environment.NewLine + "Press 'Cancel' to cancel saving."; if(General.ShowErrorMessage(checkresult.Error + rest, MessageBoxButtons.RetryCancel) == DialogResult.Retry)