Ejemplo n.º 1
0
 private void btnBuildHFS0_Click(object sender, EventArgs e)
 {
     clearReadData();
     if (!prepareInOutDialogs())
     {
         try
         {
             HFS0Manager.BuildHFS0(inDirDialog.SelectedPath, outFileDialog.FileName);
             MessageBox.Show("Sucessfully build the file!");
             System.Diagnostics.Process.Start("explorer.exe", "/select, \"" + outFileDialog.FileName + "\"");
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.ToString());
         }
     }
     else
     {
         MessageBox.Show("Error when setting the paths!");
     }
 }
Ejemplo n.º 2
0
        private void btnAutoXCI_Click(object sender, EventArgs e)
        {
            clearReadData();
            if (!prepareInOutDialogs(Environment.CurrentDirectory, "XCI-File|*.xci"))
            {
                try
                {
                    string inPath  = Path.Combine(inDirDialog.SelectedPath);
                    string outPath = Path.Combine(outFileDialog.FileName);
                    string tmpPath = Path.Combine(inPath, "root_tmp");
                    Directory.CreateDirectory(tmpPath);

                    HFS0Manager.BuildHFS0(Path.Combine(inPath, "secure"), Path.Combine(tmpPath, "secure"));
                    HFS0Manager.BuildHFS0(Path.Combine(inPath, "normal"), Path.Combine(tmpPath, "normal"));
                    HFS0Manager.BuildHFS0(Path.Combine(inPath, "update"), Path.Combine(tmpPath, "update"));
                    if (Directory.Exists(Path.Combine(inPath, "logo")))
                    {
                        HFS0Manager.BuildHFS0(Path.Combine(inPath, "logo"), Path.Combine(tmpPath, "logo"));
                    }
                    HFS0Manager.BuildHFS0(tmpPath, Path.Combine(inPath, "root.hfs0"));

                    XCIManager.BuildXCI(inPath, outPath);

                    File.Delete(Path.Combine(inPath, "root.hfs0"));
                    Directory.Delete(tmpPath, true);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            }
            else
            {
                MessageBox.Show("Error when setting the paths!");
            }
        }