Пример #1
0
        public override void CheckTask()
        {
            // +-----------------------------------------------------+
            // |                    |  Platform      | Major | Minor |
            // +-----------------------------------------------------+
            // | Windows 95         |  Win32Windows  |   4   |   0   |
            // | Windows 98         |  Win32Windows  |   4   |  10   |
            // | Windows Me         |  Win32Windows  |   4   |  90   |
            // | Windows NT 4.0     |  Win32NT       |   4   |   0   |
            // | Windows 2000       |  Win32NT       |   5   |   0   |
            // | Windows XP         |  Win32NT       |   5   |   1   |
            // | Windows 2003       |  Win32NT       |   5   |   2   |
            // | Windows Vista      |  Win32NT       |   6   |   0   |
            // | Windows 2008       |  Win32NT       |   6   |   0   |
            // | Windows 7          |  Win32NT       |   6   |   1   |
            // | Windows 2008 R2    |  Win32NT       |   6   |   1   |
            // | Windows 8          |  Win32NT       |   6   |   2   |
            // | Windows 8.1        |  Win32NT       |   6   |   3   |
            // | Windows 10         |  Win32NT       |  10   |   0   |
            // +-----------------------------------------------------+
            //
            // There is no issue with Windows 10 or later, because
            // Windows 10 will install drivers and software automatically.
            //
            var version = IssueHelper.GetRealOSVersion();

            if (version.Major >= 10)
            {
                SetSeverity(IssueSeverity.None, 0, program1);
                return;
            }
            var extra = "";

            // If Windows 8 then...
            if (version.Major == 6 && (version.Minor == 2 || version.Minor == 3))
            {
                extra = "\r\n\r\n" +
                        "If you’re having trouble with the X360 controller, you can install Windows 7 controller software on a Windows 8.x PC. " +
                        "Download Windows 7 program that matches the processor on your computer (32-bit or 64-bit). " +
                        "In the downloads location on your PC, right-click the downloaded program and select Properties. " +
                        "On the Compatibility tab, select the Run this program in compatibility mode for CheckBox. " +
                        "Select Windows 7 from the DropDown list. " +
                        "Select Apply, and then select OK. Double-click the program to run it. " +
                        "The Xbox 360 Accessories Setup program installs the necessary files on the computer. " +
                        "You might be prompted to restart when finished.";
            }
            var installed = IssueHelper.IsInstalled(program1, false);

            if (!installed)
            {
                SetSeverity(
                    IssueSeverity.Critical, 1,
                    string.Format("Please install {0} ({1}) drivers and software.{2}",
                                  program1, Environment.Is64BitOperatingSystem ? "64-bit" : "32-bit", extra)
                    );
                return;
            }
            SetSeverity(IssueSeverity.None, 0, program1);
        }
Пример #2
0
        public override void CheckTask()
        {
            if (!enableCheck)
            {
                return;
            }
            // +-----------------------------------------------------+
            // |                    |  Platform      | Major | Minor |
            // +-----------------------------------------------------+
            // | Windows 95         |  Win32Windows  |   4   |   0   |
            // | Windows 98         |  Win32Windows  |   4   |  10   |
            // | Windows Me         |  Win32Windows  |   4   |  90   |
            // | Windows NT 4.0     |  Win32NT       |   4   |   0   |
            // | Windows 2000       |  Win32NT       |   5   |   0   |
            // | Windows XP         |  Win32NT       |   5   |   1   |
            // | Windows 2003       |  Win32NT       |   5   |   2   |
            // | Windows Vista      |  Win32NT       |   6   |   0   |
            // | Windows 2008       |  Win32NT       |   6   |   0   |
            // | Windows 7          |  Win32NT       |   6   |   1   |
            // | Windows 2008 R2    |  Win32NT       |   6   |   1   |
            // | Windows 8          |  Win32NT       |   6   |   2   |
            // | Windows 8.1        |  Win32NT       |   6   |   3   |
            // | Windows 10         |  Win32NT       |  10   |   0   |
            // +-----------------------------------------------------+
            //
            //
            // Issue applies to windows 7 only.
            var version = IssueHelper.GetRealOSVersion();

            if (version.Major != 6 || version.Minor != 1)
            {
                SetSeverity(IssueSeverity.None, 0, program);
                enableCheck = false;
                return;
            }
            // KB3033929 supplies wintrust.dll 6.1.7601.22948, we need this version or later.
            var fileVersion = IssueHelper.GetFileVersion(Environment.SpecialFolder.System, "wintrust.dll");
            var installed   = fileVersion >= new Version(6, 1, 7601, 22948);

            if (!installed)
            {
                var bits = Environment.Is64BitOperatingSystem
                    ? "64-bit" : "32-bit";
                SetSeverity(
                    IssueSeverity.Critical, 1,
                    string.Format("Old WinTrust {0}. Install {1} for Windows 7 {2}", fileVersion, program, bits)
                    );
                return;
            }
            SetSeverity(IssueSeverity.None);
            enableCheck = false;
        }