zoukankan      html  css  js  c++  java
  • 注册Dev的帮助文件

    Download the CHM files from…

    Code:
     
    https://www.devexpress.com/Support/Documentation/download.xml?platform=vcl-dev-docs#content

    …and unpack the files anywhere. The code below registers all CHM files. Just create a small vcl application, drop a button and paste the code.

    Code:
     
    uses
      System.Win.Registry,
      System.IOUtils,
      System.Types;
    
    function RegisterHelpFiles(const Path: string; const DeleteKey: Boolean): Integer;
    const
      CHtmlHelpRoot = 'SOFTWAREEmbarcaderoBDS17.0HelpHtmlHelp1Files';
    var
      Files: TStringDynArray;
      FileName: string;
      Reg: TRegistry;
      Name: string;
    begin
      Files := TDirectory.GetFiles(Path, '*.chm');
      if (Length(Files) = 0) then
        Exit(0);
    
      Reg := TRegistry.Create();
      try
        Result := 0;
        Reg.RootKey := HKEY_CURRENT_USER;
        if (Reg.OpenKey(CHtmlHelpRoot, False)) then
        begin
          for FileName in Files do
          begin
            Name := Concat(TPath.GetFileNameWithoutExtension(FileName), ' Help');
            if (DeleteKey) then
            begin
              if (Reg.DeleteValue(Name)) then
                Inc(Result);
            end
            else
            begin
              Reg.WriteString(Name, FileName);
              Inc(Result);
            end;
          end;
        end;
      finally
        Reg.Free();
      end;
    end;
    
    procedure TMainForm.Button1Click(Sender: TObject);
    var
      Path: string;
      DeleteKey: Boolean;
      Count: Integer;
    begin
      Path := '[Insert the Path of the DevExpress Help Files]';
    
      DeleteKey := False;
      Count := RegisterHelpFiles(Path, DeleteKey);
    
      //Setting to unregister the CHM files
      //DeleteKey := True;
      //Count := RegisterHelpFiles(Path, DeleteKey);
    
      ShowMessage(Format('Entries changed: %d', [Count]));
    end;

    Replace the placeholder "[Insert the Path of the DevExpress Help Files]" with the path where the CHM files was unpacked. Compile and run the method "RegisterHelpFiles(…)". All CHM from the path will be registered. Please don't forget to restart Delphi, before you use the DevExpress Help Files.

    This procedure should also work for Delphi XE8, but the Registry key must be adapted in this case.

    https://www.board4allcz.eu/showthread.php?t=625889

  • 相关阅读:
    客户数据库出现大量cache buffer chains latch
    Oracle 表空间与数据文件
    一些优秀的个人空间
    DBMS_STATS.GATHER_TABLE_STATS详解
    C#获取主程序目录的方法
    python 里的 continue 和 break 语法理解
    Python 打印九九乘法表
    数据可视化平台 Apache Superset 安装
    jinja2.Markup 对HTML文本文件进行处理
    Chrome Console 控制台使用指南
  • 原文地址:https://www.cnblogs.com/findumars/p/5356698.html
Copyright © 2011-2022 走看看