Example #1
0
        static private void CreateNewOptionsFile()
        {
            var opt = new LaunchOptions
            {
                ModdedExe         = true,
                FixFile           = false,
                Gentool           = GentoolsMode.Current,
                DeleteOldVersions = true
            };

            var formatter = new XmlSerializer(typeof(LaunchOptions));

            using (var fs = new FileStream(EntryPoint.optionsName, FileMode.Create))
            {
                formatter.Serialize(fs, opt);
            }
        }
Example #2
0
        private static int StartExe(FormConfiguration conf, LaunchOptions options, bool worldBuilderLaunch)
        {
            Process process;

            if (worldBuilderLaunch)
            {
                process = Process.Start(EntryPoint.WorldBuilderFile);
                return(process.Id);
            }

            var parameters = "";

            if (conf.Windowed)
            {
                parameters += "-win ";
            }
            if (conf.QuickStart)
            {
                parameters += "-quickstart ";
            }
            if (conf.particleEdit)
            {
                parameters += "-particleEdit ";
            }
            if (conf.scriptDebug)
            {
                parameters += "-scriptDebug";
            }


            if (!options.ModdedExe)
            {
                process = Process.Start(EntryPoint.GameFile, parameters);
            }
            else
            {
                process = Process.Start(EntryPoint.ModdedGameFile, parameters);
            }


            return(process.Id);
        }