/// <summary>
        /// Fetches the json file from the web and parses it.
        /// </summary>
        private static void FetchVersion()
        {
            ConsoleWrapper.PrintMessage("Fetching master list from: http://www.vanilla-remastered.com/files/latest.json",
                                        ConsoleWrapper.PrintStatus.Normal);

            var versionObjRaw = GetFileViaHttpString("http://www.vanilla-remastered.com/files/latest.json");
            var update        = JsonConvert.DeserializeObject <UpdateData>(versionObjRaw);
        }
        /// <summary>
        ///  removes the older version.
        /// </summary>
        /// <param name="codeName"></param>
        public static void RemoveOlderUpdate(string codeName)
        {
            string file_120 = Properties.Resources.VR12Files;
            string file_130 = Properties.Resources.VR13Files;


            string path = VRegistry.GetSubKeyValue("Path").ToString();

            if (codeName == "1.2.0")
            {
                var lines = file_120.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
                foreach (var line in lines)
                {
                    string pathDel = path + "\\" + line;

                    if (File.Exists(pathDel))
                    {
                        File.SetAttributes(pathDel, FileAttributes.Normal);
                        File.Delete(pathDel);

                        ConsoleWrapper.PrintMessage("Deleting previous data chunk (" + pathDel + ")",
                                                    ConsoleWrapper.PrintStatus.Warning);
                    }
                    else
                    {
                        ConsoleWrapper.PrintMessage("Skipping file " + pathDel, ConsoleWrapper.PrintStatus.Normal);
                    }
                }
            }

            if (codeName == "1.3.0")
            {
                var lines = file_130.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
                foreach (var line in lines)
                {
                    string pathDel = path + "\\" + line;

                    if (File.Exists(pathDel))
                    {
                        File.SetAttributes(pathDel, FileAttributes.Normal);
                        File.Delete(pathDel);

                        ConsoleWrapper.PrintMessage("Deleting previous 1.3.0 data chunk (" + pathDel + ")",
                                                    ConsoleWrapper.PrintStatus.Warning);
                    }
                    else
                    {
                        ConsoleWrapper.PrintMessage("Skipping file " + pathDel, ConsoleWrapper.PrintStatus.Normal);
                    }
                }
            }
        }
Exemple #3
0
        private void materialButton1_Click(object sender, EventArgs e)
        {
            if (!isVersionMenuOpen)
            {
                installComboBox.Show();
                noteLbl.Show();
                isVersionMenuOpen = true;
            }

            if (isVersionMenuOpen && installComboBox.SelectedIndex != -1)
            {
                ConsoleWrapper.PrintMessage("Installing " + installComboBox.SelectedItem.ToString(), ConsoleWrapper.PrintStatus.Normal);
                MessageBox.Show(installComboBox.SelectedItem.ToString());
            }
        }
        private static void Main()
        {
            ConsoleWrapper.PrintAsciiSignature();
            ConsoleWrapper.PrintMessage("Starting Vanilla Remastered ...", ConsoleWrapper.PrintStatus.Normal);
            ConsoleWrapper.PrintMessage("Launching AppCenter Analytics ...", ConsoleWrapper.PrintStatus.Normal);

            SetCountryCode();
            AppCenter.LogLevel = LogLevel.Verbose;
            AppCenter.Start("316d7e4c-746c-4693-8c6f-c07a5ebde789",
                            typeof(Analytics), typeof(Crashes));


            ConsoleWrapper.PrintMessage("Launching User Interface ... ", ConsoleWrapper.PrintStatus.Normal);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainWindow());
        }