/// <summary>
        /// Determines if the given <see cref="SoftwareUpdateInfo"/> can be used
        /// to update this installation of Path Copy Copy. We check for required
        /// Windows version as well as supported installation sources.
        /// </summary>
        /// <param name="updateInfo"><see cref="SoftwareUpdateInfo"/> to evaluate.</param>
        /// <returns><c>true</c> if this software update can be used.</returns>
        private bool CanBeUsed(SoftwareUpdateInfo updateInfo)
        {
            Debug.Assert(updateInfo != null);

            // Make sure we meet the minimum Windows requirement and the update
            // supports the installation source of our own installation.
            Debug.Assert(Environment.OSVersion.Platform == PlatformID.Win32NT);
            return((updateInfo.RequiredWindowsVersion.CompareTo(Environment.OSVersion.Version) <= 0) &&
                   (Array.IndexOf(updateInfo.InstallSources, userSettings.InstallSource) >= 0));
        }
Пример #2
0
        /// <summary>
        /// Determines if the given <see cref="SoftwareUpdateInfo"/> can be used
        /// to update this installation of Path Copy Copy. We check for required
        /// Windows version as well as supported installation sources.
        /// </summary>
        /// <param name="updateInfo"><see cref="SoftwareUpdateInfo"/> to evaluate.</param>
        /// <returns><c>true</c> if this software update can be used.</returns>
        private bool CanBeUsed(SoftwareUpdateInfo updateInfo)
        {
            if (updateInfo == null)
            {
                throw new ArgumentNullException(nameof(updateInfo));
            }

            // Make sure we meet the minimum Windows requirement and the update
            // supports the installation source of our own installation.
            Debug.Assert(Environment.OSVersion.Platform == PlatformID.Win32NT);
            return(updateInfo.RequiredWindowsVersion.CompareTo(Environment.OSVersion.Version) <= 0 &&
                   updateInfo.InstallSources.Contains(userSettings.InstallSource));
        }