Ejemplo n.º 1
0
        public static async Task Main(string[] args)
        {
            var command = args.Length > 0 ? args[0] : null;

            // Print current assembly version
            if (command == "version" || command == null)
            {
                Console.WriteLine(Version);
            }
            // Update to latest version
            else if (command == "update")
            {
                var progressHandler = new Progress <double>(p => Console.WriteLine($"Progress: {p:P0}"));
                await UpdateManager.CheckPerformUpdateAsync(false, progressHandler);
            }
        }
Ejemplo n.º 2
0
        public static async Task Main(string[] args)
        {
            // Dump arguments to file.
            // This is only accurate enough for simple inputs.
            File.WriteAllLines(LastRunFilePath, args);

            // Get command name
            var command = args.FirstOrDefault();

            // Print current assembly version
            if (command == "version" || command == null)
            {
                Console.WriteLine(Version);
            }
            // Update to latest version
            else if (command == "update" || command == "update-and-restart")
            {
                var restart         = command == "update-and-restart";
                var progressHandler = new Progress <double>(p => Console.WriteLine($"Progress: {p:P0}"));

                await UpdateManager.CheckPerformUpdateAsync(restart, progressHandler);
            }
        }