Пример #1
0
        private void btnDownload_Click(object sender, EventArgs e)
        {
            string str  = "";
            string str2 = "";

            if (this.type == "app")
            {
                str  = "changelog_build_1200.bin";
                str2 = "changelog_build_1200.bin";
            }
            else if (this.type == "db")
            {
                str  = "databases/changelog_db.bin";
                str2 = "changelog_db.bin";
            }
            else
            {
                str          = "databases/changelog_cmp.bin";
                str2         = "changelog_cmp.bin";
                this.CMPtype = apPatcherAppForm.cmpDownloadType.none;
                if (this.radioButtonUsrcheat.Checked)
                {
                    this.CMPtype = apPatcherAppForm.cmpDownloadType.USRcheat;
                }
                if (this.radioButtonCyclo.Checked)
                {
                    this.CMPtype = apPatcherAppForm.cmpDownloadType.CycloDS;
                }
                if (this.radioButtonEdge.Checked)
                {
                    this.CMPtype = apPatcherAppForm.cmpDownloadType.EDGE;
                }
                if (this.CMPtype == apPatcherAppForm.cmpDownloadType.none)
                {
                    MessageBox.Show("You must select which type of CMP Database you wish to install", "CMP Database Type Selection Required", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    this.close_blocked = true;
                    return;
                }
            }
            if (System.IO.File.Exists("data/temp/" + str2))
            {
                System.IO.File.Delete("data/" + str);
                System.IO.File.Move("data/temp/" + str2, "data/" + str);
            }
            else
            {
                MessageBox.Show("Error! A temporary changelog file was not found", "Update Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
            }
            this.close_blocked = false;
        }
Пример #2
0
        public void formSetup(string changeLogType, string newVersion)
        {
            this.close_blocked = false;
            this.CMPtype       = apPatcherAppForm.cmpDownloadType.none;
            this.type          = changeLogType;
            this.parent        = Program.form;
            string str    = "DS-Scene Rom Tool";
            string str2   = "";
            string saveas = "";

            if (this.type == "app")
            {
                str2   = "changelog_build_1200.bin";
                saveas = "changelog_build_1200.bin";
                this.groupBoxCMP.Visible = false;
            }
            else if (this.type == "db")
            {
                str2   = "databases/changelog_db.bin";
                saveas = "changelog_db.bin";
                this.groupBoxCMP.Visible = false;
            }
            else
            {
                str2   = "cmp/changelog_cmp.bin";
                saveas = "changelog_cmp.bin";
                this.groupBoxCMP.Visible         = true;
                this.radioButtonCyclo.Checked    = false;
                this.radioButtonEdge.Checked     = false;
                this.radioButtonUsrcheat.Checked = false;
                if (!Program.form.cmpCheckFile[0].update_available)
                {
                    this.radioButtonUsrcheat.Enabled = false;
                }
                else
                {
                    this.radioButtonUsrcheat.Enabled = true;
                }
                if (!Program.form.cmpCheckFile[1].update_available)
                {
                    this.radioButtonEdge.Enabled = false;
                }
                else
                {
                    this.radioButtonEdge.Enabled = true;
                }
                if (!Program.form.cmpCheckFile[2].update_available)
                {
                    this.radioButtonCyclo.Enabled = false;
                }
                else
                {
                    this.radioButtonCyclo.Enabled = true;
                }
            }
            this.Text = "DS-Scene Rom Tool v1.0 build 1215 Update Information";
            string url = "http://files-ds-scene.net/romtool/releases/" + str2;

            if (this.parent.downloadFile(url, "data/temp/", "Change Log", saveas, null, null))
            {
                if (this.type == "app")
                {
                    this.txtApplicationName.Text    = str + " Update";
                    this.txtApplicationNameNew.Text = str + " v" + newVersion;
                    this.updateTypeIcon.Image       = Resources.romtool;
                }
                else if (this.type == "db")
                {
                    this.txtApplicationName.Text    = "AP Database Update";
                    this.txtApplicationNameNew.Text = "offsets.dsapdb v" + newVersion;
                    this.updateTypeIcon.Image       = Resources.ap_icon;
                }
                else
                {
                    this.txtApplicationName.Text    = "CMP Database Update";
                    this.txtApplicationNameNew.Text = "version " + newVersion;
                    this.updateTypeIcon.Image       = Resources.cmp_icon;
                }
                this.showChangeLogInfo();
            }
            else
            {
                MessageBox.Show("Failed to download the latest changelog, please check your internet connection\r\nor the site may be down!", "Change Log Download Failure", MessageBoxButtons.OK, MessageBoxIcon.Hand);
            }
        }