created a static function that will return the path to the RO Editor
This commit is contained in:
		
							
								
								
									
										23
									
								
								PROMS/Volian.Base.Library/ExeInfo.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								PROMS/Volian.Base.Library/ExeInfo.cs
									
									
									
									
									
										Normal file
									
								
							@@ -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;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user