static void Main(string[] args) { Arguments arguments = new Arguments(args); bool install = Convert.ToBoolean(arguments["install"]); bool countUpdates = Convert.ToBoolean(arguments["countUpdates"]); bool showProgress = Convert.ToBoolean(arguments["showProgress"]); WUAManager wua = new WUAManager(); try { if (install) { wua.Start(showProgress); } else if (countUpdates) { wua.CountPendingUpdates(); } else { ShowHelp(); return; } } catch (Exception ex) { Console.WriteLine("WUA_InternalError:{0}", ex.Message); } }
static void Main(string[] args) { Arguments arguments = new Arguments(args); bool install = Convert.ToBoolean(arguments["install"]); bool showProgress = Convert.ToBoolean(arguments["showProgress"]); if (!install) { ShowHelp(); return; } WUAManager wua = new WUAManager(); try { wua.Start(showProgress); } catch (Exception ex) { Console.WriteLine("WUA_InternalError:{0}", ex.Message); } }