不灬赖

自律>>自由>>自信

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

[Code]

// 检查安装路径是否是英文
function IsEnglishStr(file: String): Boolean;
var
  value: Integer;
  len: Integer;
  i: Integer;
begin
  Result := true;
  len := length(file);
for i := 1 to len do
  begin
  // 将字符转成ascii值
  value := ord(file[i]);
  // 根据字符的ascii码值判断字符是否为中文
  if (value < 41) or (value > 122) then
    begin
      Result := false;
    end;
  end;
end;

// 选择安装路径下一步按钮触发事件,返回false则不会跳到下一步
function NextButtonClick(CurPageID:Integer):Boolean;
begin
  Result := True;
  if (CurPageID = wpSelectDir) then
    begin
    if(IsEnglishStr(WizardDirValue) = false) then
      begin
      Result := False;
      MsgBox('Install folder is invalid !', mbError, MB_OK);
      end;
    end;
end;

posted on 2020-04-26 16:47  不灬赖  阅读(623)  评论(0编辑  收藏  举报