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

  • 相关阅读:
    Linux 头文件详解
    Linux 进程运行状态
    配置uboot指定nfs挂载根文件系统
    (实例)Linux 内核添加exfat驱动
    Linux 内核 编译模块
    简单添加自己的驱动程序到Linux内核树中
    Linux 生成随机mac地址,并固化到本地
    (转)为什么ssh一关闭,程序就不再运行了?
    Ubuntu 安装 QtCreator (version : Qt 5.9.8)
    Ubuntu 固定自己的IP
  • 原文地址:https://www.cnblogs.com/findumars/p/5356698.html
Copyright © 2011-2022 走看看