Example #1
0
        private void revertPatch(string name)
        {
            if (name != "LARGE" && name != "SMALL" && name != "STORY")
            {
                MessageBox.Show("Wrong parameter given for installPatch (param: " + name + "), aborting!");
            }
            else
            {
                disableButtons();
                Globals.action  = name;
                Globals.install = false;
                Form installRevertWindow = new installRevertFiles();
                installRevertWindow.ShowDialog(this);
                checkFolders();

                if (name == "STORY")
                {
                    // Enable the Manual Installation button
                    manualInstallStoryPatchButton.Enabled = true;
                }
            }
        }
Example #2
0
        private void installPatch(string name)
        {
            bool proceedInstall = true;

            // If the client is outdated, and we're trying to install a patch
            if (Globals.clientOutdated)
            {
                // If we chose to get a notification, and have translated files installed, ask
                string       dialogue     = "Your client seems to be outdated. Please perform the PSO2 Update first by starting the PSO2 Launcher with the button below. After PSO2 is updated, please relaunch this application and you'll be able to install the Translation Files.";
                DialogResult dialogResult = MessageBox.Show(dialogue, "PSO2 Update Found");
                proceedInstall = false;
            }

            // Proceed installing, if we're allowed
            if (proceedInstall)
            {
                if (name != "LARGE" && name != "SMALL" && name != "STORY")
                {
                    MessageBox.Show("Wrong parameter given for installPatch (param: " + name + "), aborting!");
                }
                else
                {
                    disableButtons();
                    Globals.action  = name;
                    Globals.install = true;
                    Form installRevertWindow = new installRevertFiles();
                    installRevertWindow.ShowDialog(this);
                    checkFolders();

                    if (name == "STORY")
                    {
                        // Disable the Manual Installation button
                        manualInstallStoryPatchButton.Enabled = false;
                    }
                }
            }
        }
Example #3
0
        private void checkDownloader()
        {
            if (Globals.downloadLargePatch || Globals.downloadSmallPatch)
            {
                int  transNotifySetting = Globals.getIntFromString(Globals.getSetting("transNotifySettings"));
                bool doUpdate           = false;
                bool patchesInstalled   = false;

                if (largePatchInstallButton.Enabled == true || smallPatchInstallButton.Enabled == true || largePatchRevertButton.Enabled == true || smallPatchRevertButton.Enabled == true)
                {
                    patchesInstalled = true;
                }

                if (transNotifySetting == 1)
                {
                    string dialogueName = "";
                    string dialogue     = "";

                    if (patchesInstalled)
                    {
                        dialogueName = "Translation Files Update Found";
                        dialogue     = "A Translation File(s) update was found, would you like to Update?\n\n";
                        dialogue    += "Note: If you have the Translation Files installed, I will automatically revert their installation for you before updating.";
                    }
                    else
                    {
                        dialogueName = "Translation Files not found";
                        dialogue     = "You don't seem to have the Translated Files yet, would you like to download them?";
                    }

                    // If we chose to get a notification, and have translated files installed, ask
                    DialogResult dialogResult = MessageBox.Show(dialogue, dialogueName, MessageBoxButtons.YesNo);
                    if (dialogResult == DialogResult.Yes)
                    {
                        doUpdate = true;
                    }
                }
                else if (transNotifySetting == 2)
                {
                    // If we chose to have stuff automated, and have translated files installed, auto-revert and download new ones
                    doUpdate = true;
                }

                if (doUpdate)
                {
                    disableButtons();

                    // An update was found, if files were installed, we have to revert the files first
                    if (Globals.deleteLargeFilesOnFile == true)
                    {
                        Globals.action  = "LARGE";
                        Globals.install = false;
                        Form installRevertWindow = new installRevertFiles();
                        installRevertWindow.ShowDialog(this);
                    }

                    if (Globals.deleteSmallFilesOnFile == true)
                    {
                        Globals.action  = "SMALL";
                        Globals.install = false;
                        Form installRevertWindow = new installRevertFiles();
                        installRevertWindow.ShowDialog(this);
                    }

                    // Launch the downloader
                    Form downloadWindow = new downloadWindow();
                    downloadWindow.ShowDialog(this);

                    // Unrar the files
                    // Handle the large patch
                    if (Globals.downloadLargePatch)
                    {
                        Globals.rarType = "LARGE";
                        unrar(Globals.workDirectory + "data\\patch\\large\\" + Globals.latestLargePatchFileName, Globals.workDirectory + "data\\patch\\large\\files\\");
                    }

                    // Handle the small patch
                    if (Globals.downloadSmallPatch)
                    {
                        Globals.rarType = "SMALL";
                        unrar(Globals.workDirectory + "data\\patch\\small\\" + Globals.latestSmallPatchFileName, Globals.workDirectory + "data\\patch\\small\\files\\");
                    }

                    // Do some verify-checking
                    checkFolders();
                }
            }
        }