public bool ExtractSolution(
            string solutionPackager,
            string solutionFile,
            string folder,
            SolutionPackager_PackageType packageType,
            string mappingFile,
            string sourceLoc,
            bool localize,
            bool treatWarningsAsErrors,
            string logsDirectory
            )
        {
            Logger.LogVerbose("Unpacking Solution: {0}", solutionFile);

            SolutionXml     solutionXml = new SolutionXml(Logger);
            XrmSolutionInfo info        = solutionXml.GetSolutionInfoFromZip(solutionFile);

            if (info == null)
            {
                throw new Exception("Invalid solution file");
            }

            Logger.LogInformation("Unpacking Solution Name: {0} - Version {1}", info.UniqueName, info.Version);

            SolutionNameGenerator generator = new SolutionNameGenerator();

            string zipFile = new FileInfo(solutionFile).Name;

            string log = string.Empty;

            if (!string.IsNullOrEmpty(logsDirectory))
            {
                log = $"{logsDirectory}\\PackagerLog_{zipFile.Replace(".zip", "")}_{DateTime.Now.ToString("yyyy_MM_dd__HH_mm")}.txt";
            }

            Logger.LogVerbose("log: {0}", log);

            SolutionPackager packager = new SolutionPackager(
                Logger,
                solutionPackager,
                solutionFile,
                folder,
                log
                );

            bool result = packager.Extract(
                packageType,
                mappingFile,
                true,
                true,
                false,
                sourceLoc,
                localize,
                treatWarningsAsErrors);

            return(result);
        }
        public bool PackSolution(
            string solutionPackager,
            string outputFolder,
            string folder,
            SolutionPackager_PackageType packageType,
            bool includeVersionInName,
            string mappingFile,
            bool treatWarningsAsErrors,
            bool incrementReleaseVersion,
            string version,
            string logsDirectory
            )
        {
            Logger.LogVerbose("Packing Solution from: {0}", folder);

            SolutionXml     solutionXml = new SolutionXml(Logger);
            XrmSolutionInfo info        = solutionXml.GetXrmSolutionInfoFromFolder(folder);

            if (info == null)
            {
                throw new Exception("Invalid solution file");
            }

            Logger.LogInformation("Packing Solution Name: {0} - Version {1}", info.UniqueName, info.Version);

            string newVersion;

            if (incrementReleaseVersion)
            {
                Logger.LogVerbose("Incrementing release version");

                int release = Int32.Parse(info.Version.Substring(info.Version.LastIndexOf(".") + 1));
                newVersion = $"{info.Version.Substring(0, info.Version.LastIndexOf(".") + 1)}{release + 1}";

                solutionXml.UpdateSolutionVersion(folder, newVersion);
            }
            else if (!string.IsNullOrEmpty(version))
            {
                Logger.LogInformation("Updating solution version to {0}", version);

                solutionXml.UpdateSolutionVersion(folder, version);

                newVersion = version;
            }
            else
            {
                newVersion = info.Version;
            }

            SolutionNameGenerator generator = new SolutionNameGenerator();

            string zipFile;
            bool   managed = packageType == SolutionPackager_PackageType.Managed;

            if (includeVersionInName)
            {
                zipFile = generator.GetZipName(
                    info.UniqueName,
                    newVersion,
                    managed);
            }
            else
            {
                zipFile = generator.GetZipName(
                    info.UniqueName,
                    string.Empty,
                    managed);
            }
            string zipFilePath = $"{outputFolder}\\{zipFile}";

            Logger.LogVerbose("zipFile: {0}", zipFilePath);

            string log = string.Empty;

            if (!string.IsNullOrEmpty(logsDirectory))
            {
                log = $"{logsDirectory}\\PackagerLog_{zipFile.Replace(".zip", "")}_{DateTime.Now.ToString("yyyy_MM_dd__HH_mm")}.txt";
            }

            Logger.LogVerbose("log: {0}", log);

            SolutionPackager packager = new SolutionPackager(
                Logger,
                solutionPackager,
                zipFilePath,
                folder,
                log
                );

            return(packager.Pack(
                       packageType,
                       mappingFile,
                       treatWarningsAsErrors));
        }