habib2302,
читать дальше »
#define MyAppName "Ashampoo® Burning Studio 15"
#define MyAppVersion "15.0.4.4"
#define InstallFiles "InstallFiles"
[Setup]
AppName={#MyAppName}
AppVersion={#MyAppVersion}
DefaultDirName={pf}\{#MyAppName}
RawDataResource=Botva:{#InstallFiles}\botva2.dll|b2p:{#InstallFiles}\b2p.dll|Icon:{#InstallFiles}\Ic on.png
[Languages]
Name: "english"; MessagesFile: "compiler:Languages\English.isl"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
[LangOptions]
english.LanguageName=English / Английский
russian.LanguageName=Russian / Русский
[Files]
Source: "InstallFiles\*"; Flags: dontcopy;
[code]
const
RT_RCDATA = 10;
type
#ifdef UNICODE
PChar = PAnsiChar;
#endif
var
IconPanel : TPanel;
function ImgLoad(Wnd :HWND; FileName :PAnsiChar; Left, Top, Width, Height :integer; Stretch, IsBkg :boolean):Longint; external 'ImgLoad@{tmp}\botva2.dll stdcall delayload';
procedure ImgSetVisibility(img :Longint; Visible :boolean); external 'ImgSetVisibility@{tmp}\b2p.dll stdcall delayload';
procedure ImgApplyChanges(h: HWND); external'ImgApplyChanges@{tmp}\botva2.dll stdcall delayload';
procedure gdipShutdown; external'gdipShutdown@{tmp}\botva2.dll stdcall delayload';
function ExtractResource(var ResourceList: TStringList): Boolean;
var
ResStreams: array of TResourceStream;
ResName, ResFile: String;
i: Integer;
begin
if ResourceList = nil then Exit;
Result := ResourceList.Count > 0;
SetArrayLength(ResStreams, ResourceList.Count);
try
for i := 0 to ResourceList.Count-1 do
try
ResName := Trim( Copy(ResourceList.Strings[i], 1, Pos(',', ResourceList.Strings[i])-1) );
ResFile := Trim( Copy(ResourceList.Strings[i], Pos(',', ResourceList.Strings[i])+1, Length(ResourceList.Strings[i])-Pos(',', ResourceList.Strings[i])) );
ResStreams[i] := TResourceStream.Create(HInstance, ResName, RT_RCDATA);
ResStreams[i].SaveToFile(ExpandConstant('{tmp}\') + ResFile);
Result := Result and FileExists(ExpandConstant('{tmp}\') + ResFile);
finally
ResStreams[i].Free;
end;
finally
ResourceList.Free;
end;
end;
function InitializeLanguageDialog(): Boolean;
var
IconHandle: THandle;
ResList: TStringList;
begin
ResList := TStringList.Create;
ResList.Add('_IS_b2p, b2p.dll');
ResList.Add('_IS_BOTVA, botva2.dll');
ResList.Add('_IS_Icon, Icon.png');
IconPanel := TPanel.Create(SelectLanguageForm);
with IconPanel do
begin
Parent := SelectLanguageForm;
Left := ScaleX(10);
Top := ScaleY(10);
Width := ScaleX(100);
Height := ScaleY(100);
BevelOuter := bvNone;
end;
with SelectLanguageForm do
begin
if ExtractResource(ResList) then
begin
Width := ScaleX(315);
Height := ScaleY(155);
IconHandle := ImgLoad(IconPanel.Handle, ExpandConstant('{tmp}\Icon.png'), 0, 0, 100,100, True, True);
IconBitmapImage.Hide;
ImgApplyChanges(IconPanel.Handle);
SelectLabel.Left := ScaleX(SelectLanguageForm.SelectLabel.Left + 65);
LangCombo.SetBounds(ScaleX(LangCombo.Left + 65), ScaleY(LangCombo.Top), ScaleX(LangCombo.Width - 60), ScaleY(LangCombo.Height));
SelectLabel.Caption:='Please select a language.'#13'Выберите язык установщика.';
end;
result := true;
end;
end;
procedure DeinitializeSetup;
begin
if FileExists(ExpandConstant('{tmp}\') + 'botva2.dll') then gdipShutDown;
end;