Ejemplo n.º 1
0
//---------------------------------------------------------------------------
void __fastcall RecordWrapperVersions(UnicodeString ConsoleVersion, UnicodeString DotNetVersion)
{
    TUpdatesConfiguration Updates = WinConfiguration->Updates;
    if (!DotNetVersion.IsEmpty())
    {
        Updates.DotNetVersion = DotNetVersion;
    }
    if (!ConsoleVersion.IsEmpty())
    {
        Updates.ConsoleVersion = ConsoleVersion;
    }
    WinConfiguration->Updates = Updates;

    if (Configuration->Storage == stNul)
    {
        Configuration->SetDefaultStorage();
        try
        {
            THierarchicalStorage * Storage = Configuration->CreateConfigStorage();
            try
            {
                Storage->AccessMode = smReadWrite;
                if (Storage->OpenSubKey(Configuration->ConfigurationSubKey, true) &&
                        Storage->OpenSubKey(L"Interface\\Updates", true, true))
                {
                    if (!DotNetVersion.IsEmpty())
                    {
                        Storage->WriteString(L"DotNetVersion", DotNetVersion);
                    }
                    if (!ConsoleVersion.IsEmpty())
                    {
                        Storage->WriteString(L"ConsoleVersion", ConsoleVersion);
                    }
                }
            }
            __finally
            {
                delete Storage;
            }
        }
        __finally
        {
            Configuration->SetNulStorage();
        }
    }
Ejemplo n.º 2
0
//---------------------------------------------------------------------------
void __fastcall TConfiguration::NeverShowBanner(const UnicodeString SessionKey,
  const UnicodeString & Banner)
{
  THierarchicalStorage * Storage = CreateScpStorage(false);
  try
  {
    Storage->AccessMode = smReadWrite;

    if (Storage->OpenSubKey(ConfigurationSubKey, true) &&
        Storage->OpenSubKey(L"Banners", true))
    {
      Storage->WriteString(SessionKey, BannerHash(Banner));
    }
  }
  __finally
  {
    delete Storage;
  }
}