numer wersji, build

0

W opcjach projektu delphi mozna wkompilowac w execa numer wersji i ustawic automatyczne zwiekszanie nr build. a jak zrobic zeby w swoim oknie w stylu o programie... pokazac automatycznie generowany przez delphi numer build?

0
lukaszguzik napisał(a)

W opcjach projektu delphi mozna wkompilowac w execa numer wersji i ustawic automatyczne zwiekszanie nr build. a jak zrobic zeby w swoim oknie w stylu o programie... pokazac automatycznie generowany przez delphi numer build?

qrde, nie pamietam nazwy, ale kiedys mialem taki darmowy komponencik, ze zrodlami ktory podawal takie informacje... jakos TVersionInfo czy cos podobnego... poszukaj...

0

Użyj funkcji WINAPI: GetFileVersionInfo.

0
Szczawik napisał(a)

Użyj funkcji WINAPI: GetFileVersionInfo.
ale jak to zrobic? bo w winapi jestem zielony

0

Jak? Przeczytać opis na msdn'ie...

0

Masz tu kod:

function TForm1.GetFullFileVersion : string;
Var j,w   : Cardinal;
   s     : shortstring;
   buf   : pointer;
   buf2  : pointer;
   q     : DWord;
   vsinfo: ^VS_FIXEDFILEINFO;
   mVer,
   lVer,
   rVer,
   bVer,
   flag  : DWord;
begin
 s := ParamStr(0) + #0;
 j := GetFileVersionInfoSize(@s[1],w);
 if j = 0 then Exit;
 buf := Ptr(GlobalAlloc(GMEM_FIXED,j));
 GetFileVersionInfo(@s[1], 0, j, buf);
 VerQueryValue(buf, '\', buf2, q);
 vsinfo := buf2;
 mVer := vsInfo^.dwProductVersionMS div $FFFF;
 lVer := vsInfo^.dwProductVersionMS mod $10000;
 rVer := vsInfo^.dwProductVersionLS div $FFFF;
 bVer := vsInfo^.dwProductVersionLS mod $10000;
 flag := vsInfo^.dwFileFlags;
 s := IntToStr(mVer) + '.' +
      IntToStr(lVer) + '.' +
      IntToStr(rVer) + '.' +
      IntToStr(bVer);
 if (flag and VS_FF_DEBUG) > 0        then s := s + ' debug ';
 if (flag and VS_FF_PRERELEASE) > 0   then s := s + ' prerelease ';
 if (flag and VS_FF_PRIVATEBUILD) > 0 then s := s + ' private ';
 if (flag and VS_FF_SPECIALBUILD) > 0 then s := s + ' special ';
 Result := s;
 GlobalFree(Cardinal(buf));
end;

google widza wszystko. Wystarczy poszukać

0

albo poszukać bo było

0

Ja mam to zrobione tak:

1148 function GetVersionInfo: string;
1149 var
1150 S: string;
1151 VMajor, VMinor, VRelease, VBuild: integer;
1152 n, Len: DWORD;
1153 Buf: PChar;
1154 Value: PVSFixedFileInfo;
1155 VerH, VerL: integer;
1156 begin
1157 S := Application.ExeName;
1158 n := GetFileVersionInfoSize(PChar(S), n);
1159 if n > 0 then
1160 begin
1161 Buf := AllocMem(n);
1162 try
1163 if GetFileVersionInfo(PChar(S), 0, n, Buf) and VerQueryValue(Buf, '', Pointer(Value), Len) then
1164 begin
1165 VerH := Value.dwFileVersionMS;
1166 VerL := Value.dwFileVersionLS;
1167 VMajor := ($FFFF0000 and VerH) shr 16;
1168 VMinor := $0000FFFF and VerH;
1169 VRelease := ($FFFF0000 and VerL) shr 16;
1170 VBuild := $0000FFFF and VerL;
1171 result := Format('Version: %d.%d.%d (Build %d)', [VMajor, VMinor, VRelease, VBuild]);
1172 end;
1173 finally
1174 FreeMem(Buf, n);
1175 end;
1176 end;
1177 end;

0

dzieki wszystkim,ale sam tez znalazlem cos podobnego na google [wstyd] :-P

1 użytkowników online, w tym zalogowanych: 0, gości: 1