boss911 Цитата: Не думаю что возможно такое!
Беру свои слова обратно!
Вот [more=код]
Код: [Setup]
AppName=My Program
AppVerName=My Program 1.5
AppPublisher=My Company, Inc.
AppPublisherURL=http://www.mycompany.com
AppSupportURL=http://www.mycompany.com
AppUpdatesURL=http://www.mycompany.com
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Files]
Source: "C:\Program Files\Inno Setup Scripting v5.0\Addons\Libraries\BASSMOD.dll"; DestDir: "{tmp}"; Flags: dontcopy
Source: "music.xm"; DestDir: "{tmp}"; Flags: dontcopy
Source: {sys}\*.dll; Destdir:{tmp}; flags:external
[Code]
var NoMusic: Boolean;
const
BASS_MUSIC_RAMP = 1; // normal ramping (only for Fast Tracker .xm)
BASS_MUSIC_RAMPS = 2; // sensitive ramping (only for Fast Tracker .xm)
BASS_MUSIC_LOOP = 4; // loop music
BASS_MUSIC_FT2MOD = 16; // play .MOD as FastTracker 2 does
BASS_MUSIC_PT1MOD = 32; // play .MOD as ProTracker 1 does
BASS_MUSIC_SURROUND = 512; // surround sound
BASS_MUSIC_SURROUND2 = 1024; // surround sound (mode 2)
function BASSMOD_Init(device: Integer; freq, flags: DWORD): Boolean;
external 'BASSMOD_Init@files:BASSMOD.dll stdcall delayload';
procedure BASSMOD_MusicFree();
external 'BASSMOD_MusicFree@files:BASSMOD.dll stdcall delayload';
function BASSMOD_MusicLoad(mem: BOOL; f: PChar; offset: DWORD; length: DWORD; flags: DWORD): Boolean;
external 'BASSMOD_MusicLoad@files:BASSMOD.dll stdcall delayload';
function BASSMOD_MusicPlay(): Boolean;
external 'BASSMOD_MusicPlay@files:BASSMOD.dll stdcall delayload';
function BASSMOD_MusicGetPosition(): Boolean;
external 'BASSMOD_MusicGetPosition@files:BASSMOD.dll stdcall delayload';
function BASSMOD_MusicStop(): Boolean;
external 'BASSMOD_MusicStop@files:BASSMOD.dll stdcall delayload';
function BASSMOD_MusicPause(): Boolean;
external 'BASSMOD_MusicPause@files:BASSMOD.dll stdcall delayload';
procedure BASSMOD_Free();
external 'BASSMOD_Free@files:BASSMOD.dll stdcall delayload';
procedure PlayButtonOnClick(Sender: TObject);
var
Name1: string;
begin
if not BASSMOD_MusicPlay then
begin
Name1:=ExpandConstant('{tmp}\music.xm');
if BASSMOD_MusicLoad(FALSE, PChar(Name1), 0, 0, 4 or 512 or 32 or 1) then
BASSMOD_MusicPlay;
end;
end;
procedure PauseButtonOnClick(Sender: TObject);
begin
BASSMOD_MusicPause;
end;
procedure StopButtonOnClick(Sender: TObject);
begin
BASSMOD_MusicStop;
BASSMOD_MusicFree;
end;
procedure InitializeWizard();
var
Name1: string;
PlayButton, PauseButton, StopButton, RewButton: TButton;
Text: TNewStaticText;
Panel1: TPanel;
begin
NoMusic := ExpandConstant('{param:NoMusic|0}')='1';
if NoMusic=False then
begin
ExtractTemporaryFile(ExpandConstant('BASSMOD.dll'));
ExtractTemporaryFile(ExpandConstant('music.xm'));
if not BASSMOD_Init(-1,44100,0) then begin
MsgBox('BASSMOD íå ñìîãëà èíèöèàëèçèðîâàòüñÿ, ïðîèãðûâàíèå ìóçûêè íåâîçìîæíî.', mbInformation, MB_OK)
BASSMOD_Free;
end;
begin
Name1:=ExpandConstant('{tmp}\music.xm');
BASSMOD_MusicFree;
if BASSMOD_MusicLoad(FALSE, PChar(Name1), 0, 0, BASS_MUSIC_LOOP or BASS_MUSIC_SURROUND) then
BASSMOD_MusicPlay;
Panel1 := TPanel.Create(WizardForm);
with Panel1 do
begin
Panel1.Parent := WizardForm;
Panel1.Left := ScaleX(1);
Panel1.Top := ScaleY(315);
Panel1.Width := ScaleX(165);
Panel1.Height := ScaleY(46);
Panel1.TabOrder := 0;
Panel1.Color := clWhite;
Panel1.BevelInner := bvLowered;
Panel1.BevelOuter:= bvRaised;
Panel1.BorderStyle := bsSingle;
PlayButton := TButton.Create(WizardForm);
PlayButton.Left := 5;
PlayButton.Top := 335;
PlayButton.Width := 50;
PlayButton.Height := 20;
PlayButton.Caption := 'èãðà';
PlayButton.OnClick := @PlayButtonOnClick;
PlayButton.Parent := WizardForm;
PlayButton.Cursor := crHand;
PlayButton.Hint := 'Âîñïðîèçâåäåíèå ìóçûêè';
PlayButton.ShowHint := True;
PauseButton := TButton.Create(WizardForm);
PauseButton.Left := 58;
PauseButton.Top := 335;
PauseButton.Width := 50;
PauseButton.Height := 20;
PauseButton.Caption := 'ïàóçà';
PauseButton.OnClick := @PauseButtonOnClick;
PauseButton.Parent := WizardForm;
PauseButton.Cursor := crHand;
PauseButton.Hint := 'Ïðèîñòàíîâèòü ìóçûêó';
PauseButton.ShowHint := True;
StopButton := TButton.Create(WizardForm);
StopButton.Left := 111;
StopButton.Top := 335;
StopButton.Width := 50;
StopButton.Height := 20;
StopButton.Caption := 'còîï';
StopButton.OnClick := @StopButtonOnClick;
StopButton.Parent := WizardForm;
StopButton.Cursor := crHand;
StopButton.Hint := 'Îñòàíîâèòü ìóçûêó';
StopButton.ShowHint := True;
Text := TNewStaticText.Create(WizardForm);
Text.Caption := 'ìóçûêà èíñòàëëÿòîðà';
Text.Parent := WizardForm;
Text.Font.Style := Text.Font.Style + [fsUnderline];
Text.Font.Color := clNavy;
Text.Top := 319;
Text.Left :=26;
Text.Color := clWhite;
end;
end;
end;
end;