Esempio n. 1
0
        private static async Task PerformOperation(DownloadRequestOptions o)
        {
            Logging.Log("Checking for updates...");

            CTAC   ctac  = new(o.ReportingSku, o.ReportingVersion, o.MachineType, o.FlightRing, o.FlightingBranchName, o.BranchReadinessLevel, o.CurrentBranch, o.ReleaseType, o.SyncCurrentVersionOnly, ContentType : o.ContentType);
            string token = string.Empty;

            if (!string.IsNullOrEmpty(o.Mail) && !string.IsNullOrEmpty(o.Password))
            {
                token = await MBIHelper.GenerateMicrosoftAccountTokenAsync(o.Mail, o.Password);
            }

            IEnumerable <UpdateData> data = await FE3Handler.GetUpdates(null, ctac, token, FileExchangeV3UpdateFilter.ProductRelease);

            data = data.Select(x => UpdateUtils.TrimDeltasFromUpdateData(x));

            foreach (UpdateData update in data)
            {
                await ProcessUpdateAsync(update, o.OutputFolder, o.MachineType, o.Language, o.Edition, true);

                //await BuildUpdateXml(update, o.MachineType);
            }
            Logging.Log("Completed.");
            if (Debugger.IsAttached)
            {
                Console.ReadLine();
            }
        }
Esempio n. 2
0
        internal static int ParseOptions(DownloadRequestOptions opts)
        {
            try
            {
                PerformOperation(opts).Wait();
            }
            catch (Exception ex)
            {
                Logging.Log("Something happened.", Logging.LoggingLevel.Error);
                Logging.Log(ex.Message, Logging.LoggingLevel.Error);
                Logging.Log(ex.StackTrace, Logging.LoggingLevel.Error);
                if (Debugger.IsAttached)
                {
                    Console.ReadLine();
                }
                return(1);
            }

            return(0);
        }