protected bool IsPrj2MakeAvailable() { string baseDirectory; string strMonoBasePath; string strTmp; RegistryHelper regH = null; try { regH = new RegistryHelper(); // This acts as a test to see if mono is installed strMonoBasePath = regH.GetMonoBasePath(); System.Reflection.Assembly myAddIn = System.Reflection.Assembly.GetCallingAssembly(); baseDirectory = System.IO.Path.GetDirectoryName(myAddIn.Location); strTmp = System.IO.Path.Combine(baseDirectory, "prj2makesharpWin32.exe"); m_strPrj2makePath = (System.IO.File.Exists(strTmp) == true) ? strTmp : null; if (m_strPrj2makePath != null) { return(true); } } catch (Exception) { m_strPrj2makePath = null; return(false); } return(false); }
/// <summary> /// Returns the path to the Xsp.exe or Xsp2.exe based on the XspExeSelection /// </summary> public string GetXspExePath(int xspExeSelection) { RegistryHelper regHlpr = new RegistryHelper(); string strMonoBasePath; string retVal = ""; if (xspExeSelection > 2 || xspExeSelection < 1) { throw new Exception("Invalid Xsp.exe selection. Value must be either 1 or 2"); } strMonoBasePath = regHlpr.GetMonoBasePath(); if (xspExeSelection == 1) { // Handle when it is Xsp.exe retVal = Path.Combine( strMonoBasePath, @"lib\mono\1.0\xsp.exe" ); if (File.Exists(retVal) == true) { return(retVal); } retVal = Path.Combine( strMonoBasePath, @"lib\xsp\1.0\xsp.exe" ); if (File.Exists(retVal) == true) { return(retVal); } } if (xspExeSelection == 2) { // Handle when it is Xsp2.exe retVal = Path.Combine( strMonoBasePath, @"lib\mono\2.0\xsp2.exe" ); if (File.Exists(retVal) == true) { return(retVal); } retVal = Path.Combine( strMonoBasePath, @"lib\xsp\2.0\xsp2.exe" ); if (File.Exists(retVal) == true) { return(retVal); } } return(retVal); }
/// <summary> /// Returns the path to the Xsp.exe or Xsp2.exe based on the XspExeSelection /// </summary> public string GetXspExePath(int xspExeSelection) { RegistryHelper regHlpr = new RegistryHelper(); string strMonoBasePath; string retVal = ""; if(xspExeSelection > 2 || xspExeSelection < 1) throw new Exception("Invalid Xsp.exe selection. Value must be either 1 or 2"); strMonoBasePath = regHlpr.GetMonoBasePath(); if(xspExeSelection == 1) { // Handle when it is Xsp.exe retVal = Path.Combine( strMonoBasePath, @"lib\mono\1.0\xsp.exe" ); if(File.Exists(retVal) == true) return retVal; retVal = Path.Combine( strMonoBasePath, @"lib\xsp\1.0\xsp.exe" ); if(File.Exists(retVal) == true) return retVal; } if(xspExeSelection == 2) { // Handle when it is Xsp2.exe retVal = Path.Combine( strMonoBasePath, @"lib\mono\2.0\xsp2.exe" ); if(File.Exists(retVal) == true) return retVal; retVal = Path.Combine( strMonoBasePath, @"lib\xsp\2.0\xsp2.exe" ); if(File.Exists(retVal) == true) return retVal; } return retVal; }
protected bool IsPrj2MakeAvailable() { string baseDirectory; string strMonoBasePath; string strTmp; RegistryHelper regH = null; try { regH = new RegistryHelper(); // This acts as a test to see if mono is installed strMonoBasePath = regH.GetMonoBasePath(); System.Reflection.Assembly myAddIn = System.Reflection.Assembly.GetCallingAssembly(); baseDirectory = System.IO.Path.GetDirectoryName(myAddIn.Location); strTmp = System.IO.Path.Combine(baseDirectory, "prj2makesharpWin32.exe"); m_strPrj2makePath = (System.IO.File.Exists(strTmp) == true) ? strTmp : null; if(m_strPrj2makePath != null) return true; } catch(Exception) { m_strPrj2makePath = null; return false; } return false; }