Re: ACFinder 140106test exeのみ
OhYeah!
投稿数: 983
オンライン

これって、どこがどう変わってるんでしょうか?
あと、140105test 版ともバージョン情報が 140103test になっています。バージョン情報ダイアログに TFileVerInfo コンポーネントを貼り付け、バージョンラベルのキャプションを次のように設定してやれば、リソースの製品バージョンを修正するだけでバージョン情報ダイアログは自動的に更新されます。
あと、140105test 版ともバージョン情報が 140103test になっています。バージョン情報ダイアログに TFileVerInfo コンポーネントを貼り付け、バージョンラベルのキャプションを次のように設定してやれば、リソースの製品バージョンを修正するだけでバージョン情報ダイアログは自動的に更新されます。
VersionLabel.Caption := FileVerInfo1.ProductVersion;
unit VerInfo;
interface
uses
Windows, SysUtils, Classes, StrUtils, Forms;
type
EFileVerInfoError = class(Exception);
TFileVerInfo = class(TComponent)
private { Private 宣言 }
FValid: boolean;
FPBuf: pointer;
FSize: DWORD;
FSub: string;
FPath: string;
function GetComments: string;
function GetCompanyName: string;
function GetFileDescription: string;
function GetFileVersion: string;
function GetInternalName: string;
function GetLegalCopyright: string;
function GetLegalTradeMarks: string;
function GetProductName: string;
function GetProductVersion: string;
function GetPrivateBuild: string;
function GetSpecialBuild: string;
procedure SetPath(TargetPath: string);
protected { protected 宣言 }
public { Public 宣言 }
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function GetInfo(Name: string): string;
property Valid: boolean read FValid;
property Comments: string read GetComments;
property CompanyName: string read GetCompanyName;
property FileDescription: string read GetFileDescription;
property FileVersion: string read GetFileVersion;
property InternalName: string read GetInternalName;
property LegalCopyright: string read GetLegalCopyright;
property LegalTradeMarks: string read GetLegalTradeMarks;
property ProductName: string read GetProductName;
property ProductVersion: string read GetProductVersion;
property PrivateBuild: string read GetPrivateBuild;
property SpecialBuild: string read GetSpecialBuild;
published { Published 宣言 }
property Path: string read FPath write SetPath;
end;
procedure Register;
function CopyrightSignToChar(Dst: string): string;
function RegisteredSignToChar(Dst: string): string;
function CopyrightCharToSign(Dst: string): string;
function RegisteredCharToSign(Dst: string): string;
implementation
procedure Register;
begin
RegisterComponents('Hidemi', [TFileVerInfo]);
end;
function CopyrightSignToChar;
begin
Result := AnsiReplaceText(Dst, #$A9, '(C)');
end;
function RegisteredSignToChar;
begin
Result := AnsiReplaceText(Dst, #$AE, '(R)');
end;
function CopyrightCharToSign;
begin
Result := AnsiReplaceText(Dst, '(C)', #$A9);
end;
function RegisteredCharToSign;
begin
Result := AnsiReplaceText(Dst, '(R)', #$AE);
end;
function TFileVerInfo.GetInfo;
var
len: DWORD;
pinfo: pointer;
begin
Result := '';
if not FValid then Exit;
VerQueryValue(FPBuf, PChar(FSub + Name), pinfo, len);
if len > 0 then Result := PChar(pinfo);
end;
function TFileVerInfo.GetComments;
begin
Result := GetInfo('Comments');
end;
function TFileVerInfo.GetCompanyName;
begin
Result := GetInfo('CompanyName');
end;
function TFileVerInfo.GetFileDescription;
begin
Result := GetInfo('FileDescription');
end;
function TFileVerInfo.GetFileVersion;
begin
Result := GetInfo('FileVersion');
end;
function TFileVerInfo.GetInternalName;
begin
Result := GetInfo('InternalName');
end;
function TFileVerInfo.GetLegalCopyright;
begin
Result := GetInfo('LegalCopyright');
end;
function TFileVerInfo.GetLegalTradeMarks;
begin
Result := GetInfo('LegalTradeMarks');
end;
function TFileVerInfo.GetProductName;
begin
Result := GetInfo('ProductName');
end;
function TFileVerInfo.GetProductVersion;
begin
Result := GetInfo('ProductVersion');
end;
function TFileVerInfo.GetPrivateBuild;
begin
Result := GetInfo('PrivateBuild');
end;
function TFileVerInfo.GetSpecialBuild;
begin
Result := GetInfo('SpecialBuild');
end;
procedure TFileVerInfo.SetPath;
type
TDWord = packed record Lo, Hi: word; end;
var
pinfo: pointer;
ret, len: DWORD;
begin
FPath := TargetPath;
if csDesigning in ComponentState then Exit;
FValid := false;
if FSize <> 0 then FreeMem(FPBuf, FSize);
if TargetPath = '' then FPath := Application.ExeName;
FSize := GetFileVersionInfoSize(PChar(FPath), ret);
if FSize = 0 then begin
raise EFileVerInfoError.Create('EFileVerInfoError: Cannot Get FileVerInfo Size');
Exit;
end;
try
GetMem(FPBuf, FSize);
except
FSize := 0;
raise EFileVerInfoError.Create('EFileVerInfoError: Insufficient Memory');
Exit;
end;
if not GetFileVersionInfo(PChar(FPath), 0, FSize, FPBuf) then begin
FreeMem(FPBuf, FSize);
FSize := 0;
raise EFileVerInfoError.Create('EFileVerInfoError: Cannot Get FileVerInfo');
Exit;
end;
if not VerQueryValue(FPBuf, '\VarFileInfo\Translation', pinfo, len) or (len = 0) then begin
FreeMem(FPBuf, FSize);
FSize := 0;
raise EFileVerInfoError.Create('EFileVerInfoError: Cannot Get FileVerInfo');
Exit;
end;
FSub := '\StringFileInfo\' + IntToHex(TDWord(pinfo^).Lo, 4) +
IntToHex(TDWord(pinfo^).Hi, 4) + '\';
FValid := true;
end;
constructor TFileVerInfo.Create;
begin
inherited Create(AOwner);
SetPath(FPath);
end;
destructor TFileVerInfo.Destroy;
begin
if FSize <> 0 then FreeMem(FPBuf, FSize);
inherited;
end;
end.
投票数:4
平均点:7.50
投稿ツリー
-
新 FRAC, IRAC, HRAC 公開 (OhYeah!, 2013.12.30 13:07)
-
Re: 新 FRAC, IRAC, HRAC 公開 (kabe, 2013.12.30 21:19)
-
Re: 新 FRAC, IRAC, HRAC 公開 (OhYeah!, 2013.12.30 22:32)
-
ACFinder 131230test exe のみ (kabe, 2013.12.30 23:52)
-
Re: ACFinder 131230test exe のみ (OhYeah!, 2013.12.31 01:24)
-
ACFinder 140102test exe のみ (kabe, 2014.01.02 22:31)
-
Re: ACFinder 140102test exe のみ (OhYeah!, 2014.01.04 00:57)
-
Re: ACFinder 140102test exe のみ (OhYeah!, 2014.01.04 12:19)
-
ACFinder 140105test exe のみ (kabe, 2014.01.05 22:02)
-
Re: ACFinder 140105test exe のみ (OhYeah!, 2014.01.06 15:54)
-
Re: ACFinder 140105test exe のみ (OhYeah!, 2014.01.06 16:19)
-
ACFinder 140106test exeのみ (kabe, 2014.01.06 22:30)
-
Re: ACFinder 140106test exeのみ (OhYeah!, 2014.01.06 23:03)
-
Re: ACFinder 140106test exeのみ (kabe, 2014.01.07 08:32)
-
Re: ACFinder 140106test exeのみ (kabe, 2014.01.07 08:41)
-
Re: ACFinder 140106test exeのみ (OhYeah!, 2014.01.07 16:00)
-
Re: ACFinder 140106test exeのみ (kabe, 2014.01.08 09:00)
-
Re: ACFinder 140106test exeのみ (OhYeah!, 2014.01.08 11:56)
-
ACFinder 140108test exeのみ (kabe, 2014.01.08 23:06)
-
Re: ACFinder 140108test exeのみ (OhYeah!, 2014.01.09 00:36)
-
spec.byochu.txt 追加 (OhYeah!, 2014.01.10 10:44)
-
byochu.txt, spec.byochu.txt 修正 (OhYeah!, 2014.01.12 23:14)
-
ACFinder 140113test exeのみ (kabe, 2014.01.13 21:52)
-
Re: ACFinder 140113test exeのみ (OhYeah!, 2014.01.13 22:09)
-
byochu.txt を3種類に (OhYeah!, 2014.01.15 02:28)
-
ACFinder 140115 TEST版 (kabe, 2014.01.15 23:07)
-
Re: ACFinder 140115 TEST版 (OhYeah!, 2014.01.16 00:20)
-
ACFinder 140116 TEST版 exe のみ (kabe, 2014.01.16 23:30)
-
Re: ACFinder 140116 TEST版 exe のみ (OhYeah!, 2014.01.17 00:36)
-
-
-
Re: ACFinder 140115 TEST版 (OhYeah!, 2014.01.16 08:27)
-
-
byochu.txt 1本に戻します (OhYeah!, 2014.01.17 00:41)
-
ACFinder 140118 TEST版 exe のみ (kabe, 2014.01.18 23:10)
-
Re: ACFinder 140118 TEST版 exe のみ (kabe, 2014.01.19 21:53)
-
Re: ACFinder 140118 TEST版 exe のみ (OhYeah!, 2014.01.20 00:06)
-
Re: ACFinder 140118 TEST版 exe のみ (OhYeah!, 2014.01.22 17:44)
-
Re: ACFinder 140118 TEST版 exe のみ (OhYeah!, 2014.01.22 22:45)
-
Re: ACFinder 140118 TEST版 exe のみ (OhYeah!, 2014.01.23 01:17)
-
Re: ACFinder 140118 TEST版 exe のみ (kabe, 2014.01.23 09:34)
-
Re: ACFinder 140118 TEST版 exe のみ (OhYeah!, 2014.01.23 23:34)
-
-
-
-
-
Re: ACFinder 140118 TEST版 exe のみ (OhYeah!, 2014.01.27 16:23)
-
Re: ACFinder 140118 TEST版 exe のみ (kabe, 2014.01.28 09:18)
-
Re: ACFinder 140118 TEST版 exe のみ (OhYeah!, 2014.01.28 15:32)
-
Re: ACFinder 140118 TEST版 exe のみ (OhYeah!, 2014.01.28 19:16)
-
Re: ACFinder 140118 TEST版 exe のみ (kabe, 2014.01.28 22:06)
-
Re: ACFinder 140118 TEST版 exe のみ (OhYeah!, 2014.01.29 00:48)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Re: ACFinder 140108test exeのみ (OhYeah!, 2014.01.09 10:08)
-
-
-
-
-
-
Re: ACFinder 140106test exeのみ (OhYeah!, 2014.01.07 09:49)
-
Re: ACFinder 140106test exeのみ (kabe, 2014.01.07 10:57)
-
Re: ACFinder 140106test exeのみ (OhYeah!, 2014.01.07 11:53)
-
-
rac, raccode ビュー更新 (OhYeah!, 2014.01.10 00:48)
-
-
-
-
-
-
-
-
-
-
-
-