public void SetExecutableFile(string filePath)
{
if (String.IsNullOrEmpty(filePath))
{
m_executablePath = null;
return;
}
m_executablePath = filePath;
m_configurationPath = null;
m_isSdkCompatible = false;
m_application = null;
FileInfo executableFile = new FileInfo(m_executablePath);
m_displayName = executableFile.Name.Substring(0, executableFile.Name.Length-4);
FileInfo configFile = new FileInfo(executableFile.FullName + ".config");
// Utils.Trace(1, "APPCONFIG={0}", configFile);
if (configFile.Exists)
{
// save the .NET config file.
m_configurationPath = configFile.FullName;
// look for the UA SDK config file.
string configurationPath = GetConfigFileFromAppConfig(configFile);
// Utils.Trace(1, "UACONFIG={0}", configurationPath);
if (configurationPath != null)
{
m_configurationPath = configurationPath;
}
else
{
m_configurationPath = configFile.FullName;
}
LoadSdkConfigFile();
}
// set display name.
if (m_sourceFile == null || String.IsNullOrEmpty(m_displayName))
{
string name = executableFile.Name;
int index = name.LastIndexOf('.');
if (index > 0)
{
name = name.Substring(0, index);
}
m_displayName = name;
}
}