Remove the registery code from affdexme
This commit is contained in:
parent
e1013e2a3a
commit
7ff285adcd
1 changed files with 9 additions and 30 deletions
|
@ -139,25 +139,14 @@ namespace AffdexMe
|
||||||
|
|
||||||
private String GetClassifierDataFolder()
|
private String GetClassifierDataFolder()
|
||||||
{
|
{
|
||||||
// First see if we can get the Install Path from the registry
|
String affdexClassifierDir = Environment.GetEnvironmentVariable("AFFDEX_DATA_DIR");
|
||||||
RegistryKey rkCurrentUser = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32);
|
if (String.IsNullOrEmpty(affdexClassifierDir))
|
||||||
RegistryKey rkAffdexMe = rkCurrentUser.OpenSubKey("Software\\Affectiva\\AffdexMe");
|
|
||||||
String classifierPath = String.Empty;
|
|
||||||
if (rkAffdexMe != null && !String.IsNullOrEmpty((String)rkAffdexMe.GetValue("Install Directory")))
|
|
||||||
{
|
{
|
||||||
classifierPath = (String)rkAffdexMe.GetValue("Install Directory") + "\\data";
|
ShowExceptionAndShutDown("AFFDEX_DATA_DIR environment variable (Classifier Data Directory) is not set");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
String affdexClassifierDir = Environment.GetEnvironmentVariable("AFFDEX_DATA_DIR");
|
classifierPath = affdexClassifierDir;
|
||||||
if (String.IsNullOrEmpty(affdexClassifierDir))
|
|
||||||
{
|
|
||||||
ShowExceptionAndShutDown("AFFDEX_DATA_DIR environment variable (Classifier Data Directory) is not set");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
classifierPath = affdexClassifierDir;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DirectoryInfo directoryInfo = new DirectoryInfo(classifierPath);
|
DirectoryInfo directoryInfo = new DirectoryInfo(classifierPath);
|
||||||
|
@ -171,21 +160,11 @@ namespace AffdexMe
|
||||||
|
|
||||||
private String GetAffdexLicense()
|
private String GetAffdexLicense()
|
||||||
{
|
{
|
||||||
// First see if we can get the License from the registry
|
|
||||||
RegistryKey rkCurrentUser = Registry.LocalMachine;
|
|
||||||
RegistryKey rkAffdexMe = rkCurrentUser.OpenSubKey("Software\\Affectiva\\AffdexMe");
|
|
||||||
String licensePath = String.Empty;
|
String licensePath = String.Empty;
|
||||||
if ( rkAffdexMe != null && !String.IsNullOrEmpty((string)rkAffdexMe.GetValue("Install Directory")))
|
licensePath = Environment.GetEnvironmentVariable("AFFDEX_LICENSE_DIR");
|
||||||
|
if (String.IsNullOrEmpty(licensePath))
|
||||||
{
|
{
|
||||||
licensePath = (String)rkAffdexMe.GetValue("Install Directory");
|
ShowExceptionAndShutDown("AFFDEX_LICENSE_DIR environment variable (Affdex License Folder) is not set");
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
licensePath = Environment.GetEnvironmentVariable("AFFDEX_LICENSE_DIR");
|
|
||||||
if (String.IsNullOrEmpty(licensePath))
|
|
||||||
{
|
|
||||||
ShowExceptionAndShutDown("AFFDEX_LICENSE_DIR environment variable (Affdex License Folder) is not set");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test the directory
|
// Test the directory
|
||||||
|
@ -195,7 +174,7 @@ namespace AffdexMe
|
||||||
ShowExceptionAndShutDown("AFFDEX_License_DIR (Affex License Folder) is set to an invalid folder location");
|
ShowExceptionAndShutDown("AFFDEX_License_DIR (Affex License Folder) is set to an invalid folder location");
|
||||||
}
|
}
|
||||||
|
|
||||||
return licensePath + "\\affdex.license";
|
return licensePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
|
|
Loading…
Reference in a new issue