private string ExtractPackageFiles(string packageFilePath, ManifestReport manifestReport)
        {
            if (!System.IO.File.Exists(packageFilePath))
            {
                logger.Warn(manifestReport.SetError("Could not report on deployment as ship cannot find pacakge file at " + packageFilePath).Error);
                return(null);
            }

            if (SessionTempDirectory != null)
            {
                CleanSessionTempDirectory();
            }
            var guid = Guid.NewGuid();

            SessionTempDirectory = tempDirectory + guid + "\\";
            System.IO.Directory.CreateDirectory(SessionTempDirectory);

            ExtractedTempPackagePath = SessionTempDirectory + "package." + guid + ".zip";
            if (!Utilities.UnzipTargetFile(packageFilePath, "package.zip", ExtractedTempPackagePath))
            {
                logger.Error(manifestReport.SetError("Could not report on deployment as ship cannot find package zip in the update file at " + packageFilePath).Error);
                return(null);
            }

            try
            {
                UnzipPackageFiles(ExtractedTempPackagePath, SessionTempDirectory);
            }
            catch (Exception ex)
            {
                logger.Error(manifestReport.SetError("Could not report on deployment as ship cannot unzip all files in " + packageFilePath + ". " + ex.Message).Error);
                return(null);
            }

            return(SessionTempDirectory);
        }
        private XmlDocument LoadManifestFile(string manifestFilePath, ManifestReport manifestReport)
        {
            manifestFilePath += this.manifestFilePath.Split(new char[] { '/', '\\' }).Last();

            if (!System.IO.File.Exists(manifestFilePath))
            {
                logger.Warn("Could not report on deployment as ship cannot find manifest file at " + manifestFilePath);
                return(null);
            }

            var manifestFile = new XmlDocument();

            manifestFile.Load(manifestFilePath);

            if (manifestFile.ChildNodes.Count == 0)
            {
                logger.Warn(manifestReport.SetError("Ship's manifest file appears to be blank at " + manifestFilePath).Error);
                return(null);
            }

            return(manifestFile);
        }