Пример #1
0
        public void UpdateClient()
        {
            var updateServer = new UpdateServer(Address);

            if (!updateServerService.HasConnect(updateServer.Address))
            {
                return;
            }

            var client = new Client(clientService.GetClientVersionFromSystemRegistry());

            updateServer.Installers = updateServerService.GetInstallers(updateServer);

            var installer = updateServerService.GetLatestInstaller(updateServer);

            if (updateServerService.IsNewVersionAvailable(client.Version, installer.Version))
            {
                Thread.Sleep(1000);

                ShowInfoAboutNewVersionAvailable();

                updateServerService.DownloadNewClientVersion(updateServer, installer);

                EndProcess("TEK.Client.exe");

                RunInstaller(installer);

                EndProcess("TEK.Updater.exe");
            }
        }
Пример #2
0
        public void NewVersionAvailableTest(string clientVersion, string installerVersion)
        {
            // given
            var client    = new Version(clientVersion);
            var installer = new Version(installerVersion);

            // when
            bool isNew = updateServerService.IsNewVersionAvailable(client, installer);

            // then
            Assert.AreEqual(true, isNew);
        }