private string GetDestFilePath(ManifestFile manifestFile)
        {
            string dest = String.IsNullOrEmpty(manifestFile.InstallPath) ? this.manifest.InstallRoot : manifestFile.InstallPath;

            // resolve any tokens in the base path information
            string baseDestPath = this.reservedTokenResolver.Resolve(dest, this.manifest.InstallRoot);
            baseDestPath = this.environmentalTokenResolver.Resolve(baseDestPath);

            // ensure that files get installed into the correct location if they have specific InstallPath
            // irrespective of any folder structure within the manifest file.
            return Path.Combine(baseDestPath, String.IsNullOrEmpty(manifestFile.InstallPath) ? manifestFile.File : Path.GetFileName(manifestFile.File));
        }
Ejemplo n.º 2
0
        private void ExtractFile( SevenZipExtractor extractor, ManifestFile file)
        {
            using (var destFileStream = new FileStream(file.InstallPath, FileMode.Create, FileAccess.Write))
            {
                try
                {
                    extractor.ExtractFile(file.File, destFileStream);
                }
                catch (Exception exception)
                {
                }

                destFileStream.Flush();
                destFileStream.Close();
            }
        }