ShortWlf / fx-od-pub

fx od server public bug report repository
2 stars 0 forks source link

Custom FiveM Launcher #26

Closed ShortWlf closed 2 years ago

ShortWlf commented 3 years ago

Custom FiveM Launcher

ShortWlf commented 3 years ago

will make custom skins be a thing

ShortWlf commented 3 years ago

need to remake how updates are pushed, fivem dont allow modified gta 5 files, just need to revert the modded rpf file before an update is committed

ShortWlf commented 3 years ago

Form1

           if (File.Exists(updatetxt))
            {
                Console.WriteLine("CHECKING UPDATES");
                var regi = new Regex(@"VERSION:\s*([0-9]*)");
                string need = "blank";
                bool found = false;

                using (StreamReader reader = new StreamReader(updatetxt))
                {
                    string line;
                    while ((line = reader.ReadLine()) != null)
                    {
                        var match = regi.Match(line);
                        if (match.Groups.Count == 2)
                        {
                            if (match.Groups[1].Value == need)
                            {
                                Console.WriteLine("NEW UPDATE AVAILABLE!");
                                string link;
                                webBrowser1.ScrollBarsEnabled = true;
                                webBrowser1.AllowNavigation = true;
                                webBrowser1.AllowWebBrowserDrop = false;
                                webBrowser1.ScriptErrorsSuppressed = true;
                                link = "blank";
                                webBrowser1.Url = new Uri(link);
                                webBrowser1.Navigate(link);
                                //MessageBox.Show("NEW UPDATE AVAILABLE!");
                                button14.Visible = true;

                                var destFile2 = new FileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "FiveMODL\\7za.exe"));
                                // NOTE: FileDownloader is IDisposable!

                                FileDownloader fileDownloader = new FileDownloader();
                                fileDownloader.DownloadFileAsync("blank", destFile2.FullName);

                                Form6 login = new Form6();
                                {
                                    login.Show();
                                }

                                found = true;
                                break;
                            }
                        }
                    }
                }