Esempio n. 1
0
        protected override void Install(Stream updateStream)
        {
            string tempDir = null;

            try
            {
                using (var extractor = new SevenZip.SevenZipExtractor(updateStream))
                {
                    extractor.ExtractArchive(Path.GetTempPath());
                    tempDir = Path.Combine(Path.GetTempPath(), Path.GetFileNameWithoutExtension(UpdateRelativeUrl));
                }
                IOExt.MoveDirWithOverwrite(tempDir, MEDIA_PLAYER_PATH);
            }
            catch (SevenZip.SevenZipException x)
            {
                throw new UpdaterException(x.Message, x);
            }
            finally
            {
                if (tempDir != null && Directory.Exists(tempDir))
                {
                    Directory.Delete(tempDir, true);
                }
            }
        }
Esempio n. 2
0
        protected override void Install(Stream updateStream)
        {
            string tempDir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());

            try
            {
                using (var extractor = new ZipArchive(updateStream))
                    extractor.ExtractToDirectory(tempDir);

                IOExt.MoveDirWithOverwrite(tempDir, filterPath);
            }
            finally
            {
                if (Directory.Exists(tempDir))
                {
                    Directory.Delete(tempDir, true);
                }
            }
        }
Esempio n. 3
0
        protected override void Install(Stream updateDataStream)
        {
            string tempDir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());;

            try
            {
                using (var extractor = new ZipArchive(updateDataStream))
                    extractor.ExtractToDirectory(tempDir);

                IOExt.MoveDirWithOverwrite(Path.Combine(tempDir, FFMPEG_PATH), FFMPEG_PATH);
            }
            catch (InvalidDataException x)
            {
                throw new UpdaterException(x.Message, x);
            }
            finally
            {
                if (tempDir != null && Directory.Exists(tempDir))
                {
                    Directory.Delete(tempDir, true);
                }
            }
        }