Ветеран
Сообщения: 1088
Благодарности: 162
|
Профиль
|
Отправить PM
| Цитировать
Помогите! Сделал скрипт для музыки, как положено:
Скрипт
Код: 
; Скрипт создан через Мастер Inno Setup Script.
; ИСПОЛЬЗУЙТЕ ДОКУМЕНТАЦИЮ ДЛЯ ПОДРОБНОСТЕЙ ИСПОЛЬЗОВАНИЯ INNO SETUP!
#define MyAppName "AnyDVD"
#define MyAppVersion "6.9.0.0"
#define MyAppPublisher "SlySoft"
#define MyAppURL "http://www.slysoft.com"
#define MyAppExeName "AnyDVD.exe"
[Setup]
; Примечание: Значение AppId идентифицирует это приложение.
; Не используйте одно и тоже значение в разных установках.
; (Для генерации значения GUID, нажмите Инструменты | Генерация GUID.)
AppId={{CF04C40E-769A-49DC-9E45-EDF3F039E8BA}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\AnyDVD
DefaultGroupName=AnyDVD
AllowNoIcons=true
InfoBeforeFile=C:\Program Files\SlySoft\AnyDVD\repack.txt
OutputDir=C:\Users\alert30\Desktop\SetupAnyDVD6900
OutputBaseFilename=setup
Compression=lzma
SolidCompression=true
WizardImageFile=C:\Program Files\Inno Setup 5\WizModernImage-IS.bmp
WizardImageBackColor=clMaroon
WizardSmallImageFile=C:\Program Files\Inno Setup 5\WizModernSmallImage-IS.bmp
InternalCompressLevel=ultra
ShowTasksTreeLines=true
WindowVisible=no
[Languages]
Name: default; MessagesFile: compiler:Default.isl
[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked; OnlyBelowVersion: 0,6.1
[Files]
Source: C:\Program Files\SlySoft\AnyDVD\AnyDVD.exe; DestDir: {app}; Flags: ignoreversion
Source: C:\Program Files\SlySoft\AnyDVD\ADvdDiscHlp.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\Program Files\SlySoft\AnyDVD\AnyDialog.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\Program Files\SlySoft\AnyDVD\AnyDVD.exe; DestDir: {app}; Flags: ignoreversion
Source: C:\Program Files\SlySoft\AnyDVD\AnyDVDtray.exe; DestDir: {app}; Flags: ignoreversion
Source: C:\Program Files\SlySoft\AnyDVD\BDPHash.bin; DestDir: {app}; Flags: ignoreversion
Source: C:\Program Files\SlySoft\AnyDVD\ExecuteWithUAC.exe; DestDir: {app}; Flags: ignoreversion
Source: C:\Program Files\SlySoft\AnyDVD\HelpLauncher.exe; DestDir: {app}; Flags: ignoreversion
Source: C:\Program Files\SlySoft\AnyDVD\InstallHelp.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\Program Files\SlySoft\AnyDVD\RegAnyDVD.exe; DestDir: {app}; Flags: ignoreversion
Source: C:\Program Files\SlySoft\AnyDVD\SetDisplayFrequency.exe; DestDir: {app}; Flags: ignoreversion
; Примечание: Не используйте "Flags: ignoreversion" для системных файлов
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\crack\AnyTrial.exe; DestDir: {app}\crack
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\crack\JohnWho.nfo; DestDir: {app}\crack
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\eraser\NTSC\VIDEO_TS\VIDEO_TS.IFO; DestDir: {app}\eraser\NTSC\VIDEO_TS
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\eraser\NTSC\VIDEO_TS\VTS_01_0.IFO; DestDir: {app}\eraser\NTSC\VIDEO_TS
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\eraser\NTSC\VIDEO_TS\VTS_01_1.VOB; DestDir: {app}\eraser\NTSC\VIDEO_TS
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\eraser\NTSC\VIDEO_TS\VTS_02_0.IFO; DestDir: {app}\eraser\NTSC\VIDEO_TS
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\eraser\NTSC\VIDEO_TS\VTS_02_1.VOB; DestDir: {app}\eraser\NTSC\VIDEO_TS
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\eraser\PAL\VIDEO_TS\VIDEO_TS.IFO; DestDir: {app}\eraser\PAL\VIDEO_TS
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\eraser\PAL\VIDEO_TS\VTS_01_0.IFO; DestDir: {app}\eraser\PAL\VIDEO_TS
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\eraser\PAL\VIDEO_TS\VTS_01_1.VOB; DestDir: {app}\eraser\PAL\VIDEO_TS
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\eraser\PAL\VIDEO_TS\VTS_02_0.IFO; DestDir: {app}\eraser\PAL\VIDEO_TS
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\eraser\PAL\VIDEO_TS\VTS_02_1.VOB; DestDir: {app}\eraser\PAL\VIDEO_TS
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\language\AnyDVDru.lng; DestDir: {app}\language
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\language\resource.h; DestDir: {app}\language
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\manual\cz\index.html; DestDir: {app}\manual\cz
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\manual\da\index.html; DestDir: {app}\manual\da
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\manual\de\index.html; DestDir: {app}\manual\de
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\manual\el\index.html; DestDir: {app}\manual\el
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\manual\en\index.html; DestDir: {app}\manual\en
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\manual\es\index.html; DestDir: {app}\manual\es
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\manual\fi\index.html; DestDir: {app}\manual\fi
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\manual\fr\index.html; DestDir: {app}\manual\fr
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\manual\hu\index.html; DestDir: {app}\manual\hu
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\manual\images\slysoft-logo_l.gif; DestDir: {app}\manual\images
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\manual\it\index.html; DestDir: {app}\manual\it
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\manual\ja\index.html; DestDir: {app}\manual\ja
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\manual\nl\index.html; DestDir: {app}\manual\nl
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\manual\pl\index.html; DestDir: {app}\manual\pl
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\manual\pt\index.html; DestDir: {app}\manual\pt
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\manual\ru\index.html; DestDir: {app}\manual\ru
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\manual\se\index.html; DestDir: {app}\manual\se
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\manual\tw\index.html; DestDir: {app}\manual\tw
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\manual\ua\index.html; DestDir: {app}\manual\ua
Source: ..\..\..\..\Program Files\SlySoft\AnyDVD\manual\changes.txt; DestDir: {app}\manual
Source: background.bmp; DestDir: {tmp}; Flags: dontcopy
Source: BASS.dll; DestDir: {tmp}; Flags: dontcopy noencryption
Source: sound.mp3; DestDir: {tmp}; Flags: dontcopy noencryption nocompression
Source: MusicButton.bmp; DestDir: {tmp}; Flags: dontcopy
[Messages]
BeveledLabel=© alert30, 2012
[Icons]
Name: {group}\{#MyAppName}; Filename: {app}\{#MyAppExeName}
Name: {group}\{cm:ProgramOnTheWeb,{#MyAppName}}; Filename: {#MyAppURL}
Name: {group}\{cm:UninstallProgram,{#MyAppName}}; Filename: {uninstallexe}
Name: {commondesktop}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: desktopicon
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: quicklaunchicon
Name: {group}\Trial Reset; Filename: {app}\crack\AnyTrial.exe; IconFilename: {app}\crack\AnyTrial.exe; Comment: Сбрасывает пробный период программы AnyDVD.; IconIndex: 0; Languages: " default"
[Run]
Filename: {app}\AnyDVD.exe; Description: {cm:LaunchProgram,AnyDVD}; Flags: nowait postinstall skipifsilent
[LangOptions]
LanguageName=English
LanguageID=$0409
LanguageCodePage=0
DialogFontName=
DialogFontSize=8
WelcomeFontName=Verdana
WelcomeFontSize=12
TitleFontName=Arial
TitleFontSize=29
CopyrightFontName=Arial
CopyrightFontSize=8
RightToLeft=no
[_Code]
const
BASS_ACTIVE_STOPPED = 0;
BASS_ACTIVE_PLAYING = 1;
BASS_ACTIVE_STALLED = 2;
BASS_ACTIVE_PAUSED = 3;
BASS_SAMPLE_LOOP = 4;
var
mp3Handle: HWND;
mp3Name: String;
PlayButton, PauseButton, StopButton: TPanel;
PlayImage, PauseImage, StopImage: TBitmapImage;
PlayLabel, PauseLabel, StopLabel: TLabel;
MouseLabel: Tlabel;
function BASS_Init(device: Integer; freq, flags: DWORD; win: hwnd; CLSID: Integer): Boolean;
external 'BASS_Init@files:BASS.dll stdcall delayload';
function BASS_StreamCreateFile(mem: BOOL; f: PChar; offset: DWORD; length: DWORD; flags: DWORD): DWORD;
external 'BASS_StreamCreateFile@files:BASS.dll stdcall delayload';
function BASS_Start(): Boolean;
external 'BASS_Start@files:BASS.dll stdcall delayload';
function BASS_ChannelPlay(handle: DWORD; restart: BOOL): Boolean;
external 'BASS_ChannelPlay@files:BASS.dll stdcall delayload';
function BASS_ChannelIsActive(handle: DWORD): Integer;
external 'BASS_ChannelIsActive@files:BASS.dll stdcall delayload';
function BASS_ChannelPause(handle: DWORD): Boolean;
external 'BASS_ChannelPause@files:BASS.dll stdcall delayload';
function BASS_Stop(): Boolean;
external 'BASS_Stop@files:BASS.dll stdcall delayload';
function BASS_Pause(): Boolean;
external 'BASS_Pause@files:BASS.dll stdcall delayload';
function BASS_Free(): Boolean;
external 'BASS_Free@files:BASS.dll stdcall delayload';
procedure PlayMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
PlayImage.Left := -96
end;
procedure PlayMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
PlayImage.Left := 0
end;
procedure PlayMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
if PlayImage.Left <> -96 then PlayImage.Left := -192
StopImage.Left := -64
end;
procedure PauseMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
PauseImage.Left := -128
end;
procedure PauseMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
PauseImage.Left := -32
end;
procedure PauseMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
if PauseImage.Left <> -128 then PauseImage.Left := -224
StopImage.Left := -64
end;
procedure StopMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
StopImage.Left := -160
end;
procedure StopMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
StopImage.Left := -64
end;
procedure StopMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
if StopImage.Left <> -160 then StopImage.Left := -256
PlayImage.Left := 0
PauseImage.Left := -32
end;
procedure MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
PlayImage.Left := 0
PauseImage.Left := -32
StopImage.Left := -64
end;
function InitializeSetup(): Boolean;
begin
ExtractTemporaryFile('BASS.dll');
ExtractTemporaryFile('sound.mp3');
mp3Name := ExpandConstant('{tmp}\sound.mp3');
BASS_Init(-1, 44100, 0, 0, 0);
mp3Handle := BASS_StreamCreateFile(FALSE, PChar(mp3Name), 0, 0, BASS_SAMPLE_LOOP);
BASS_Start();
BASS_ChannelPlay(mp3Handle, False);
Result := True;
end;
procedure PlayButtonOnClick(Sender: TObject);
begin
case BASS_ChannelIsActive(mp3Handle) of
BASS_ACTIVE_PAUSED:
begin
BASS_ChannelPlay(mp3Handle, False);
PlayButton.Hide
PauseButton.Show
end;
BASS_ACTIVE_STOPPED:
begin
BASS_Init(-1, 44100, 0, 0, 0);
mp3Handle := BASS_StreamCreateFile(FALSE, PChar(mp3Name), 0, 0, BASS_SAMPLE_LOOP);
BASS_Start();
BASS_ChannelPlay(mp3Handle, False);
PlayButton.Hide
PauseButton.Show
end;
end;
end;
procedure PauseButtonOnClick(Sender: TObject);
begin
BASS_ChannelPause(mp3Handle);
PauseButton.Hide
PlayButton.Show
end;
procedure StopButtonOnClick(Sender: TObject);
begin
BASS_Stop();
BASS_Free();
PauseButton.Hide
PlayButton.Show
end;
procedure InitializeWizard();
begin
ExtractTemporaryFile('MusicButton.bmp')
MouseLabel := TLabel.Create(WizardForm)
MouseLabel.Width := WizardForm.Width
MouseLabel.Height := WizardForm.Height
MouseLabel.Autosize := False
MouseLabel.Transparent := True
MouseLabel.OnMouseMove := @MouseMove
MouseLabel.Parent := WizardForm
PlayButton := TPanel.Create(WizardForm)
PlayButton.Left := 50
PlayButton.Top := 320
PlayButton.Width := 32
PlayButton.Height := 33
PlayButton.Cursor := crHand
PlayButton.ShowHint := True
PlayButton.Hint := 'Aini?iecaaaaiea iocuee'
PlayButton.OnClick := @PlayButtonOnClick
PlayButton.Parent := WizardForm
PlayImage := TBitmapImage.Create(WizardForm)
PlayImage.Left := 0
PlayImage.Top := 0
PlayImage.Width := 288
PlayImage.Height := 33
PlayImage.Enabled := False
PlayImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\MusicButton.bmp'))
PlayImage.Parent := PlayButton
//
PlayImage.ReplaceColor:=$E2E2E2
PlayImage.ReplaceWithColor:=clBtnFace
PlayLabel := TLabel.Create(WizardForm)
PlayLabel.Width := PlayButton.Width
PlayLabel.Height := PlayButton.Height
PlayLabel.Autosize := False
PlayLabel.Transparent := True
PlayLabel.OnClick := @PlayButtonOnClick
PlayLabel.OnMouseDown := @PlayMouseDown
PlayLabel.OnMouseUp := @PlayMouseUp
PlayLabel.OnMouseMove := @PlayMouseMove
PlayLabel.Parent := PlayButton
PauseButton := TPanel.Create(WizardForm)
PauseButton.Left := 50
PauseButton.Top := 320
PauseButton.Width := 32
PauseButton.Height := 33
PauseButton.Cursor := crHand
PauseButton.ShowHint := True
PauseButton.Hint := 'I?einoaiiaeou iocueo'
PauseButton.OnClick := @PauseButtonOnClick
PauseButton.Parent := WizardForm
PauseImage := TBitmapImage.Create(WizardForm)
PauseImage.Left := -32
PauseImage.Top := 0
PauseImage.Width := 288
PauseImage.Height := 33
PauseImage.Enabled := False
PauseImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\MusicButton.bmp'))
PauseImage.Parent := PauseButton
//
PauseImage.ReplaceColor:=$E2E2E2
PauseImage.ReplaceWithColor:=clBtnFace
PauseLabel := TLabel.Create(WizardForm)
PauseLabel.Width := PauseButton.Width
PauseLabel.Height := PauseButton.Height
PauseLabel.Autosize := False
PauseLabel.Transparent := True
PauseLabel.OnClick := @PauseButtonOnClick
PauseLabel.OnMouseDown := @PauseMouseDown
PauseLabel.OnMouseUp := @PauseMouseUp
PauseLabel.OnMouseMove := @PauseMouseMove
PauseLabel.Parent := PauseButton
StopButton := TPanel.Create(WizardForm)
StopButton.Left := 82
StopButton.Top := 320
StopButton.Width := 32
StopButton.Height := 33
StopButton.Cursor := crHand
StopButton.ShowHint := True
StopButton.Hint := 'Inoaiiaeou iocueo'
StopButton.OnClick := @StopButtonOnClick
StopButton.Parent := WizardForm
StopImage := TBitmapImage.Create(WizardForm)
StopImage.Left := -64
StopImage.Top := 0
StopImage.Width := 288
StopImage.Height := 33
StopImage.Enabled := False
StopImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\MusicButton.bmp'))
StopImage.Parent := StopButton
//
StopImage.ReplaceColor:=$E2E2E2
StopImage.ReplaceWithColor:=clBtnFace
StopLabel := TLabel.Create(WizardForm)
StopLabel.Width := StopButton.Width
StopLabel.Height := StopButton.Height
StopLabel.Autosize := False
StopLabel.Transparent := True
StopLabel.OnClick := @StopButtonOnClick
StopLabel.OnMouseDown := @StopMouseDown
StopLabel.OnMouseUp := @StopMouseUp
StopLabel.OnMouseMove := @StopMouseMove
StopLabel.Parent := StopButton
end;
procedure DeinitializeSetup();
begin
BASS_Stop();
BASS_Free();
end;
Но после компиляции и запуска установщика появляется ошибка "Runtime Error 0012FD8C". Я думаю, что для устранения этой ошибки требуется RuntimePack. Я прав?
|