From 6935e62cc7ca87da57bbb8b3c103fb530bbe22d2 Mon Sep 17 00:00:00 2001 From: John Date: Mon, 25 Mar 2013 20:55:39 +0000 Subject: [PATCH] created a static function that will return the path to the RO Editor --- PROMS/Volian.Base.Library/ExeInfo.cs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 PROMS/Volian.Base.Library/ExeInfo.cs diff --git a/PROMS/Volian.Base.Library/ExeInfo.cs b/PROMS/Volian.Base.Library/ExeInfo.cs new file mode 100644 index 00000000..f9170282 --- /dev/null +++ b/PROMS/Volian.Base.Library/ExeInfo.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Volian.Base.Library +{ + public static class ExeInfo + { + public static string GetROEditorPath() + { + //string roapp = Environment.GetEnvironmentVariable("roapp"); + // Get the current location of the PROMS executable and build a path to the RO Editor executable. + // the system call below return a path string with "file:\\" preceeding it. + string roapp = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase); + if (roapp[7] == ':') // either a local drive or a mapped network drive + roapp = roapp.Substring(6); + else + roapp = @"\" + roapp.Substring(5); // non-mapped network drive - need to add extra back slash in front + roapp = roapp + @"\ROEDITOR.EXE"; + return roapp; + } + } +}