Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  

Название темы: Inno Setup. Прочие вопросы
Показать сообщение отдельно

Новый участник


Сообщения: 47
Благодарности: 5

Профиль | Отправить PM | Цитировать


Помогите пожалуйста разобраться. Когда в свой скрипт добавляю музыку, он прекрасно компилируется, но при запуске EXE, выдаёт вот такую ошибку:

Runtime Error (at 81:1179):
Access violation at address B0000001. Write of address B0000001.

Runtime Error (at 277:21):
Could not call proc.


Мой скрипт


#define GameName "My Programm"
#define PathGameName "My Programm"
#define GameEXE "MP.exe"
#define GameVersion "1.0"
#define InstallVersion "1.0"
#define RePacker "CaT"
#define NeedSize "7343"
#define NeedInstallSize "7353"
#define NeedMem "512"

;#define Components

#define Tasks

#define Music

;#define Splash

#define Russophobia


;#define records
;#define PrecompInside
;#define SrepInside
;#define facompress
;#define precomp "0.38"
;#define unrar /*
;#define XDelta /*
;#define PackZIP /*


[Setup]
AppName={#GameName}
AppPublisher=RePack by {#RePacker}
AppVerName={#GameName}
AppCopyright=© RePack by {#RePacker}
DefaultDirName={pf}\{#PathGameName}
DefaultGroupName={#PathGameName}
VersionInfoDescription=Installer - {#GameName}
VersionInfoTextVersion={#GameVersion}
VersionInfoVersion={#InstallVersion}
InternalCompressLevel=ultra64
SolidCompression=true
SetupIconFile="InstallFiles/MP.ico"
ShowTasksTreeLines=Yes
Compression=lzma/ultra64
OutputBaseFilename=MP
UninstallDisplayIcon={app}\{#GameEXE}
UninstallFilesDir={app}\Uninstall

;VersionInfoVersion=1.0
;VersionInfoCompany=

[Files]
Source: InstallFiles\*; DestDir: {tmp}; Flags: dontcopy
Source: dllFiles\*; DestDir: {tmp}; Flags: dontcopy

#ifdef Music
Source: Music\*; DestDir: {tmp}; Flags: dontcopy
#endif

#ifdef Splash
Source: Splash\*; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
#endif

Source: Include\russian.ini; DestDir: {tmp}; Flags: dontcopy
Source: Include\unarc.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\ISDone.dll; DestDir: {tmp}; Flags: dontcopy
#ifdef records
Source: Include\records.inf; DestDir: {tmp}; Flags: dontcopy
#endif

#ifdef PrecompInside
Source: Include\CLS-precomp.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\packjpg_dll1.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\precomp.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\zlib1.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef SrepInside
Source: Include\CLS-srep.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef facompress
Source: Include\facompress.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef precomp
#if precomp == "0.38"
Source: Include\precomp038.exe; DestDir: {tmp}; Flags: dontcopy
#else
#if precomp == "0.4"
Source: Include\precomp040.exe; DestDir: {tmp}; Flags: dontcopy
#else
#if precomp == "0.41"
Source: Include\precomp041.exe; DestDir: {tmp}; Flags: dontcopy
#else
Source: Include\precomp038.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\precomp040.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\precomp041.exe; DestDir: {tmp}; Flags: dontcopy
#endif
#endif
#endif
#endif
#ifdef unrar
Source: Include\Unrar.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef XDelta
Source: Include\XDelta3.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef PackZIP
Source: Include\7z.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\packZIP.exe; DestDir: {tmp}; Flags: dontcopy
#endif

[Registry]

#ifdef Components
[Types]
Name: full; Description: Ïîëíàÿ óñòàíîâêà; Flags: iscustom

[Components]
Name: InterfaceLanguage; Description: ßçûê Èíòåðôåéñà:; Flags: fixed; Types: Full;
Name: InterfaceLanguage\Russian; Description: Ðóññêèé; Flags: exclusive; ExtraDiskSpaceRequired: 100000000
Name: InterfaceLanguage\English; Description: Àíãëèéñêèé; Flags: exclusive; ExtraDiskSpaceRequired: 200000000
Name: SoundLanguage; Description: ßçûê Îçâó÷êè:; Flags: fixed; Types: Full;
Name: SoundLanguage\Russian; Description: Ðóññêèé; Flags: exclusive; ExtraDiskSpaceRequired: 500000000
Name: SoundLanguage\English; Description: Àíãëèéñêèé; Flags: exclusive; ExtraDiskSpaceRequired: 600000000
#endif

#ifdef Tasks
[Tasks]
Name: Icons; Description: {cm:Icons}; Flags: unchecked;
Name: Icons\DesktopIcon; Description: {cm:CreateDesktopIcon};
#ifdef GameEXE2
Name: Icons\DesktopIcon2; Description: {cm:CreateDesktopIcon2};
#endif
Name: Icons\QuickLaunchIcon; Description: {cm:CreateQuickLaunchIcon};
Name: Soft; Description: {cm:Soft};
Name: Soft\DirectX; Description: DirectX.;
Name: Soft\VCCheck; Description: Microsoft Visual C++ 2010.; Flags:
Name: Soft\PhysXCheck; Description: NVIDIA PhysX
#endif

[Run]
Filename: {src}\Soft\DirectX\DXSETUP.exe; WorkingDir: {src}\Soft\DirectX\; Flags: waituntilterminated; Tasks: Soft\DirectX; StatusMsg: Óñòàíîâêà DirectX...; Check: CheckError
Filename: {src}\Soft\Redist\vcredist_x86.exe; StatusMsg: Óñòàíàâëèâàåì Microsoft Visual C++ 2010 Redist...; Flags: skipifdoesntexist; Tasks: Soft\VCCheck; Components: ; Check: CheckError and not IsWin64;
Filename: {src}\Soft\Redist\vcredist_x64.exe; StatusMsg: Óñòàíàâëèâàåì Microsoft Visual C++ 2010 Redist...; Flags: skipifdoesntexist; Tasks: Soft\VCCheck; Components: ; Check: CheckError and IsWin64
Filename: {src}\Soft\PhysX\PhysX-9.12.1031-SystemSoftware.exe; Parameters: /qn; StatusMsg: Óñòàíàâëèâàåì NVIDIA PhysX...; Flags: skipifdoesntexist; Tasks: Soft\PhysXCheck; Check: CheckError

[UninstallDelete]
Type: filesandordirs; Name: {app}

[code]
#ifdef Splash
procedure ShowSplashScreen(p1:HWND;p2:string;p3,p4,p5,p6,p7:integer;p8:boolean;p9:Cardinal;p10:integer); external 'ShowSplashScreen@files:isgsg.dll stdcall delayload';
#endif
#include "Modules\Messages.iss"
#include "Modules\botva2.iss"
#include "Modules\BASS_Module.iss"
#include "Modules\PB.iss"
#include "Modules\botva2u.iss"
#include "Modules\Header.iss"
#include "Modules\ISDone.iss"

procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
external 'LoadSkin@files:isskin.dll stdcall';

procedure UnloadSkin();
external 'UnloadSkin@files:isskin.dll stdcall';

#ifdef Russophobia
const
A1='À';
Z1='ß';
A2='à';
Z2='ÿ';
X1='¸';
X2='¨';
function NextButtonClick(CurPageID: Integer): Boolean;
var i: integer;
c: char;
begin
Result := True;
if CurPageID = wpSelectDir then begin
for i:=1 to length(WizardForm.DirEdit.text) do begin
c:=WizardForm.DirEdit.text[i];
if (c>=A1)and(c<=Z1) or (c>=A2)and(c<=Z2) or (c=X1) or (c=X2) then begin
MsgBox( 'Â ïóòè óñòàíîâêè ïðèñóòñòâóþò ðóññêèå áóêâû, ÷òî íåäîïóñòèìî'#13#13'Ïîæàëóéñòà, ïîâòîðèòå ââîä.', mbError, mb_Ok);
Result := False ;
exit;
end;
end;
end;
end;
#endif
////////////////////////////////////////////////////////////Òåêñòóðà êíîïîê\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
procedure SetStateNewButtons;
begin
with WizardForm.BackButton do begin
BtnSetText(hBackBtn,PAnsiChar(Caption));
BtnSetVisibility(hBackBtn,Visible);
BtnSetEnabled(hBackBtn,Enabled);
end;
with WizardForm.NextButton do begin
BtnSetText(hNextBtn,PAnsiChar(Caption));
BtnSetVisibility(hNextBtn,Visible);
BtnSetEnabled(hNextBtn,Enabled);
end;
with WizardForm.CancelButton do begin
BtnSetText(hCancelBtn,PAnsiChar(Caption));
BtnSetVisibility(hCancelBtn,Visible);
BtnSetEnabled(hCancelBtn,Enabled);
end;
BtnSetText(hDirBrowseBtn,PAnsiChar(WizardForm.DirBrowseButton.Caption));
BtnSetText(hGroupBrowseBtn,PAnsiChar(WizardForm.GroupBrowseButton.Caption));
end;

procedure WizardFormBtnClick(hBtn:HWND);
var
Btn:TButton;
begin
case hBtn of
hCancelBtn: Btn:=WizardForm.CancelButton;
hNextBtn: Btn:=WizardForm.NextButton;
hBackBtn: Btn:=WizardForm.BackButton;
hDirBrowseBtn: Btn:=WizardForm.DirBrowseButton;
hGroupBrowseBtn: Btn:=WizardForm.GroupBrowseButton;
end;
Btn.OnClick(Btn);
SetStateNewButtons;
BtnRefresh(hBtn);
end;

procedure WFBtnEnter(hBtn:HWND);
begin
end;

procedure ButtonsTextures;
begin
with WizardForm.BackButton do begin
hBackBtn:=BtnCreate(WizardForm.Handle,447,364,80,24,ExpandConstant('Btn.png'),0,False);
BtnSetEvent(hBackBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetEvent(hBackBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFont(hBackBtn,WFButtonFont.Handle);
BtnSetFontColor(hBackBtn,$FFFFFF,$FFFFFF,$FFFFFF,$B6B6B6);
BtnSetCursor(hBackBtn,GetSysCursorHandle(32649));
Width:=0;
Height:=0;
end;

with WizardForm.NextButton do begin
hNextBtn:=BtnCreate(WizardForm.Handle,530,364,80,24,ExpandConstant('Btn.png'),1,False);
BtnSetEvent(hNextBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetEvent(hNextBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFont(hNextBtn,WFButtonFont.Handle);
BtnSetFontColor(hNextBtn,$FFFFFF,$FFFFFF,$FFFFFF,$B6B6B6);
BtnSetCursor(hNextBtn,GetSysCursorHandle(32649));
Width:=0;
Height:=0;
end;

with WizardForm.CancelButton do begin
hCancelBtn:=BtnCreate(WizardForm.Handle,613,364,80,24,ExpandConstant('Btn.png'),1,False);
BtnSetEvent(hCancelBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetEvent(hCancelBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFont(hCancelBtn,WFButtonFont.Handle);
BtnSetFontColor(hCancelBtn,$FFFFFF,$FFFFFF,$FFFFFF,$B6B6B6);
BtnSetCursor(hCancelBtn,GetSysCursorHandle(32649));
Width:=0;
Height:=0;
end;

with WizardForm.DirBrowseButton do begin
hDirBrowseBtn:=BtnCreate(WizardForm.Handle,530,269,73,24,ExpandConstant('browse.png'),1,False);
BtnSetEvent(hDirBrowseBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetEvent(hDirBrowseBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFont(hDirBrowseBtn,WFButtonFont.Handle);
BtnSetFontColor(hDirBrowseBtn,$FFFFFF,$FFFFFF,$FFFFFF,$B6B6B6);
BtnSetCursor(hDirBrowseBtn,GetSysCursorHandle(32649));
Width:=0;
Height:=0;
end;

with WizardForm.GroupBrowseButton do begin
hGroupBrowseBtn:=BtnCreate(WizardForm.Handle,530,269,73,24,ExpandConstant('browse.png'),1,False);
BtnSetEvent(hGroupBrowseBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetEvent(hGroupBrowseBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFont(hGroupBrowseBtn,WFButtonFont.Handle);
BtnSetFontColor(hGroupBrowseBtn,$FFFFFF,$FFFFFF,$FFFFFF,$B6B6B6);
BtnSetCursor(hGroupBrowseBtn,GetSysCursorHandle(32649));
Width:=0;
Height:=0;
end;
end;

/////////////////////////////////////////////////êîíåö\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
////////////////////////////////////////////////Âñòàâêà èçîáðàæåíèé\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

procedure CreateWizardForm;
var
n: Integer;
begin
with WizardForm do begin
InnerNotebook.Hide;
OuterNotebook.Hide;
Bevel.Hide;
ClientWidth:=ScaleX(700);
ClientHeight:=ScaleY(394);
DirEdit.OnChange:=@ObjectFunc;
GroupEdit.OnChange:= @ObjectFunc
OnMouseDown:=@LabelOnMouseDown;
BorderIcons := [];
Center;
end;

WFButtonFont:=TFont.Create;
with WFButtonFont do begin
Style:=[fsBold];
Size:=10;
Name:='Tahoma';
end;

BGImageStream := TMemoryStream.Create;
ExtractTemporaryFileToStream('BMPImage.bmp', BGImageStream);
BGImageStream.Position := 0;

BTNImageStream := TMemoryStream.Create;
ExtractTemporaryFileToStream('btnimage.bmp', BTNImageStream);
BTNImageStream.Position := 0;

BGImage := TBitmapImage.Create(WizardForm);
BGImage.Bitmap.LoadFromStream(BGImageStream);

BTNImage := TBitmapImage.Create(WizardForm);
BTNImage.Bitmap.LoadFromStream(BTNImageStream);

ImgLoad(WizardForm.Handle,ExpandConstant('MainImage.png'),0,0,0,0,False,True);

//////////////////////////////////////////---\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

/////////////////////////////////////////////////// ñò. Ãëàâíàÿ\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
WelcomeLabel1:= CreateLabel(WizardForm, ScaleX(0), ScaleY(245), ScaleX(700), ScaleY(80), ExpandConstant('{cm:WelcomeLabel1}'), False);
LabelSetFont(WelcomeLabel1, 10, 'Tahoma', $FFFFFF, [fsBold]);
WelcomeLabel1.Alignment := taCenter;

WelcomeLabel2:= CreateLabel(WizardForm, ScaleX(0), ScaleY(275), ScaleX(700), ScaleY(150), ExpandConstant('{cm:WelcomeLabel2}'), False);
LabelSetFont(WelcomeLabel2, 8, 'Tahoma', $FFFFFF, [fsBold]);
WelcomeLabel2.Alignment := taCenter;
//////////////////////////////////////////////////ñò.Âûáîð Äèðèêòîðèè\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
DirFolder:=ImgLoad(WizardForm.Handle,ExpandConstant('DirFolder.png'),ScaleX(106),ScaleY(210),ScaleX( 60),ScaleY(59),True,True);
DirEditImg:=ImgLoad(WizardForm.Handle,ExpandConstant('DirEditImg.png'),ScaleX(105),ScaleY(270),Scale X(420),ScaleY(22),True,True);
HDD:=ImgLoad(WizardForm.Handle,ExpandConstant('HDD.png'),ScaleX(105),ScaleY(297),ScaleX(57),ScaleY(5 7),True,True);

SelectDirLabel:= CreateLabel(WizardForm, ScaleX(175), ScaleY(219), ScaleX(0), ScaleY(0), ExpandConstant('{cm:SelectDirLabel}'), true);
LabelSetFont(SelectDirLabel, 9, 'Tahoma', $FFFFFF, [fsBold]);

SelectDirBrowseLabel:= CreateLabel(WizardForm, ScaleX(175), ScaleY(238), ScaleX(0), ScaleY(0), ExpandConstant('{cm:SelectDirBrowseLabel}'), true);
LabelSetFont(SelectDirBrowseLabel, 8, 'Tahoma', $FFFFFF, [fsBold]);
SelectDirBrowseLabel.Alignment := taLeftJustify;

DirEditLabel:= CreateLabel(WizardForm, ScaleX(110), ScaleY(272), ScaleX(450), ScaleY(20), '', false);
LabelSetFont(DirEditLabel, 10, 'Tahoma', $FFFFFF, [fsBold]);
DirEditLabel.Caption := MinimizePathName(WizardForm.DirEdit.Text, DirEditLabel.Font, DirEditLabel.Width);

TotalSpaceLabel:= CreateLabel(WizardForm, ScaleX(175), ScaleY(295), ScaleX(0), ScaleY(0), ExpandConstant('{cm:TotalSpaceLabel}'), true);
LabelSetFont(TotalSpaceLabel, 8, 'Tahoma', $FFFFFF, [fsBold]);

FreeSpaceLabel:= CreateLabel(WizardForm, ScaleX(175), ScaleY(310), ScaleX(0), ScaleY(0), ExpandConstant('{cm:FreeSpaceLabel}'), true);
LabelSetFont(FreeSpaceLabel, 8, 'Tahoma', $FFFFFF, [fsBold]);

InstallSpacelabel:= CreateLabel(WizardForm, ScaleX(175), ScaleY(325), ScaleX(0), ScaleY(0), ExpandConstant('{cm:InstallSpacelabel}'), true);
LabelSetFont(InstallSpacelabel, 8, 'Tahoma', $FFFFFF, [fsBold]);

NeedSpaceLabel:= CreateLabel(WizardForm, ScaleX(175), ScaleY(340), ScaleX(0), ScaleY(0), ExpandConstant('{cm:NeedSpaceLabel}'), true);
LabelSetFont(NeedSpaceLabel, 8, 'Tahoma', $FFFFFF, [fsBold]);

TotalSpaceLabel2:= CreateLabel(WizardForm, ScaleX(520), ScaleY(295), ScaleX(0), ScaleY(0), '', true);
LabelSetFont(TotalSpaceLabel2, 8, 'Tahoma', $FFFFFF, [fsBold]);
TotalSpaceLabel2.Alignment := taRightJustify;

FreeSpaceLabel2:= CreateLabel(WizardForm, ScaleX(520), ScaleY(310), ScaleX(0), ScaleY(0), '', true);
LabelSetFont(FreeSpaceLabel2, 8, 'Tahoma', $FFFFFF, [fsBold]);
FreeSpaceLabel2.Alignment := taRightJustify;

InstallSpacelabel2:= CreateLabel(WizardForm, ScaleX(520), ScaleY(325), ScaleX(0), ScaleY(0), '', true);
LabelSetFont(InstallSpacelabel2, 8, 'Tahoma', $FFFFFF, [fsBold]);
InstallSpacelabel2.Alignment := taRightJustify;

NeedSpaceLabel2:= CreateLabel(WizardForm, ScaleX(520), ScaleY(340), ScaleX(0), ScaleY(0), '', true);
LabelSetFont(NeedSpaceLabel2, 8, 'Tahoma', $FFFFFF, [fsBold]);
NeedSpaceLabel2.Alignment := taRightJustify;

#ifdef Components
//////////////////////////////////////////ñò.Êîìïîíåíòîâ\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
SelectComponentsLabel:= CreateLabel(WizardForm, ScaleX(345), ScaleY(208), ScaleX(0), ScaleY(0), ExpandConstant('{cm:SelectComponentsLabel}'), true);
LabelSetFont(SelectComponentsLabel, 8, 'Tahoma', $FFFFFF, [fsBold]);
SelectComponentsLabel.Alignment := taLeftJustify;
with WizardForm.ComponentsList do begin
Parent:= WizardForm;
SetBounds(ScaleX(5), ScaleY(208), ScaleX(335), ScaleY(148));
Color:=$000000;
Font.Name:='Tahoma';
Font.Size:= 8;
Font.Color:=$FFFFFF;
for n:=0 to ItemCount-1 do begin
ItemFontStyle[n]:= [fsBold];
SubItemFontStyle[n]:= [fsBold];
end;
BorderWidth := (WizardForm.ComponentsList.Width-WizardForm.ComponentsList.ClientWidth) div 2;
LoadBGBmpFromBitmap(BGImage.Bitmap, WizardForm.ComponentsList.Left+BorderWidth, WizardForm.ComponentsList.Top+BorderWidth);
LoadBtnBmpFromBitmap(btnimage.Bitmap);
end;
#endif

/////////////////////////////////////////////////ñò.Âûáîð Ãðóïïû\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
GroupFolder:=ImgLoad(WizardForm.Handle,ExpandConstant('GroupFolder.png'),ScaleX(106),ScaleY(210),Sca leX(60),ScaleY(59),True,True);

SelectStartMenuFolderLabel:= CreateLabel(WizardForm, ScaleX(175), ScaleY(219), ScaleX(0), ScaleY(0), ExpandConstant('{cm:SelectStartMenuFolderLabel}'), true);
LabelSetFont(SelectStartMenuFolderLabel, 9, 'Tahoma', $FFFFFF, [fsBold]);
SelectStartMenuFolderLabel.Alignment := taLeftJustify;

SelectStartMenuFolderBrowseLabel:= CreateLabel(WizardForm, ScaleX(175), ScaleY(238), ScaleX(0), ScaleY(0), ExpandConstant('{cm:SelectDirBrowseLabel}'), true);
LabelSetFont(SelectStartMenuFolderBrowseLabel, 8, 'Tahoma', $FFFFFF, [fsBold]);
SelectStartMenuFolderBrowseLabel.Alignment := taLeftJustify;

GroupEditLabel:= CreateLabel(WizardForm, ScaleX(110), ScaleY(272), ScaleX(450), ScaleY(20), WizardForm.GroupEdit.Text, false);
LabelSetFont(GroupEditLabel, 10, 'Tahoma', $FFFFFF, [fsBold]);

NoIconsCheck:=BtnCreate(WizardForm.Handle,ScaleX(110),ScaleY(305),ScaleX(13),ScaleY(13),ExpandConsta nt('CheckBox.png'),1,True);
BtnSetEvent(NoIconsCheck,BtnClickEventID,WrapBtnCallback(@NoIconsClick,1));
BtnSetCursor(NoIconsCheck,GetSysCursorHandle(32649));

NoIconsLabel:= CreateLabel(WizardForm, ScaleX(126), ScaleY(305), ScaleX(0), ScaleY(0), ExpandConstant('{cm:NoIconsCheck}'), true);
LabelSetFont(NoIconsLabel, 8, 'Tahoma', $FFFFFF, [fsBold]);
with NoIconsLabel do begin
Cursor := crHand;
OnClick:= @ObjectFunc;
end;
/////////////////////////////////////////////ñò.Çàäà÷ü\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
#ifdef Tasks
SelectTasksLabel:= CreateLabel(WizardForm, ScaleX(345), ScaleY(208), ScaleX(0), ScaleY(0), ExpandConstant('{cm:SelectTasksLabel}'), true);
LabelSetFont(SelectTasksLabel, 8, 'Tahoma', $FFFFFF, [fsBold]);
SelectTasksLabel.Alignment := taLeftJustify;

with WizardForm.TasksList do begin
Parent:= WizardForm;
SetBounds(ScaleX(5), ScaleY(208), ScaleX(335), ScaleY(148));
Color:=$000000;
Font.Name:='Tahoma';
Font.Size:= 8;
Font.Color:=$FFFFFF;
BorderStyle := bsSingle;
//TreeViewStyle := True;
BorderWidth := (WizardForm.TasksList.Width-WizardForm.TasksList.ClientWidth) div 2;
LoadBGBmpFromBitmap(BGImage.Bitmap, WizardForm.TasksList.Left+BorderWidth, WizardForm.TasksList.Top+BorderWidth);
LoadBtnBmpFromBitmap(btnimage.Bitmap);
end;
#endif

/////////////////////////////////////////////////ñò.Èòîãî\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
BGImageStream.position:=0;

ReadyLabel:= CreateLabel(WizardForm, ScaleX(345), ScaleY(208), ScaleX(0), ScaleY(0), ExpandConstant('{cm:ReadyLabel}'), true);
LabelSetFont(ReadyLabel, 8, 'Tahoma', $FFFFFF, [fsBold]);
ReadyLabel.Alignment := taLeftJustify;

ReadyPanel := TPanel.Create(WizardForm);
with ReadyPanel do begin
Parent := WizardForm;
SetBounds(ScaleX(5), ScaleY(208), ScaleX(335), ScaleY(148));
BorderStyle := bsSingle;
end;

ReadyBitmap := TBitmapImage.Create(WizardForm);
with ReadyBitmap do begin
Parent := ReadyPanel;
SetBounds(ScaleX(-7), ScaleY(-210), ScaleX(700), ScaleY(394));
Bitmap.LoadFromStream(BGImageStream);
end;

ReadyScrollBar := TScrollBar.Create(WizardForm);
with ReadyScrollBar do begin
Parent := ReadyPanel;
SetBounds(ScaleX(315), ScaleY(0), ScaleX(144), ScaleY(16));
Kind := sbVertical;
OnScroll:=@ScrollText3Scroll;
end;

ReadyPanelLabel := TLabel.Create(WizardForm);
with ReadyPanelLabel do begin
Parent := ReadyPanel;
WordWrap := true;
Transparent:=true;
Font.Name:='Tahoma';
Font.Size:= 8;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold];
SetBounds(ScaleX(5), ScaleY(5), ScaleX(325), ScaleY(130));
Caption := WizardForm.ReadyMemo.Lines.Text;
end;
////////////////////////////////////////////ñò.Óñòàíîâêà\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

IsDoneAddComponents

InstallingLabel:= CreateLabel(WizardForm, ScaleX(105), ScaleY(220), ScaleX(0), ScaleY(0), ExpandConstant('{cm:InstallingLabel}'), true);
LabelSetFont(InstallingLabel, 9, 'Tahoma', $FFFFFF, [fsBold]);

StatusLabel:= CreateLabel(WizardForm, ScaleX(105), ScaleY(240), ScaleX(0), ScaleY(0), ExpandConstant('{cm:Extracted}'), true);
LabelSetFont(StatusLabel, 8, 'Tahoma', $FFFFFF, [fsBold]);

/////////////////////////////////////////////ñò.Êîíåö\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

FinishedHeadingLabel:= CreateLabel(WizardForm, ScaleX(0), ScaleY(245), ScaleX(700), ScaleY(80), ExpandConstant('{cm:FinishedHeadingLabel}'), false);
LabelSetFont(FinishedHeadingLabel, 10, 'Tahoma', $FFFFFF, [fsBold]);
FinishedHeadingLabel.Alignment := taCenter;

FinishedLabel:= CreateLabel(WizardForm, ScaleX(0), ScaleY(275), ScaleX(700), ScaleY(150), ExpandConstant('{cm:FinishedLabel}'), false);
LabelSetFont(FinishedLabel, 8, 'Tahoma', $FFFFFF, [fsBold]);
FinishedLabel.Alignment := taCenter;
end;



procedure HideComponents;
begin;
WelcomeLabel1.Hide;
WelcomeLabel2.Hide;
SelectDirLabel.Hide;
SelectDirBrowseLabel.Hide;
#ifdef Components
SelectComponentsLabel.Hide;
WizardForm.ComponentsList.Hide;
#endif
#ifdef Tasks
SelectTasksLabel.Hide;
WizardForm.TasksList.Hide;
#endif
SelectStartMenuFolderLabel.Hide;
SelectStartMenuFolderBrowseLabel.Hide;
DirEditLabel.Hide;
TotalSpaceLabel.Hide;
FreeSpaceLabel.Hide;
InstallSpacelabel.Hide;
NeedSpaceLabel.Hide;
TotalSpaceLabel2.Hide;
FreeSpaceLabel2.Hide;
InstallSpacelabel2.Hide;
NeedSpaceLabel2.Hide;
GroupEditLabel.Hide;
NoIconsLabel.Hide;
InstallingLabel.Hide;
StatusLabel.Hide;
FinishedHeadingLabel.Hide;
FinishedLabel.Hide;
IMGSetVisibility(DirFolder,False);
IMGSetVisibility(DirEditImg,False);
IMGSetVisibility(HDD,False);
IMGSetVisibility(GroupFolder,False);
BtnSetVisibility(hDirBrowseBtn,False);
BtnSetVisibility(hGroupBrowseBtn,False);
BtnSetVisibility(NoIconsCheck,False);
ReadyPanel.Hide;
ReadyBitmap.Hide;
ReadyScrollBar.Hide;
ReadyPanelLabel.Hide;
ReadyLabel.Hide;
IsDoneHide;
end;

procedure ShowComponents(CurPageID: Integer);
begin
case CurPageID of
wpWelcome: begin
WelcomeLabel1.Show;
WelcomeLabel2.Show;
end;

wpSelectDir: begin
SelectDirLabel.Show;
SelectDirBrowseLabel.Show;
DirEditLabel.Show;
TotalSpaceLabel.Show;
FreeSpaceLabel.Show;
InstallSpacelabel.Show;
NeedSpaceLabel.Show
TotalSpaceLabel2.Show;
FreeSpaceLabel2.Show;
InstallSpacelabel2.Show;
NeedSpaceLabel2.Show;
IMGSetVisibility(DirFolder,True);
IMGSetVisibility(DirEditImg,True);
IMGSetVisibility(HDD,True);
BtnSetVisibility(hDirBrowseBtn,True);
end;

#ifdef Components
wpSelectComponents: begin
SelectComponentsLabel.Show;
WizardForm.ComponentsList.Show;
end;
#endif

wpSelectProgramGroup: begin
SelectStartMenuFolderLabel.Show;
SelectStartMenuFolderBrowseLabel.Show;
GroupEditLabel.Show;
NoIconsLabel.Show;
IMGSetVisibility(DirEditImg,True);
IMGSetVisibility(GroupFolder,True);
BtnSetVisibility(NoIconsCheck,True);
BtnSetVisibility(hGroupBrowseBtn,True);
end;

#ifdef Tasks
wpSelectTasks: begin
SelectTasksLabel.Show;
WizardForm.TasksList.Show;
end;
#endif

wpReady: begin
ReadyBitmap.Show;
ReadyScrollBar.Show;
ReadyPanelLabel.Show;
ReadyPanel.Show;
ReadyLabel.Show;
ReadyPanelLabel.Caption := WizardForm.ReadyMemo.Lines.Text;
end;

wpInstalling: begin
InstallingLabel.Show;
StatusLabel.Show;
IsDoneShow();
end;

wpFinished: begin
FinishedHeadingLabel.Show;
FinishedLabel.Show;
LabelTime3.Show;
end;
end;
end;

function UninstPBProc(h:hWnd;Msg,wParam,lParam:Longint):Longint;
var
pr,i1,i2:Extended;
p:string;
begin
if Msg=$2 then SetWindowLong(h,-4,UninstPBOldProc);
Result:=CallWindowProc(UninstPBOldProc,h,Msg,wParam,lParam);
if (Msg=$402) and (UninstallProgressForm.ProgressBar.Position>UninstallProgressForm.ProgressBar.Min) then begin
i1:=UninstallProgressForm.ProgressBar.Position-UninstallProgressForm.ProgressBar.Min;
i2:=UninstallProgressForm.ProgressBar.Max-UninstallProgressForm.ProgressBar.Min;
pr:=(i1*100)/i2;
p:=+Format('%f',[pr])+'%';
UnLabelPct.Caption:=p;
StringChange(p,',','.');
ImgPBSetPositionUn(UninstPB,pr);
ImgApplyChangesBotvaU(UninstallProgressForm.Handle);
end;
end;


procedure CurPageChanged(CurPageID: Integer);
begin
HideComponents;
ShowComponents(CurPageID);
WizardForm.NextButton.Enabled:= True;
if CurPageID = wpSelectDir then
ObjectFunc(WizardForm.DirEdit);
if (CurPageID = wpFinished) and ISDoneError then begin
LabelTime3.Hide;
WizardForm.Caption:= ExpandConstant('{cm:Error}');
FinishedLabel.Font.Color:= $0000FF;
FinishedHeadingLabel.Caption:= ExpandConstant('{cm:ErrorFinishedHeadingLabel}');
FinishedLabel.Caption:= ExpandConstant('{cm:ErrorFinishedLabel}');
DelTree(ExpandConstant('{app}'), True, True, True);
end;
SetStateNewButtons;
ImgApplyChanges(WizardForm.Handle);
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
IsDoneUnpack(CurStep);
end;


procedure InitializeWizard;
begin
#ifdef Music
ExtractTemporaryFile('bass.dll');
ExtractTemporaryFile('CallbackCtrl.dll');
ExtractTemporaryFile('botva2.dll');
ExtractTemporaryFile('music.mp3');
ExtractTemporaryFile('MusicButton.png');

BASS_Init('{tmp}\music.mp3')
BASS_CreateOnOffButton(WizardForm, '{tmp}\MusicButton.png', 20, 320, 36, 36, 4)
#endif

#ifdef Splash
ExtractTemporaryFile('Splash.png');
ExtractTemporaryFile('isgsg.dll');
ShowSplashScreen(WizardForm.Handle,ExpandConstant('{tmp}')+'\Splash.png',1000,3000,1000,0,255,False, $FFFFFF,10);
#endif
CreateWizardForm;
ButtonsTextures;
end;


function InitializeSetup: Boolean;
begin
ExtractTemporaryFile('botva2.dll');
ExtractTemporaryFile('b2p.dll');
ExtractTemporaryFile('CallbackCtrl.dll');
ExtractTemporaryFile('Click.wav');
ExtractTemporaryFile('skin.cjstyles');
LoadSkin(ExpandConstant('{tmp}\skin.cjstyles'), '');
Result := True;
end;


procedure DeinitializeSetup;
begin
BGImageStream.Free();
BTNImageStream.Free();
WFButtonFont.Free();
BASS_DeInit;
gdipShutdown();
UnloadSkin();
end;


Отправлено: 18:37, 06-01-2015 | #511

Название темы: Inno Setup. Прочие вопросы