[Inno Setup] 对比字符串

 

[Code]
var
  MD5Comp: string;

procedure ExitProcess(uExitCode:UINT);
  external 'ExitProcess@kernel32.dll stdcall';

procedure CurStepChanged(CurStep: TSetupStep);
begin
  MD5Comp := '32297BCBF4D802298349D06AF5E28059';

  if CurStep = ssInstall then
  begin

   if MD5Comp <> GetMD5OfFile(ExpandConstant('{app}\cg.npa')) then
   begin
     MsgBox('A patched version detected. Setup will now exit.', mbInformation, MB_OK);
     ExitProcess(1);
   end;
  end;
end;

 

posted on 2019-03-14 17:38  liujx2019  阅读(944)  评论(0)    收藏  举报

导航