Пример #1
0
        public static void RunElswordLauncher()
        {
            // for the sake of sanity and the need to disable the pack, unpack, and test mods
            // buttons in UI while updating game.
            if (File.Exists(SettingsFile.Path))
            {
                SettingsFile.Settingsxml?.ReopenFile();
                ElsDir = SettingsFile.Settingsxml?.TryRead("ElsDir");
                if (ElsDir.Length > 0)
                {
                    if (File.Exists($"{ElsDir}\\voidels.exe"))
                    {
                        RunningElsword = true;
                        using (var proc = new Process())
                        {
                            _ = proc.Shell($"{ElsDir}\\voidels.exe", string.Empty, false, false, false, false, ProcessWindowStyle.Normal, ElsDir, true);
                        }

                        RunningElsword = false;
                    }
                    else
                    {
                        if (File.Exists($"{ElsDir}\\elsword.exe"))
                        {
                            RunningElsword = true;
                            using (var proc = new Process())
                            {
                                _ = proc.Shell($"{ElsDir}\\elsword.exe", string.Empty, false, false, false, false, ProcessWindowStyle.Normal, ElsDir, true);
                            }

                            RunningElsword = false;
                        }
                        else
                        {
                            KOMManager.InvokeMessageEvent(typeof(ExecutionManager), new MessageEventArgs($"Can't find '{ElsDir}{Path.DirectorySeparatorChar}elsword.exe'. Make sure the File Exists and try to update Elsword Again!", Resources.Error, ErrorLevel.Error));
                            ProcessExtensions.Executing = false;
                        }
                    }
                }
                else
                {
                    KOMManager.InvokeMessageEvent(typeof(ExecutionManager), new MessageEventArgs("The Elsword Directory Setting is not set. Make sure to Set your Elsword Directory Setting and try to update Elsword Again!", Resources.Error, ErrorLevel.Error));
                    ProcessExtensions.Executing = false;
                }
            }
            else
            {
                KOMManager.InvokeMessageEvent(typeof(ExecutionManager), new MessageEventArgs("The Elsword Directory Setting is not set. Make sure to Set your Elsword Directory Setting and try to update Elsword Again!", Resources.Error, ErrorLevel.Error));
                ProcessExtensions.Executing = false;
            }
        }
Пример #2
0
        public static void RunElswordDirectly()
        {
            if (File.Exists(SettingsFile.Path))
            {
                SettingsFile.Settingsxml?.ReopenFile();
                ElsDir = SettingsFile.Settingsxml?.TryRead("ElsDir");
                if (ElsDir.Length > 0)
                {
                    if (File.Exists($"{ElsDir}\\data\\x2.exe"))
                    {
                        RunningElswordDirectly = true;
                        using (var proc = new Process())
                        {
                            _ = proc.Shell($"{ElsDir}\\data\\x2.exe", "pxk19slammsu286nfha02kpqnf729ck", false, false, false, false, ProcessWindowStyle.Normal, $"{ElsDir}\\data\\", true);
                        }

                        RunningElswordDirectly = false;
                    }
                    else
                    {
                        KOMManager.InvokeMessageEvent(typeof(ExecutionManager), new MessageEventArgs($"Can't find '{ElsDir}\\data\\x2.exe'. Make sure the File Exists and try to Test your mods Again!", Resources.Error, ErrorLevel.Error));
                        ProcessExtensions.Executing = false;
                    }
                }
                else
                {
                    KOMManager.InvokeMessageEvent(typeof(ExecutionManager), new MessageEventArgs("The Elsword Directory Setting is not set. Make sure to Set your Elsword Directory Setting and try to Test your mods Again!", Resources.Error, ErrorLevel.Error));
                    ProcessExtensions.Executing = false;
                }
            }
            else
            {
                KOMManager.InvokeMessageEvent(typeof(ExecutionManager), new MessageEventArgs("The Elsword Directory Setting is not set. Make sure to Set your Elsword Directory Setting and try to Test your mods Again!", Resources.Error, ErrorLevel.Error));
                ProcessExtensions.Executing = false;
            }
        }