Показать полную графическую версию : Скрипты Inno Setup. Помощь и советы [часть 3]
Gnom_aka_Lexander
12-06-2011, 13:38
serhio, исправляеш расширение архива на bin, или любое другое, но не забываеш указывать это расширение в скрипте, там где ты выделил.
только для использования именно FreeArc нужно раскоментировать строчку #define FreeArc.
Лександер, спасибо, все вышло!
как в этом скрипте чтобы вконце на финиш странице не было белого фона
http://img862.imageshack.us/img862/108/12652444.jpg (http://img862.imageshack.us/i/12652444.jpg/)
#define GameName "Crysis Warhead"
#define NeedSize "10000000000"
#define precomp038
#define ExeName "Crysis2Launcher.exe"
#define ExeDir "bin32\"
[Setup]
SetupIconFile=iconset.ico
AppName={#GameName}
AppVerName={#GameName}
DefaultDirName={pf}\{#GameName}
DefaultGroupName={#GameName}
OutputDir=.
OutputBaseFilename=Setup
SolidCompression=true
#ifdef NeedSize
ExtraDiskSpaceRequired={#NeedSize}
#endif
WizardImageFile=img.bmp
WizardSmallImageFile=shapka.bmp
#ifdef Components
Compression=lzma2/ultra64
InternalCompressLevel=ultra64
PrivilegesRequired=lowest
[Types]
Name: "full"; Description: "Full installation"; Flags: iscustom
#endif
[Run]
Filename: {src}\Redist\dxwebsetup.exe; Description: DirectX 9.0c; WorkingDir: "{src}\redist"; Parameters: /silent; StatusMsg: Установка DirectX 9.0c...; Flags: runascurrentuser nowait postinstall skipifsilent unchecked;
Filename: {src}\Redist\vcredist_x86_2005_sp1.exe; Description: Microsoft Visual C++ Redistibutable 2005...; Parameters: /silent; StatusMsg: Microsoft Visual C++ Redistibutable 2005...; Flags: nowait postinstall skipifsilent unchecked;
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "C:\Users\Admin\Desktop\1\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "logo2.bmp"; DestDir: "{app}"; Attribs: hidden system;
Source: "DirBitmap.bmp"; DestDir: "{tmp}"; Flags: dontcopy
Source: ISDone.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\InnoCallback.dll; DestDir: {tmp}; Flags: dontcopy
#ifdef records
Source: records.inf; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef precomp038
Source: Include\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\RTconsole.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\precomp038.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\zlib1.dll; DestDir: {tmp}; Flags: dontcopy
#endif
[Icons]
Name: {group}\{#GameName}; Filename: {app}\{#ExeDir}{#ExeName}; WorkingDir: {app}\{#ExeDir}; Comment: {#GameName};
Name: {group}\Удалить игру; Filename: {app}\Uninstall\unins000; WorkingDir: {app}\Uninstall\; Comment: Удалить игру;
[CustomMessages]
russian.ExtractedFile=Распаковывается файл:
russian.CancelButton=Отменить распаковку
russian.Error=Ошибка распаковки!
russian.Soft=Установить дополнительное ПО
[Languages]
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
[UninstallDelete]
Type: filesandordirs; Name: {app}
[ Code]
var
LabelPct,LabelCurrFileName: TLabel;
ISDoneProgressBar: TNewProgressBar;
MyCancelButton: TButton;
OveralPct,Cancel:integer;
CallBack:longword;
MyError:boolean;
FinishedLabel: TLabel;
Text: TNewStaticText;
LogoImage: TBitmapImage;
type
TCallback = function (Pct: integer;CurrentFile:string): longword;
TMessage = record hWnd: HWND; msg, wParam: Word; lParam: LongWord; Time: TFileTime; pt: TPoint; end;
function PeekMessage(var lpMsg: TMessage; hWnd: HWND; wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): BOOL; external 'PeekMessageA@user32.dll stdcall';
function TranslateMessage(const lpMsg: TMessage): BOOL; external 'TranslateMessage@user32.dll stdcall';
function DispatchMessage(const lpMsg: TMessage): Longint; external 'DispatchMessageA@user32.dll stdcall';
function WrapMyCallback(callback:TCallback; paramcount:integer):longword;external 'wrapcallback@files:innocallback.dll stdcall';
function ISArcExtract(CurComponent:longword; var OveralPct:integer; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; callback: longword; Password, CfgFile, WorkPath: AnsiString):BOOL; external 'ISArcExtract@files:ISDone.dll stdcall';
function IS7ZipExtract(CurComponent:longword; var OveralPct:integer; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; callback: longword; Password: AnsiString):BOOL; external 'IS7zipExtract@files:ISDone.dll stdcall';
function ISPrecompExtract(CurComponent:longword; var OveralPct:integer; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean; callback: longword):BOOL; external 'ISPrecompExtract@files:ISDone.dll stdcall';
function ISSRepExtract(CurComponent:longword; var OveralPct:integer; PctOfTotal:double; InName, OutFile, IdxFile: AnsiString; DeleteInFile:boolean; callback: longword):BOOL; external 'ISSrepExtract@files:ISDone.dll stdcall';
function ShowChangeDiskWindow(Text, DefaultPath, SearchFile:AnsiString):BOOL; external 'ShowChangeDiskWindow@files:ISDone.dll stdcall';
function StartRecord(RecordFileName:AnsiString; AllComponents:longword):BOOL; external 'StartRecord@files:ISDone.dll stdcall';
function CheckPoint(CurComponent:Integer):BOOL; external 'CheckPoint@files:ISDone.dll stdcall';
function StopRecord:BOOL; external 'StopRecord@files:ISDone.dll stdcall';
function ProgressCallback(Pct: integer; CurrentFile:AnsiString): longword;
var Msg: TMessage;
begin
if Pct<=ISDoneProgressBar.Max then
ISDoneProgressBar.Position := Pct;
LabelPct.Caption := IntToStr(Pct div 10)+'.'+chr(48 + Pct mod 10)+'%';
LabelCurrFileName.Caption :=ExpandConstant('{cm:ExtractedFile} ')+CurrentFile;
while PeekMessage(Msg, 0, 0, 0, 1) do begin
TranslateMessage(Msg);
DispatchMessage(Msg);
end;
Result := Cancel;
end;
procedure CancelButtonOnClick(Sender: TObject);
begin
if MsgBox(SetupMessage(msgExitSetupMessage), mbConfirmation, MB_YESNO) = IDYES then Cancel:=1;
end;
procedure InitializeWizard();
begin
ExtractTemporaryFile('DirBitmap.bmp');
ExtractTemporaryFile('logo2.bmp');
LogoImage := TBitmapImage.Create(WizardForm);
with LogoImage do
begin
SetBounds(ScaleX(10), ScaleY(320), ScaleX(175), ScaleY(35));
Bitmap.LoadFromFile(ExpandConstant('{tmp}\logo2.bmp'));
Parent := WizardForm;
end;
with WizardForm.WizardSmallBitmapImage do
begin
SetBounds(ScaleX(0), ScaleY(2), ScaleX(497), ScaleY(56));
end;
with WizardForm.SelectDirBitmapImage do
begin
SetBounds(ScaleX(0), ScaleY(0), ScaleX(42), ScaleY(42));
end;
WizardForm.SelectDirBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\DirBitmap.bmp'));
WizardForm.MainPanel.Color := clGray;
WizardForm.WizardBitmapImage.Width := 497;
WizardForm.WizardBitmapImage2.Width := 497;
WizardForm.PageNameLabel.Width:=0;
WizardForm.PageDescriptionLabel.Hide;
WizardForm.Font.Color:=clblack;
WizardForm.Color:=clGray;
WizardForm.WelcomePage.Color:=clGray;
WizardForm.InnerPage.Color:=clGray;
WizardForm.SelectDirPage.Color:=clGray;
WizardForm.WelcomeLabel1.Hide;
WizardForm.WelcomeLabel2.Hide;
with TLabel.Create(WizardForm) do begin
AutoSize:=WizardForm.WelcomeLabel1.AutoSize;
Left:=WizardForm.WelcomeLabel1.Left;
Top:=WizardForm.WelcomeLabel1.Top
Width:=WizardForm.WelcomeLabel1.Width
Height:=WizardForm.WelcomeLabel1.Height
WordWrap:=WizardForm.WelcomeLabel1.WordWrap;
Font.Name:=WizardForm.WelcomeLabel1.Font.Name;
Font.Size:=WizardForm.WelcomeLabel1.Font.Size;
Font.Color:=clblack; // text colour верхнє
Font.Style:=WizardForm.WelcomeLabel1.Font.Style;
Caption:=WizardForm.WelcomeLabel1.Caption;
Parent:=WizardForm.WelcomeLabel1.Parent
Transparent:=True
end;
with TLabel.Create(WizardForm) do begin
AutoSize:=WizardForm.WelcomeLabel2.AutoSize;
Left:=WizardForm.WelcomeLabel2.Left;
Top:=WizardForm.WelcomeLabel2.Top
Width:=WizardForm.WelcomeLabel2.Width
Height:=WizardForm.WelcomeLabel2.Height
WordWrap:=WizardForm.WelcomeLabel2.WordWrap;
Font.Name:=WizardForm.WelcomeLabel2.Font.Name;
Font.Size:=WizardForm.WelcomeLabel2.Font.Size;
Font.Color:=clblack; // text colour нижнє
Font.Style:=WizardForm.WelcomeLabel2.Font.Style;
Caption:=WizardForm.WelcomeLabel2.Caption;
Parent:=WizardForm.WelcomeLabel2.Parent
Transparent:=True
end;
FinishedLabel:= TLabel.Create(WizardForm);
WizardForm.FinishedLabel.Hide;
with FinishedLabel do begin
Font.Size:=9;
Font.Color:=clSilver;
Font.Style:=[fsBold];
Parent:=WizardForm;
Transparent:=True;
end;
WizardForm.FinishedHeadingLabel.Hide;
with TLabel.Create(WizardForm) do begin
AutoSize:=WizardForm.FinishedHeadingLabel.AutoSize;
Left:=WizardForm.FinishedHeadingLabel.Left;
Top:=WizardForm.FinishedHeadingLabel.Top
Width:=WizardForm.FinishedHeadingLabel.Width
Height:=WizardForm.FinishedHeadingLabel.Height
WordWrap:=WizardForm.FinishedHeadingLabel.WordWrap;
Font.Name:=WizardForm.FinishedHeadingLabel.Font.Name;
Font.Size:=WizardForm.FinishedHeadingLabel.Font.Size;
Font.Color:=clblack; // text colour в конце инсталлятора
Font.Style:=WizardForm.FinishedHeadingLabel.Font.Style;
Caption:=WizardForm.FinishedHeadingLabel.Caption;
Parent:=WizardForm.FinishedHeadingLabel.Parent
Transparent:=True
end;
FinishedLabel:= TLabel.Create(WizardForm)
WizardForm.FinishedLabel.Hide;
with TLabel.Create(WizardForm) do begin
WordWrap:=WizardForm.FinishedLabel.WordWrap;
Font.Name:=WizardForm.FinishedLabel.Font.Name;
Font.Size:=WizardForm.FinishedLabel.Font.Size;
Font.Color:=clgreen; // text colour
Font.Style:=WizardForm.FinishedLabel.Font.Style;
Caption:=WizardForm.FinishedLabel.Caption;
Parent:=WizardForm.FinishedLabel.Parent
Transparent:=True
end;
ISDoneProgressBar := TNewProgressBar.Create(WizardForm);
with ISDoneProgressBar do begin
Left := ScaleX(0);
Top := ScaleY(40);
Width := ScaleX(417);
Max := 1000;
Height := WizardForm.ProgressGauge.Height;
Parent := WizardForm.InstallingPage;
end;
LabelPct := TLabel.Create(WizardForm);
with LabelPct do begin
Parent := WizardForm.InstallingPage;
AutoSize := False;
Width := WizardForm.ProgressGauge.Width;
Top := WizardForm.ProgressGauge.Top + ScaleY(50);
Font.Size := 10;
Font.Color := clSilver;
Alignment := taCenter;
Caption := '';
end;
LabelCurrFileName := TLabel.Create(WizardForm);
with LabelCurrFileName do begin
Parent := WizardForm.InstallingPage;
AutoSize := False;
Width := WizardForm.ProgressGauge.Width;
Left := ScaleX(0);
Top := WizardForm.ProgressGauge.Top + ScaleY(25);
Caption := '';
end;
end;
Procedure CurPageChanged(CurPageID: Integer);
Begin
if (CurPageID = wpFinished) and MyError then
begin
with TLabel.Create(WizardForm) do begin
WizardForm.FinishedLabel.Hide;
AutoSize:=WizardForm.FinishedHeadingLabel.AutoSize;
Left:=WizardForm.FinishedLabel.Left;
Top:=WizardForm.FinishedLabel.Top
Width:=WizardForm.FinishedLabel.Width
Height:=WizardForm.FinishedLabel.Height
WordWrap:=WizardForm.FinishedLabel.WordWrap;
Font.Name:=WizardForm.FinishedLabel.Font.Name;
Font.Size:=WizardForm.FinishedLabel.Font.Size;
WizardForm.Caption:= ExpandConstant('{cm:Error}');
WizardForm.FinishedLabel.Font.Color:= clyellow;
WizardForm.FinishedLabel.Caption:= SetupMessage(msgSetupAborted);
Font.Color:=clwhite;
Font.Style:=WizardForm.FinishedLabel.Font.Style;
Caption:=WizardForm.FinishedLabel.Caption;
Parent:=WizardForm.FinishedLabel.Parent
Transparent:=True
end;
end;
end;
procedure CurStepChanged(CurStep: TSetupStep);
var ChComp, TmpValue:longword;
n:integer;
begin
if CurStep = ssPostInstall then begin
WizardForm.ProgressGauge.Hide;
WizardForm.CancelButton.Visible:=false;
MyCancelButton:=TButton.Create(WizardForm);
with MyCancelButton do begin
Parent:=WizardForm;
Width:=ScaleX(135);
Caption:=ExpandConstant('{cm:CancelButton}');
Left:=ScaleX(360);
Top:=WizardForm.cancelbutton.top;
OnClick:=@CancelButtonOnClick;
end;
CallBack:=WrapMyCallback(@ProgressCallback,2);
Cancel:=0;
OveralPct:=0;
#ifdef records
ExtractTemporaryFile('records.inf');
#endif
#ifdef precomp038
ExtractTemporaryFile('packjpg_dll.dll');
ExtractTemporaryFile('RTconsole.exe');
ExtractTemporaryFile('precomp038.exe');
ExtractTemporaryFile('zlib1.dll');
#endif
ChComp:=0;
StartRecord(ExpandConstant('{src}\records.inf'),ChComp);
repeat
MyError:=true;
CallBack:=WrapMyCallback(@ProgressCallback,2);
OveralPct:=0;
ISArcExtract ( 0, OveralPct, 25, ExpandConstant('{src}\muzk.arc'), ExpandConstant('{app}'),false,CallBack, '', '', '')
ISSRepExtract ( 0, OveralPct, 25, ExpandConstant('{app}\muzk.srep'), ExpandConstant('{app}\muzk.pcf'), '', true, CallBack)
ISPrecompExtract( 0, OveralPct, 25, ExpandConstant('{app}\muzk.pcf'), ExpandConstant('{app}\muzk.7z'),true, CallBack)
IS7ZipExtract ( 0, OveralPct, 25, ExpandConstant('{app}\muzk.7z'), ExpandConstant('{app}'),true, CallBack, '')
MyError:=false;
until true;
StopRecord;
MyCancelButton.Visible:=false;
WizardForm.CancelButton.Visible:=true;
end;
if (CurStep=ssPostInstall) and MyError then
Exec(ExpandConstant('{uninstallexe}'), '/SILENT','', sw_Hide, ewWaitUntilTerminated, n);
end;
Gnom_aka_Lexander
12-06-2011, 17:09
tiestos, Можно так так попробовать:
[Files]
Source: "BGImage.bmp"; Flags: dontcopy solidbreak
[Code]
var
BGImgFile: String;
procedure InitializeWizard();
begin
with WizardForm.RunList do
begin
ExtractTemporaryFile('BGImage.bmp');
BGImgFile := ExpandConstant('{tmp}\BGImage.bmp');
LoadBGBmpFromFile(BGImgFile, WizardForm.RunList.Left, WizardForm.RunList.Top);
end;
end;BGImage.bmp - картинка, которую показываеш на финишной странице.
Теоретически класс объекта WizardForm.RunList подходит для procedure LoadBGBmpFromFile(FileName: String; OffsetX, OffsetY: Integer); прикрепил твой скрипт во вложении.
Чуть не забыл, LoadBGBmpFromFile работает только на расширенной версии компилятора.
insombia
12-06-2011, 18:38
http://rghost.ru/10512071 кто может мне обеденить скрипт с isdon'ом?
Lubitel Softa
12-06-2011, 19:16
tiestos, ИМХО, картинка не подходит к CRYSIS Warhead. Это во второй части действия происходят в городе а в Warhead должно быть как-то так:
http://www.diskoff.ua/images/it/46743_8805_img_lrg.jpg
No4noylis
12-06-2011, 21:03
Пожалуйста помогите, как убрать кнопку отключения музыки инсталятора со страници приветствия?????
И как в скине написать вот такое http://s2.ipicture.ru/uploads/20110612/QWirhlhR.png . Я не могу разобраться с IS Skin Builder! Помогите Плиз!!!1
insombia
12-06-2011, 21:59
No4noylis то лого
[Files]
Source: Button.bmp; Flags: dontcopy
[Code]
procedure LogoOnClick(Sender: TObject);
var ResCode: Integer;
begin
ShellExec('', 'http://www.forum.ru-board.com', '' , '', SW_SHOW, ewNoWait, ResCode)
end;
procedure InitializeWizard();
var
BtnPanel: TPanel;
BtnImage: TBitmapImage;
begin
ExtractTemporaryFile('Button.bmp')
BtnPanel:=TPanel.Create(WizardForm)
with BtnPanel do begin
Left:=20
Top:=325
Width:=132
Height:=27
Cursor:=crHand
OnClick:=@logoOnClick
Parent:=WizardForm
end
BtnImage:=TBitmapImage.Create(WizardForm)
with BtnImage do begin
AutoSize:=True;
Enabled:=False;
Bitmap.LoadFromFile(ExpandConstant('{tmp}')+'\Button.bmp')
Parent:=BtnPanel
end
end;
No4noylis
12-06-2011, 22:06
Спасибо большое!!! А по поводу удаления кнопки на страничке приветствия????
insombia
12-06-2011, 22:15
Спасибо большое!!! нажми Полезное сообщение А по поводу удаления кнопки я не знаю скрипт нужно вылаживать там тебе помогут
No4noylis
12-06-2011, 22:21
Вот скрипт на проигрывание музыки: (Повторюсь, нужно убрать кнопку отключения со странички приветствия)
[Files]
Source: "BASS.dll"; DestDir: "{tmp}"; Flags: dontcopy noencryption
Source: "sound.mp3"; DestDir: "{tmp}"; Flags: dontcopy noencryption nocompression
Source: "MusicButton.bmp"; DestDir: "{tmp}"; Flags: dontcopy
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
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
end;
procedure MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
PlayImage.Left := 0
PauseImage.Left := -32
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 := 460
PlayButton.Top := 65
PlayButton.Width := 32
PlayButton.Height := 33
PlayButton.Cursor := crHand
PlayButton.ShowHint := True
PlayButton.Hint := 'Воспроизведение музыки'
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 := 460
PauseButton.Top := 65
PauseButton.Width := 32
PauseButton.Height := 33
PauseButton.Cursor := crHand
PauseButton.ShowHint := True
PauseButton.Hint := 'Приостановить музыку'
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
end;
procedure DeinitializeSetup();
begin
BASS_Stop();
BASS_Free();
end;
insombia
12-06-2011, 22:35
как растянуть первую и последнюю картинку на всё окно?
Всем доброго вечера!
Что нужно добавить в скрипт, что-бы отображались *.PNG изображения?
Вот скрипт:
#define GameName "Crysis Warhead"
#define NeedSize "10000000000"
#define precomp038
#define ExeName "Crysis2Launcher.exe"
#define ExeDir "bin32\"
[Setup]
; ³êîíêà ³íñòàëà
SetupIconFile=iconset.ico
AppName={#GameName}
AppVerName={#GameName}
DefaultDirName={pf}\{#GameName}
DefaultGroupName={#GameName}
OutputDir=.
; íàçâà ôàéëà ³íñòàëÿòîðà
OutputBaseFilename=Setup
SolidCompression=true
#ifdef NeedSize
ExtraDiskSpaceRequired={#NeedSize}
#endif
; ôîí
WizardImageFile=img.bmp
; øàïêà
WizardSmallImageFile=shapka.bmp
Compression=lzma2/ultra64
InternalCompressLevel=ultra64
[Types]
Name: "full"; Description: "Full installation"; Flags: iscustom
[Components]
Name: "text"; Description: "ßçûê ñóáòèòðîâ"; Types: full; Flags: fixed
Name: "text\rus"; Description: "Ðóññêèé"; Flags: exclusive; ExtraDiskSpaceRequired: 60000000
Name: "text\eng"; Description: "Àíãëèéñêèé"; Flags: exclusive; ExtraDiskSpaceRequired: 58000000
[Run]
Filename: {src}\Redist\dxwebsetup.exe; Description: DirectX 9.0c; WorkingDir: "{src}\redist"; Parameters: /q; StatusMsg: Óñòàíîâêà DirectX 9.0c...; Flags: runascurrentuser nowait postinstall skipifsilent;
Filename: {src}\Redist\vcredist_x86_2005_sp1.exe; Description: Microsoft Visual C++ Redistibutable 2005...; Parameters: /q; StatusMsg: Microsoft Visual C++ Redistibutable 2005...; Flags: nowait postinstall skipifsilent ;
Filename: {src}\Redist\XLive\xLiveRedist.exe; Description: xLive; StatusMsg: "Óñòàíîâêà XLive..."; Flags: runhidden waituntilterminated postinstall;
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: botva2.dll; DestDir: {app}; Flags: ignoreversion; Attribs: hidden system;
Source: ISWin7.dll; DestDir: {tmp}; Flags: dontcopy
Source: "img.bmp"; DestDir: "{app}"; Attribs: hidden system;
; çàì³íèòü
Source: "C:\Users\ntrx\Desktop\1\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "logo2.png"; DestDir: "{app}"; Attribs: hidden system;
Source: "DirBitmap.bmp"; DestDir: "{tmp}"; Flags: dontcopy
Source: ISDone.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\InnoCallback.dll; DestDir: {tmp}; Flags: dontcopy
#ifdef records
Source: records.inf; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef precomp038
Source: Include\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\RTconsole.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\precomp038.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\zlib1.dll; DestDir: {tmp}; Flags: dontcopy
#endif
[Icons]
Name: {group}\{#GameName}; Filename: {app}\{#ExeDir}{#ExeName}; WorkingDir: {app}\{#ExeDir}; Comment: {#GameName};
Name: {group}\Óäàëèòü èãðó; Filename: {app}\Uninstall\unins000; WorkingDir: {app}\Uninstall\; Comment: Óäàëèòü èãðó;
; ²êîíêà íà ðîá. ñò³ë
Name: "{commondesktop}\{#GameName}"; Filename: "{app}\{#ExeDir}{#ExeName}"; WorkingDir: "{app}\{#ExeDir}"; Comment: "{#GameName}"; Tasks: desktopicon;
[CustomMessages]
russian.ExtractedFile=Ðàñïàêîâûâàåòñÿ ôàéë:
russian.CancelButton=Îòìåíèòü ðàñïàêîâêó
russian.Error=Îøèáêà ðàñïàêîâêè!
russian.Soft=Óñòàíîâèòü äîïîëíèòåëüíîå ÏÎ
[Languages]
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
[UninstallDelete]
Type: filesandordirs; Name: {app}
[ Code]
var
LabelPct,LabelCurrFileName: TLabel;
ISDoneProgressBar: TNewProgressBar;
MyCancelButton: TButton;
OveralPct,Cancel:integer;
CallBack:longword;
MyError:boolean;
FinishedLabel: TLabel;
Text: TNewStaticText;
LogoImage: TBitmapImage;
// WizardImg: String;
const
BTN_MAX_PATH = 1024; //íå èçìåíÿòü !!!
BtnClickEventID = 1;
BtnMouseEnterEventID = 2;
BtnMouseLeaveEventID = 3;
BtnMouseMoveEventID = 4;
BtnMouseDownEventID = 5;
BtnMouseUpEventID = 6;
balLeft = 0; //âûðàâíèâàíèå òåêñòà ïî ëåâîìó êðàþ
balCenter = 1; //ãîðèçîíòàëüíîå âûðàâíèâàíèå òåêñòà ïî öåíòðó
balRight = 2; //âûðàâíèâàíèå òåêñòà ïî ïðàâîìó êðàþ
balVCenter = 4; //âåðòèêàëüíîå âûðàâíèâàíèå òåêñòà ïî öåíòðó
type
#ifndef UNICODE
AnsiChar = Char;
#endif
TBtnEventProc = procedure(h:HWND);
TTextBuf = array [0..BTN_MAX_PATH-1] of AnsiChar; //íå ìåíÿòü ðàçìåðíîñòü ìàññèâà !!!
type
TCallback = function (Pct: integer;CurrentFile:string): longword;
TMessage = record hWnd: HWND; msg, wParam: Word; lParam: LongWord; Time: TFileTime; pt: TPoint; end;
function PeekMessage(var lpMsg: TMessage; hWnd: HWND; wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): BOOL; external 'PeekMessageA@user32.dll stdcall';
function TranslateMessage(const lpMsg: TMessage): BOOL; external 'TranslateMessage@user32.dll stdcall';
function DispatchMessage(const lpMsg: TMessage): Longint; external 'DispatchMessageA@user32.dll stdcall';
function WrapMyCallback(callback:TCallback; paramcount:integer):longword;external 'wrapcallback@files:innocallback.dll stdcall';
function ISArcExtract(CurComponent:longword; var OveralPct:integer; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; callback: longword; Password, CfgFile, WorkPath: AnsiString):BOOL; external 'ISArcExtract@files:ISDone.dll stdcall';
function IS7ZipExtract(CurComponent:longword; var OveralPct:integer; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; callback: longword; Password: AnsiString):BOOL; external 'IS7zipExtract@files:ISDone.dll stdcall';
function ISPrecompExtract(CurComponent:longword; var OveralPct:integer; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean; callback: longword):BOOL; external 'ISPrecompExtract@files:ISDone.dll stdcall';
function ISSRepExtract(CurComponent:longword; var OveralPct:integer; PctOfTotal:double; InName, OutFile, IdxFile: AnsiString; DeleteInFile:boolean; callback: longword):BOOL; external 'ISSrepExtract@files:ISDone.dll stdcall';
function ShowChangeDiskWindow(Text, DefaultPath, SearchFile:AnsiString):BOOL; external 'ShowChangeDiskWindow@files:ISDone.dll stdcall';
function StartRecord(RecordFileName:AnsiString; AllComponents:longword):BOOL; external 'StartRecord@files:ISDone.dll stdcall';
function CheckPoint(CurComponent:Integer):BOOL; external 'CheckPoint@files:ISDone.dll stdcall';
function StopRecord:BOOL; external 'StopRecord@files:ISDone.dll stdcall';
//// iamges support
function WrapBtnCallback(Callback: TBtnEventProc; ParamCount: Integer): Longword; external 'wrapcallback@{tmp}\innocallback.dll stdcall delayload';
function ImgLoad(Wnd :HWND; FileName :PAnsiChar; Left, Top, Width, Height :integer; Stretch, IsBkg :boolean) :Longint; external 'ImgLoad@{tmp}\botva2.dll stdcall delayload';
procedure ImgSetVisiblePart(img:Longint; NewLeft, NewTop, NewWidth, NewHeight : integer); external 'ImgSetVisiblePart@{tmp}\botva2.dll stdcall delayload';
procedure ImgGetVisiblePart(img:Longint; var Left, Top, Width, Height : integer); external 'ImgGetVisiblePart@{tmp}\botva2.dll stdcall delayload';
procedure ImgSetPosition(img :Longint; NewLeft, NewTop, NewWidth, NewHeight :integer); external 'ImgSetPosition@{tmp}\botva2.dll stdcall delayload';
procedure ImgGetPosition(img:Longint; var Left, Top, Width, Height:integer); external 'ImgGetPosition@{tmp}\botva2.dll stdcall delayload';
procedure ImgSetVisibility(img :Longint; Visible :boolean); external 'ImgSetVisibility@{tmp}\botva2.dll stdcall delayload';
function ImgGetVisibility(img:Longint):boolean; external 'ImgGetVisibility@{tmp}\botva2.dll stdcall delayload';
procedure ImgRelease(img :Longint); external 'ImgRelease@{tmp}\botva2.dll stdcall delayload';
procedure ImgApplyChanges(h:HWND); external 'ImgApplyChanges@{tmp}\botva2.dll stdcall delayload';
function BtnCreate(hParent :HWND; Left, Top, Width, Height :integer; FileName :PAnsiChar; ShadowWidth :integer; IsCheckBtn :boolean) :HWND; external 'BtnCreate@{tmp}\botva2.dll stdcall delayload';
procedure BtnSetText(h :HWND; Text :PAnsiChar); external 'BtnSetText@{tmp}\botva2.dll stdcall delayload';
function BtnGetText_(h:HWND; var Text:TTextBuf):integer; external 'BtnGetText@{tmp}\botva2.dll stdcall delayload';
procedure BtnSetTextAlignment(h :HWND; HorIndent, VertIndent :integer; Alignment :DWORD); external 'BtnSetTextAlignment@{tmp}\botva2.dll stdcall delayload';
procedure BtnSetFont(h :HWND; Font :Cardinal); external 'BtnSetFont@{tmp}\botva2.dll stdcall delayload';
procedure BtnSetFontColor(h :HWND; NormalFontColor, FocusedFontColor, PressedFontColor, DisabledFontColor :Cardinal); external 'BtnSetFontColor@{tmp}\botva2.dll stdcall delayload';
function BtnGetVisibility(h :HWND) :boolean; external 'BtnGetVisibility@{tmp}\botva2.dll stdcall delayload';
procedure BtnSetVisibility(h :HWND; Value :boolean); external 'BtnSetVisibility@{tmp}\botva2.dll stdcall delayload';
function BtnGetEnabled(h :HWND) :boolean; external 'BtnGetEnabled@{tmp}\botva2.dll stdcall delayload';
procedure BtnSetEnabled(h :HWND; Value :boolean); external 'BtnSetEnabled@{tmp}\botva2.dll stdcall delayload';
function BtnGetChecked(h :HWND) :boolean; external 'BtnGetChecked@{tmp}\botva2.dll stdcall delayload';
procedure BtnSetChecked(h :HWND; Value :boolean); external 'BtnSetChecked@{tmp}\botva2.dll stdcall delayload';
procedure BtnSetEvent(h :HWND; EventID :integer; Event :Longword); external 'BtnSetEvent@{tmp}\botva2.dll stdcall delayload';
procedure BtnGetPosition(h:HWND; var Left, Top, Width, Height: integer); external 'BtnGetPosition@{tmp}\botva2.dll stdcall delayload';
procedure BtnSetPosition(h:HWND; NewLeft, NewTop, NewWidth, NewHeight: integer); external 'BtnSetPosition@{tmp}\botva2.dll stdcall delayload';
procedure BtnRefresh(h :HWND); external 'BtnRefresh@{tmp}\botva2.dll stdcall delayload';
procedure BtnSetCursor(h:HWND; hCur:Cardinal); external 'BtnSetCursor@{tmp}\botva2.dll stdcall delayload';
function GetSysCursorHandle(id:integer):Cardinal; external 'GetSysCursorHandle@{tmp}\botva2.dll stdcall delayload';
procedure gdipShutdown; external 'gdipShutdown@{tmp}\botva2.dll stdcall delayload';
procedure CreateFormFromImage(h:HWND; FileName:PAnsiChar); external 'CreateFormFromImage@{tmp}\botva2.dll stdcall delayload';
function CreateBitmapRgn(DC: LongWord; Bitmap: HBITMAP; TransClr: DWORD; dX:integer; dY:integer): LongWord; external 'CreateBitmapRgn@{tmp}\botva2.dll stdcall delayload';
procedure SetMinimizeAnimation(Value: Boolean); external 'SetMinimizeAnimation@{tmp}\botva2.dll stdcall delayload';
function GetMinimizeAnimation: Boolean; external 'GetMinimizeAnimation@{tmp}\botva2.dll stdcall delayload';
function ArrayOfAnsiCharToAnsiString(a:TTextBuf):AnsiString;
var
i:integer;
begin
i:=0;
Result:='';
while a[i]<>#0 do begin
Result:=Result+a[i];
i:=i+1;
end;
end;
function BtnGetText(hBtn:HWND):AnsiString;
var
buf:TTextBuf;
begin
BtnGetText_(hBtn,buf);
Result:=ArrayOfAnsiCharToAnsiString(buf); //ìåäëåííî ðàáîòàåò, êàê ïî äðóãîìó ñäåëàòü õç
end;
////
function win7_init(Handle:HWND; Left, Top, Right, Bottom : Integer): Boolean;
external 'win7_init@files:ISWin7.dll stdcall';
procedure win7_free;
external 'win7_free@files:ISWin7.dll stdcall';
function ProgressCallback(Pct: integer; CurrentFile:AnsiString): longword;
var Msg: TMessage;
begin
if Pct<=ISDoneProgressBar.Max then
ISDoneProgressBar.Position := Pct;
LabelPct.Caption := IntToStr(Pct div 10)+'.'+chr(48 + Pct mod 10)+'%';
LabelCurrFileName.Caption :=ExpandConstant('{cm:ExtractedFile} ')+CurrentFile;
while PeekMessage(Msg, 0, 0, 0, 1) do begin
TranslateMessage(Msg);
DispatchMessage(Msg);
end;
Result := Cancel;
end;
procedure CancelButtonOnClick(Sender: TObject);
begin
if MsgBox(SetupMessage(msgExitSetupMessage), mbConfirmation, MB_YESNO) = IDYES then Cancel:=1;
end;
procedure InitializeWizard();
begin
// Äëÿ áîëåå êðàñèâîãî îòîáðàæåíèÿ óìåíüøàåì íèæíþþ ãðàíèöó
WizardForm.Bevel.Height := 1;
// Èíèöèàëèçèðóåì áèáëèîòåêó
if win7_init(WizardForm.Handle, 0, 0, 0, 47) then
begin
WizardForm.Caption := 'Âêëþ÷åíî';
end
else
begin
WizardForm.Caption := 'Âûêëþ÷åíî';
end;
ExtractTemporaryFile('DirBitmap.bmp');
ExtractTemporaryFile('logo2.png');
LogoImage := TBitmapImage.Create(WizardForm);
with LogoImage do
begin
SetBounds(ScaleX(10), ScaleY(320), ScaleX(175), ScaleY(35));
Bitmap.LoadFromFile(ExpandConstant('{tmp}\logo2.png'));
// Img:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\logo2.png'),ScaleX(0), ScaleY(0),ScaleX(175),ScaleY(35),True,True);
Parent := WizardForm;
end;
with WizardForm.WizardSmallBitmapImage do
begin
SetBounds(ScaleX(0), ScaleY(2), ScaleX(497), ScaleY(56));
end;
with WizardForm.SelectDirBitmapImage do
begin
SetBounds(ScaleX(0), ScaleY(0), ScaleX(42), ScaleY(42));
end;
WizardForm.SelectDirBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\DirBitmap.bmp'));
WizardForm.MainPanel.Color := clGray;
WizardForm.WizardBitmapImage.Width := 497;
WizardForm.WizardBitmapImage2.Width := 497;
WizardForm.PageNameLabel.Width:=0;
WizardForm.PageDescriptionLabel.Hide;
WizardForm.Font.Color:=clblack;
// WizardForm.Color:=clGray; // Öâåò ïàíåë³ òà øî âíèçó
WizardForm.WelcomePage.Color:=clGray;
WizardForm.InnerPage.Color:=clGray; // öâåò ïàíåëè ïîñåðåä èíñòàëà
WizardForm.SelectDirPage.Color:=clGray;
WizardForm.WelcomeLabel1.Hide;
WizardForm.WelcomeLabel2.Hide;
with TLabel.Create(WizardForm) do begin
AutoSize:=WizardForm.WelcomeLabel1.AutoSize;
Left:=WizardForm.WelcomeLabel1.Left;
Top:=WizardForm.WelcomeLabel1.Top
Width:=WizardForm.WelcomeLabel1.Width
Height:=WizardForm.WelcomeLabel1.Height
WordWrap:=WizardForm.WelcomeLabel1.WordWrap;
Font.Name:=WizardForm.WelcomeLabel1.Font.Name;
Font.Size:=WizardForm.WelcomeLabel1.Font.Size;
Font.Color:=clblack; // text colour âåðõíº
Font.Style:=WizardForm.WelcomeLabel1.Font.Style;
Caption:=WizardForm.WelcomeLabel1.Caption;
Parent:=WizardForm.WelcomeLabel1.Parent
Transparent:=True
end;
with TLabel.Create(WizardForm) do begin
AutoSize:=WizardForm.WelcomeLabel2.AutoSize;
Left:=WizardForm.WelcomeLabel2.Left;
Top:=WizardForm.WelcomeLabel2.Top
Width:=WizardForm.WelcomeLabel2.Width
Height:=WizardForm.WelcomeLabel2.Height
WordWrap:=WizardForm.WelcomeLabel2.WordWrap;
Font.Name:=WizardForm.WelcomeLabel2.Font.Name;
Font.Size:=WizardForm.WelcomeLabel2.Font.Size;
Font.Color:=clblack; // text colour íèæíº
Font.Style:=WizardForm.WelcomeLabel2.Font.Style;
Caption:=WizardForm.WelcomeLabel2.Caption;
Parent:=WizardForm.WelcomeLabel2.Parent
Transparent:=True
end;
FinishedLabel:= TLabel.Create(WizardForm);
WizardForm.FinishedLabel.Hide;
with WizardForm.RunList do
begin
Left := ScaleX(264);
// (3 - 241) + (2 - ?) + (1 - ?)-;
Top := ScaleY(241);
Width := ScaleX(237);
Height := ScaleY(91);
Color := clgray;
Font.Color := clWhite;
ParentColor := False;
end;
//
with WizardForm do
begin
// Color:=clWindow;
end;
//
//
with FinishedLabel do begin
Font.Size:=9;
Font.Color:=clSilver;
Font.Style:=[fsBold];
Parent:=WizardForm;
Transparent:=True;
end;
WizardForm.FinishedHeadingLabel.Hide;
with TLabel.Create(WizardForm) do begin
AutoSize:=WizardForm.FinishedHeadingLabel.AutoSize;
Left:=WizardForm.FinishedHeadingLabel.Left;
Top:=WizardForm.FinishedHeadingLabel.Top
Width:=WizardForm.FinishedHeadingLabel.Width
Height:=WizardForm.FinishedHeadingLabel.Height
WordWrap:=WizardForm.FinishedHeadingLabel.WordWrap;
Font.Name:=WizardForm.FinishedHeadingLabel.Font.Name;
Font.Size:=WizardForm.FinishedHeadingLabel.Font.Size;
Font.Color:=clblack; // text colour â êîíöå èíñòàëëÿòîðà
Font.Style:=WizardForm.FinishedHeadingLabel.Font.Style;
Caption:=WizardForm.FinishedHeadingLabel.Caption;
Parent:=WizardForm.FinishedHeadingLabel.Parent;
Transparent:=True;
end;
FinishedLabel:= TLabel.Create(WizardForm)
WizardForm.FinishedLabel.Hide;
with TLabel.Create(WizardForm) do begin
WordWrap:=WizardForm.FinishedLabel.WordWrap;
Font.Name:=WizardForm.FinishedLabel.Font.Name;
Font.Size:=WizardForm.FinishedLabel.Font.Size;
Font.Color:=clgreen; // text colour
Font.Style:=WizardForm.FinishedLabel.Font.Style;
Caption:=WizardForm.FinishedLabel.Caption;
Parent:=WizardForm.FinishedLabel.Parent;
Transparent:=True;
end;
ISDoneProgressBar := TNewProgressBar.Create(WizardForm);
with ISDoneProgressBar do begin
Left := ScaleX(0);
Top := ScaleY(40);
Width := ScaleX(417);
Max := 1000;
Height := WizardForm.ProgressGauge.Height;
Parent := WizardForm.InstallingPage;
end;
LabelPct := TLabel.Create(WizardForm);
with LabelPct do begin
Parent := WizardForm.InstallingPage;
AutoSize := False;
Width := WizardForm.ProgressGauge.Width;
Top := WizardForm.ProgressGauge.Top + ScaleY(50);
Font.Size := 10;
Font.Color := clSilver;
Alignment := taCenter;
Caption := '';
end;
LabelCurrFileName := TLabel.Create(WizardForm);
with LabelCurrFileName do begin
Parent := WizardForm.InstallingPage;
AutoSize := False;
Width := WizardForm.ProgressGauge.Width;
Left := ScaleX(0);
Top := WizardForm.ProgressGauge.Top + ScaleY(25);
Caption := '';
end;
end;
procedure DeinitializeSetup();
begin
// Îòêëþ÷àåì áèáëèîòåêó
win7_free;
end;
Procedure CurPageChanged(CurPageID: Integer);
Begin
if (CurPageID = wpFinished) and MyError then
begin
with TLabel.Create(WizardForm) do begin
WizardForm.FinishedLabel.Hide;
AutoSize:=WizardForm.FinishedHeadingLabel.AutoSize;
Left:=WizardForm.FinishedLabel.Left;
Top:=WizardForm.FinishedLabel.Top
Width:=WizardForm.FinishedLabel.Width
Height:=WizardForm.FinishedLabel.Height
WordWrap:=WizardForm.FinishedLabel.WordWrap;
Font.Name:=WizardForm.FinishedLabel.Font.Name;
Font.Size:=WizardForm.FinishedLabel.Font.Size;
WizardForm.Caption:= ExpandConstant('{cm:Error}');
WizardForm.FinishedLabel.Font.Color:= clyellow;
WizardForm.FinishedLabel.Caption:= SetupMessage(msgSetupAborted);
Font.Color:=clwhite;
Font.Style:=WizardForm.FinishedLabel.Font.Style;
Caption:=WizardForm.FinishedLabel.Caption;
Parent:=WizardForm.FinishedLabel.Parent
Transparent:=True
end;
end;
end;
procedure CurStepChanged(CurStep: TSetupStep);
var ChComp, TmpValue:longword;
n:integer;
begin
if CurStep = ssPostInstall then begin
WizardForm.ProgressGauge.Hide;
WizardForm.CancelButton.Visible:=false;
MyCancelButton:=TButton.Create(WizardForm);
with MyCancelButton do begin
Parent:=WizardForm;
Width:=ScaleX(135);
Caption:=ExpandConstant('{cm:CancelButton}');
Left:=ScaleX(360);
Top:=WizardForm.cancelbutton.top;
OnClick:=@CancelButtonOnClick;
end;
CallBack:=WrapMyCallback(@ProgressCallback,2);
Cancel:=0;
OveralPct:=0;
#ifdef records
ExtractTemporaryFile('records.inf');
#endif
#ifdef precomp038
ExtractTemporaryFile('packjpg_dll.dll');
ExtractTemporaryFile('RTconsole.exe');
ExtractTemporaryFile('precomp038.exe');
ExtractTemporaryFile('zlib1.dll');
#endif
ChComp:=0;
StartRecord(ExpandConstant('{src}\records.inf'),ChComp);
repeat
MyError:=true;
CallBack:=WrapMyCallback(@ProgressCallback,2);
OveralPct:=0;
ISArcExtract ( 0, OveralPct, 25, ExpandConstant('{src}\muzk.arc'), ExpandConstant('{app}'),false,CallBack, '', '', '')
ISSRepExtract ( 0, OveralPct, 25, ExpandConstant('{app}\muzk.srep'), ExpandConstant('{app}\muzk.pcf'), '', true, CallBack)
ISPrecompExtract( 0, OveralPct, 25, ExpandConstant('{app}\muzk.pcf'), ExpandConstant('{app}\muzk.7z'),true, CallBack)
IS7ZipExtract ( 0, OveralPct, 25, ExpandConstant('{app}\muzk.7z'), ExpandConstant('{app}'),true, CallBack, '')
MyError:=false;
until true;
StopRecord;
MyCancelButton.Visible:=false;
WizardForm.CancelButton.Visible:=true;
end;
if (CurStep=ssPostInstall) and MyError then
Exec(ExpandConstant('{uninstallexe}'), '/SILENT','', sw_Hide, ewWaitUntilTerminated, n);
end;
R.i.m.s.k.y.
13-06-2011, 10:10
Кстати рядом с инсталлятором лежит файл Notes.ini, »
лотус нотус чтоли переделываешь?
insombia
13-06-2011, 12:54
Как вместо слова выбор компонентов сделать выбор приоритета?
Всем привет! Подскажите пожалуйсто как исправить расширение архива на bin?
Neutron,Разобрался. В самой винде расширение папок снял, и просто переименовал. :)
как добавить свой прогресс-бар?
murlakatamenka
13-06-2011, 17:10
расширение папок »
у папок нету расширений, есть у файлов
LinkOFF, у ISDone есть свой второй прогрессбар, если что:
#define SecondProgressBar
добавить на InstallingPage можно так например
[Коде]
var
NewProgressBar1: TNewProgressBar;
procedure InitializeWizard();
begin
{ NewProgressBar1 }
NewProgressBar1 := TNewProgressBar.Create(WizardForm);
with NewProgressBar1 do
begin
Parent := WizardForm.InstallingPage;
Left := ScaleX(0);
Top := ScaleY(88);
Width := ScaleX(417);
Height := ScaleY(25);
end;
end;
ну и надо привязать изменение NewProgressBar1.Position к чему-нибудь, чтобы прогрессбар работал :)
No4noylis
13-06-2011, 18:17
на мой вопрос никто не ответит????????? :cry:
© OSzone.net 2001-2012
vBulletin v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.