Example #1
0
        private void LoadFile(string fileName)
        {
            RCH2Container c;

            Status = String.Format("Loading {0}...", fileName);
            try
            {
                c = FurcadiaInstaller.GetFileContainer(fileName);
                if (c == null)
                {
                    MessageBox.Show("Unable to load data - make sure it is a Furcadia installer!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            rch2 = c;
            txtDragDrop.Visible   = false;
            txtInstallerName.Text = System.IO.Path.GetFileName(fileName);
            UpdateList();
            UpdateToolStrip(rch2 != null);
            Status = String.Format("Imported {0} files.", rch2.Count);
        }
Example #2
0
        // "Compare To..." button clicked.
        private void btnCompare_Click(object sender, EventArgs e)
        {
            RCH2Container rch2compare;

            // Get another installer from them.
            if (fdOpenInstaller.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }

            // Load the file.
            rch2compare = FurcadiaInstaller.GetFileContainer(fdOpenInstaller.FileName);
            if (rch2compare == null)
            {
                MessageBox.Show("Cannot load comparison file - make sure this is a Furcadia installer.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            // Display comparison dialog.
            RCH2Compare cmp = new RCH2Compare(ref rch2, ref rch2compare);

            if (cmp.Identical)
            {
                MessageBox.Show("The two files have identical install packages.", "Identical Packages", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            CompareForm cf = new CompareForm(ref cmp);

            cf.FileName1 = txtInstallerName.Text;
            cf.FileName2 = fdOpenInstaller.SafeFileName;
            cf.ShowDialog();
        }