I want to add version informations (for a specific language) to another exes that does not have such informations (at all).
I tried with BeginUpdateResource/UpdateResource/EndUpdateResource but all I succedeed is to create "Version >> 1 >> Unknown string", not "Version >> 1 >> CompanyName/VersionNumber/Description..." and their values.
I searched on Google and here but I couldn't find something useful. Only incomplete code which I didn't know how to finish.
Thank you.
Edit:
Here is the code that I use now:
procedure SetExeInfo(const ExeName, ResName, ResValue: string);
var
ResourceHandle: THandle;
DataLength: DWord;
Data: array of Char;
Ok: Boolean;
i: Integer;
begin
ResourceHandle := BeginUpdateResource(pChar(ExeName), False);
if (ResourceHandle <> 0) then
begin
DataLength := 8;
SetLength(Data, 8);
for i := 0 to 7 do
Data[i] := 'z';
Ok := True;
if (not UpdateResource(ResourceHandle, RT_VERSION, pChar(#49#0), LANG_SYSTEM_DEFAULT {MakeLangID(LANG_NEUTRAL, SUBLANG_NEUTRAL)}, Data, DataLength)) then
Ok := False;
if (not EndUpdateResource(ResourceHandle, False)) then
Ok := False;
if (Ok) then
ShowMessage('Update of resources successful!')
else
ShowMessage('Update of resources failed!');
end;
end;
Last edit:
I haven't specified in my question that I can't transfer the informations from another exe because I haven't seen the point to do this, since I haven't said specifically that I take the version info from another exe. Looks I was wrong, sorry.