Esempio n. 1
0
        private static void PerformUpdate(string zipPath, string targetDir)
        {
            if (!UpdatingEngine.CheckForZip(zipPath))
            {
                throw new InvalidOperationException();
            }

            UpdatingEngine.CleanupDirectory(targetDir);
            UpdatingEngine.ExtractAsset(zipPath, targetDir);
        }
Esempio n. 2
0
        private static void Main(string[] args)
        {
            var handle = GetConsoleWindow();

#if DEBUG
            ShowWindow(handle, SW_SHOW);
#else
            ShowWindow(handle, SW_HIDE);
#endif
            if (args.Length < 3)
            {
                return;
            }

            _targetDirectory = args[0];
            _zipPath         = args[1];
            _appPath         = args[2];

            Console.WriteLine($"Target dir: {_targetDirectory}");
            Console.WriteLine($"Zip path: {_zipPath}");
            Console.WriteLine($"App path: {_appPath}");

            Thread.Sleep(1000);

            try
            {
                PerformUpdate(_zipPath, _targetDirectory);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
                Console.WriteLine(ex);
            }
            finally
            {
#if DEBUG
                Console.ReadKey();
#endif
                UpdatingEngine.OpenBaseApp(_appPath);
            }
        }