internal static Boolean installAddon(this String addonPath)
{
string extractedAddonDir = extractAddonFile(addonPath);
try
{
foreach (string directory in Directory.GetDirectories(extractedAddonDir, "*", System.IO.SearchOption.TopDirectoryOnly))
{
FileSystem.MoveDirectory(Path.GetDirectoryName(directory),
Path.GetDirectoryName(Application.ExecutablePath),
UIOption.AllDialogs, UICancelOption.ThrowException);
}
if (Directory.Exists(extractedAddonDir)) Directory.Delete(extractedAddonDir, true);
return true;
}
catch (Exception)
{
if (Directory.Exists(extractedAddonDir)) Directory.Delete(extractedAddonDir, true);
return false;
}
}
}