showver.pp 776 B

1234567891011121314151617181920212223242526272829303132333435
  1. program showversion;
  2. {$mode fpc}
  3. {$R showver.res}
  4. uses sysutils,fileinfo;
  5. Var version : TFileVersionInfo;
  6. I : longint;
  7. begin
  8. Version:=TFileVErsionInfo.create(Nil);
  9. Version.FileName:=paramstr(1);
  10. With Version do
  11. begin
  12. if Not FileExists(Paramstr(1)) then
  13. begin
  14. Writeln (Format('%s : No such file or directory',[Paramstr(1)]));
  15. Halt(1);
  16. end;
  17. FileName:=Paramstr(1);
  18. If VersionStrings.Count=0 then
  19. begin
  20. Writeln (Format('%s : No version information found.',[paramstr(1)]));
  21. Halt(2);
  22. end;
  23. For i:=0 to VersionStrings.Count-1 do
  24. Writeln (VersionCategories[I],'=',VersionStrings[i]);
  25. free;
  26. end;
  27. end. $Log$
  28. end. Revision 1.2 2000-07-13 11:33:04 michael
  29. end. + removed logs
  30. end.
  31. }