Exemplo n.º 1
0
        public void FvOSDetails()
        {
            string sOSTemp = string.Empty; //I know

            sOSTemp = RegistryWOW6432.GetRegKey64(RegHive.HKEY_LOCAL_MACHINE, @"SOFTWARE\Microsoft\Windows NT\CurrentVersion", "ProductName");
            if (sOSTemp == "ERROR_FILE_NOT_FOUND")
            {
                sOSTemp = RegistryWOW6432.GetRegKey32(RegHive.HKEY_LOCAL_MACHINE, @"SOFTWARE\Microsoft\Windows NT\CurrentVersion", "ProductName");
                if (sOSTemp == "ERROR_FILE_NOT_FOUND")
                {
                    bWSUSInstalled = false;
                    Console.WriteLine("Something went wrong, unable to detect OS version. Probably my fault");
                    return;
                }
            }
            //So much Jank!
            sOSTemp = HEX2ASCII(sOSTemp);
            sOS     = ReverseString(sOSTemp);
        }
Exemplo n.º 2
0
        public void FvContentDirectory()
        {
            //Next revision, we'll make this a generic function
            string sContentDirectoryTemp = string.Empty;

            sContentDirectoryTemp = RegistryWOW6432.GetRegKey64(RegHive.HKEY_LOCAL_MACHINE, @"SOFTWARE\Microsoft\Update Services\Server\setup", "ContentDir");
            if (sContentDirectoryTemp == "ERROR_FILE_NOT_FOUND")
            {
                sContentDirectoryTemp = RegistryWOW6432.GetRegKey32(RegHive.HKEY_LOCAL_MACHINE, @"SOFTWARE\Microsoft\Update Services\Server\setup", "ContentDir");
                if (sContentDirectoryTemp == "ERROR_FILE_NOT_FOUND")
                {
                    bWSUSInstalled = false;
                    Console.WriteLine("Something went wrong, unable to detect SQL details from registry. Probably my fault");
                    return;
                }
            }
            sContentDirectoryTemp      = HEX2ASCII(sContentDirectoryTemp);
            sContentDirectoryTemp      = ReverseString(sContentDirectoryTemp);
            sLocalContentCacheLocation = Environment.ExpandEnvironmentVariables(sContentDirectoryTemp);
            return;
        }
Exemplo n.º 3
0
        public void FvDatabaseBaseName()
        {
            //Next revision, we'll make this a generic function
            string sDBServerTemp = string.Empty;

            sDBServerTemp = RegistryWOW6432.GetRegKey64(RegHive.HKEY_LOCAL_MACHINE, @"SOFTWARE\Microsoft\Update Services\Server\setup", "SqlServerName");
            if (sDBServerTemp == "ERROR_FILE_NOT_FOUND")
            {
                sDBServerTemp = RegistryWOW6432.GetRegKey32(RegHive.HKEY_LOCAL_MACHINE, @"SOFTWARE\Microsoft\Update Services\Server\setup", "SqlServerName");
                if (sDBServerTemp == "ERROR_FILE_NOT_FOUND")
                {
                    bWSUSInstalled = false;
                    Console.WriteLine("Something went wrong, unable to detect SQL details from registry. Probably my fault");
                    return;
                }
            }
            sDBServerTemp     = HEX2ASCII(sDBServerTemp);
            sDatabaseInstance = ReverseString(sDBServerTemp);

            //So Painful
            string sDBNameTemp = string.Empty; //I know

            sDBNameTemp = RegistryWOW6432.GetRegKey64(RegHive.HKEY_LOCAL_MACHINE, @"SOFTWARE\Microsoft\Update Services\Server\setup", "SqlDatabaseName");
            if (sDBNameTemp == "ERROR_FILE_NOT_FOUND")
            {
                sDBNameTemp = RegistryWOW6432.GetRegKey32(RegHive.HKEY_LOCAL_MACHINE, @"SOFTWARE\Microsoft\Update Services\Server\setup", "SqlDatabaseName");
                if (sDBNameTemp == "ERROR_FILE_NOT_FOUND")
                {
                    bWSUSInstalled = false;
                    Console.WriteLine("Something went wrong, unable to detect SQL details from registry. Probably my fault");
                    return;
                }
            }
            sDBNameTemp   = HEX2ASCII(sDBNameTemp);
            sDatabaseName = ReverseString(sDBNameTemp);
            return;
        }
Exemplo n.º 4
0
        public void FvCheckSSL()
        {
            //There is a better way to do this. NET4.0 is much easier but trying to keep it 3.5
            string sSSLTemp = string.Empty; //I know

            sSSLTemp = RegistryWOW6432.GetRegKey64(RegHive.HKEY_LOCAL_MACHINE, @"SOFTWARE\Microsoft\Update Services\Server\setup", "UsingSSL");
            if (sSSLTemp == "ERROR_FILE_NOT_FOUND")
            {
                sSSLTemp = RegistryWOW6432.GetRegKey32(RegHive.HKEY_LOCAL_MACHINE, @"SOFTWARE\Microsoft\Update Services\Server\setup", "UsingSSL");
                if (sSSLTemp == "ERROR_FILE_NOT_FOUND")
                {
                    bWSUSInstalled = false;
                    return;
                }
            }
            if (sSSLTemp == "01")
            {
                bSSL = true;
            }
            else
            {
                bSSL = false;
            }
        }