public static bool UnzipFileTo(string basePath, string zipFileName)
{
try
{
_log.DebugFormat("Unzipping {0}", Path.GetFileName(zipFileName));
FileUtilities.SafePathEnsure(basePath);
var zipFile = new ZipFile(zipFileName);
zipFile.ExtractAll(basePath, ExtractExistingFileAction.DoNotOverwrite);
_log.Debug("Unzipping... Done!");
if (Settings.ShowFilePaths)
{
_log.InfoFormat("Unzipped \"{0}\" to \"{1}\"", Path.GetFileName(zipFileName), basePath);
}
return true;
}
catch (Exception ex)
{
_log.Error("Error while unzipping file", ex);
}
return false;
}