Exemplo n.º 1
0
        private static void main(string[] args)
        {
            var options = ProcessOptions(args);

            if (options == null)
            {
                return;
            }

            if (options.VerboseMode)
            {
                Log.VerboseMode = true;
            }

            var cryptoInfo = new CryptoInfo(options);

            if (cryptoInfo.expectedDemoHash != ParsedD20RulesEngine.DemoHashOct2010)
            {
                Solve2009Version(options, ref cryptoInfo);
            }
            options.Oct2010 = cryptoInfo.expectedDemoHash == ParsedD20RulesEngine.DemoHashOct2010;

            var fileManager = new PartManager(options, cryptoInfo);

            Thread programThread = null;

            if (options.SetFileAssociations)
            {
                Utils.UpdateRegistry();
            }
            var uc = new UpdateChecker(null, options.Redirects);

            fileManager.DoUpdates(options.ForceUpdate, false, true, uc);
            if (options.CheckForUpdates && options.UpdateFirst)
            {
                fileManager.DoUpdates(options.ForceUpdate, false, false, uc);
            }
            fileManager.MergeFiles();
            if (options.CreateUpdateIndexFiles)
            {
                fileManager.GenerateUpdateIndexes();
            }
            if (options.LaunchBuilder)
            {
                programThread = ProcessLauncher.StartProcess(options, options.ExecArgs.ToArray(),
                                                             fileManager.MergedPath, fileManager.ChangelogPath);
            }
            if (options.CheckForUpdates && !options.UpdateFirst)
            {
                fileManager.DoUpdates(options.ForceUpdate, true, false, uc);
            }
            if (!options.CheckForUpdates)
            {
                Log.Warn("Updates are currently disabled");
            }
            if (programThread != null)
            {
                programThread.Join();
            }
        }
Exemplo n.º 2
0
        private static void main(string[] args)
        {
            var options = processOptions(args);

            if (options == null)
            {
                return;
            }

            if (options.VerboseMode)
            {
                Log.VerboseMode = true;
            }

            var cryptoInfo  = new CryptoInfo(options);
            var fileManager = new PartManager(options, cryptoInfo);

            Thread programThread = null;

            if (options.SetFileAssociations)
            {
                Utils.UpdateRegistry();
            }
            if (options.CheckForUpdates && options.UpdateFirst)
            {
                fileManager.DoUpdates(options.ForceUpdate, false);
            }
            fileManager.MergeFiles(options.ForceRemerge);
            if (options.CreateUpdateIndexFiles)
            {
                fileManager.GenerateUpdateIndexes();
            }
            if (options.LaunchBuilder)
            {
                programThread = ProcessLauncher.StartProcess(options, options.ExecArgs.ToArray(),
                                                             fileManager.MergedPath, fileManager.ChangelogPath);
            }
            if (options.CheckForUpdates && !options.UpdateFirst)
            {
                fileManager.DoUpdates(options.ForceUpdate, true);
            }
            if (programThread != null)
            {
                programThread.Join();
            }
        }