/// <summary>
        /// Check for agent update. It will trigger agent update if the desired version is different than the current running version.
        /// </summary>
        internal async Task CheckAgentUpdates()
        {
            _logger?.LogDebug($"Running package updater. Downloading {PackageVersion}.");
            PackageVersionInfo packageVersion = await GetPackageVersionInformation();

            var     desiredVersion   = UpdateUtility.ParseVersion(packageVersion.Version);
            Version installedVersion = GetInstalledVersion();

            if (desiredVersion.CompareTo(installedVersion) != 0)
            {
                _logger?.LogInformation($"The desired version of {desiredVersion} is different to installed version {installedVersion}.");
                await packageInstaller.DownloadAndInstallNewVersionAsync(packageVersion);
            }
        }