Example #1
0
            public void TryDecompress()
            {
                if (Info.IsCompressed())
                {
                    string basepath = Properties.Settings.Default.path_temp;
                    string filepath = basepath + @"\temp.bin";
                    string args     = string.Format(@"-d {0:s}", filepath);

                    // create temp file
                    File.WriteAllBytes(filepath, Data);

                    Console.WriteLine("calling decompressor for {0:s}", Name);

                    // call decompressor process
                    if (!Util.CallDecompressor(args))
                    {
                        throw new Exception(string.Format("ERROR: Couldn't decompress overlay '{0:s}'", Name));
                    }

                    // read decompressed result
                    Data = File.ReadAllBytes(filepath);

                    // cleanup
                    File.Delete(filepath);
                }
            }