#if SIMPLSHARP
using Crestron.SimplSharp;
#else
using System;
using System.IO.Compression;
#endif
namespace ICD.Common.Utils
{
///
/// Utils for managing archives.
///
public static class IcdZip
{
///
/// Unzips the archive at the given path.
///
///
///
public static bool Unzip(string path, string outputPath)
{
#if SIMPLSHARP
return CrestronZIP.Unzip(path, outputPath) == CrestronZIP.ResultCode.ZR_OK;
#else
try
{
using (ZipArchive archive = ZipFile.Open(path, ZipArchiveMode.Read))
archive.ExtractToDirectory(outputPath);
}
catch (Exception)
{
return false;
}
return true;
#endif
}
}
}