Inno Setup (создание инсталяционных пакетов). Часть 3

Статус
В этой теме нельзя размещать новые ответы.

Adil

Старожил
GolD20
Пример №1, только для юникода, и только если цвет текста черный
[SOURCE="inno"]
Код:
 //===== [Начало-Подключение модулей] =====\\
 #include "Modules\Messages.iss"
 #include "Modules\Botva2.iss"
 #include "Modules\PB.iss"
 #include "Modules\Head.iss"
 #include "Modules\IsDone.iss"
 //===== [Конец-Подключение модулей] =====\\


 function CheckError: Boolean;
 begin
 Result:= not ISDoneError;
 end;
 //=================================== [Начало-Создание Формы] ===================================\\
 procedure CreateWizardForm;
 var
 n: Integer;
 begin
 with WizardForm do begin
 InnerNotebook.Hide;
 OuterNotebook.Hide;
 Bevel.Hide;
 ClientWidth:=ScaleX(700);
 ClientHeight:=ScaleY(400);
 DirEdit.OnChange:=@ObjectFunc;
 GroupEdit.OnChange:= @ObjectFunc
 OnMouseDown:=@LabelOnMouseDown;
 Center;
 end;

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

 BGImageStream := TMemoryStream.Create;
 ExtractTemporaryFileToStream('BGImage.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('Image.pn g'),0,0,0,0,False,True);

 DirFolder:=ImgLoad(WizardForm.Handle,ExpandConstan t('DirFolder.png'),ScaleX(15),ScaleY(220),ScaleX(5 5),ScaleY(50),True,True);
 DirEditImg:=ImgLoad(WizardForm.Handle,ExpandConsta nt('DirEditImg.png'),ScaleX(15),ScaleY(270),ScaleX (0),ScaleY(0),False,True);
 HDD:=ImgLoad(WizardForm.Handle,ExpandConstant('HDD .png'),ScaleX(15),ScaleY(310),ScaleX(65),ScaleY(65 ),True,True);
 GroupFolder:=ImgLoad(WizardForm.Handle,ExpandConst ant('GroupFolder.png'),ScaleX(15),ScaleY(225),Scal eX(55),ScaleY(40),True,True);

 //=============================== [Начало-Лейблы] ===============================\\
 //===== [Начало - WelcomePage] =====\\
 WelcomeLabel1:= TLabel.Create(WizardForm);
 with WelcomeLabel1 do begin
 Parent:=WizardForm;
 AutoSize:=False;
 Transparent:=True;
 SetBounds(ScaleX(10), ScaleY(125), ScaleX(360), ScaleY(150));
 Font.Name:='Tahoma';
 Font.Size:=16;
 Font.Color:={#ColorGameName};
 Font.Style:=[fsBold];
 Alignment :=taCenter;
 WordWrap:=True;
 OnMouseDown:=@LabelOnMouseDown;
 Caption:=ExpandConstant('{cm:WelcomeLabel1}');
 end;

 WelcomeLabel2:= TLabel.Create(WizardForm);
 with WelcomeLabel2 do begin
 Parent:=WizardForm;
 AutoSize:=False;
 Transparent:=True;
 SetBounds(ScaleX(10), ScaleY(260), ScaleX(360), ScaleY(150));
 Font.Name:= 'Tahoma';
 Font.Size:= 10;
 Font.Color:={#ColorText};
 Font.Style:=[fsBold];
 Alignment := taCenter;
 WordWrap:=True;
 OnMouseDown:=@LabelOnMouseDown;
 Caption:=ExpandConstant('{cm:WelcomeLabel2}');
 end;
 //===== [Конец - WelcomePage] =====\\

 //===== [Начало - SelectDirPage] =====\\
 SelectDirBrowseLabel:= TLabel.Create(WizardForm);
 with SelectDirBrowseLabel do begin
 Parent:=WizardForm;
 AutoSize:=true;
 Transparent:=True;
 SetBounds(ScaleX(72), ScaleY(220), ScaleX(0), ScaleY(0));
 Font.Name:= 'Tahoma';
 Font.Size:= 10;
 Font.Color:={#ColorText};
 Font.Style:=[fsBold];
 OnMouseDown:=@LabelOnMouseDown;
 Caption:=ExpandConstant('{cm:SelectDirBrowseLabel} ');
 end;

 DirEditLabel:=Tlabel.Create(wizardform);
 with DirEditLabel do begin
 Parent := WizardForm;
 AutoSize:=False;
 Transparent := True;
 SetBounds(ScaleX(20), ScaleY(272), ScaleX(305), ScaleY(20));
 Font.Name:= 'Tahoma';
 Font.Size:= 10;
 Font.Color:={#ColorText};
 Font.Style:=[fsBold];
 OnMouseDown:=@LabelOnMouseDown;
 Caption := MinimizePathName(WizardForm.DirEdit.Text, DirEditLabel.Font, DirEditLabel.Width);
 end;

 TotalSpaceLabel:= TLabel.Create(WizardForm);
 with TotalSpaceLabel do begin
 Parent := WizardForm;
 AutoSize:=True;
 Transparent := True;
 SetBounds(ScaleX(100), ScaleY(299), ScaleX(0), ScaleY(0));
 Font.Name:='Tahoma';
 Font.Size:= 8;
 Font.Color:={#ColorText};
 Font.Style:=[fsBold];
 OnMouseDown:=@LabelOnMouseDown;
 Caption:=ExpandConstant('{cm:TotalSpaceLabel}');
 end;

 FreeSpaceLabel:= TLabel.Create(WizardForm);
 with FreeSpaceLabel do begin
 Parent := WizardForm;
 AutoSize:=True;
 Transparent := True;
 SetBounds(ScaleX(100), ScaleY(315), ScaleX(0), ScaleY(0));
 Font.Name:='Tahoma';
 Font.Size:= 8;
 Font.Color:={#ColorText};
 Font.Style:=[fsBold];
 OnMouseDown:=@LabelOnMouseDown;
 Caption:=ExpandConstant('{cm:FreeSpaceLabel}');
 end;

 InstallSpacelabel:= TLabel.Create(WizardForm);
 with InstallSpacelabel do begin
 Parent := WizardForm;
 AutoSize:=True;
 Transparent := True;
 SetBounds(ScaleX(100), ScaleY(330), ScaleX(0), ScaleY(0));
 Font.Name:='Tahoma';
 Font.Size:= 8;
 Font.Color:={#ColorText};
 Font.Style:=[fsBold];
 OnMouseDown:=@LabelOnMouseDown;
 Caption:=ExpandConstant('{cm:InstallSpacelabel}');
 end;

 NeedSpaceLabel:= TLabel.Create(WizardForm);
 with NeedSpaceLabel do begin
 Parent := WizardForm;
 AutoSize:=True;
 Transparent := True;
 SetBounds(ScaleX(100), ScaleY(345), ScaleX(0), ScaleY(0));
 Font.Name:='Tahoma';
 Font.Size:= 8;
 Font.Color:={#ColorText};
 Font.Style:=[fsBold];
 OnMouseDown:=@LabelOnMouseDown;
 Caption:=ExpandConstant('{cm:NeedSpaceLabel}');
 end;

 TotalSpaceLabel2:= TLabel.Create(WizardForm);
 with TotalSpaceLabel2 do begin
 Parent := WizardForm;
 AutoSize:=True;
 Transparent := True;
 SetBounds(ScaleX(370), ScaleY(299), ScaleX(0), ScaleY(0));
 Font.Name:='Tahoma';
 Font.Size:= 8;
 Font.Color:={#ColorText};
 Font.Style:=[fsBold];
 OnMouseDown:=@LabelOnMouseDown;
 Alignment := taRightJustify;
 end;

 FreeSpaceLabel2:= TLabel.Create(WizardForm);
 with FreeSpaceLabel2 do begin
 Parent := WizardForm;
 AutoSize:=True;
 Transparent := True;
 SetBounds(ScaleX(370), ScaleY(315), ScaleX(0), ScaleY(0));
 Font.Name:='Tahoma';
 Font.Size:= 8;
 Font.Color:={#ColorText};
 Font.Style:=[fsBold];
 OnMouseDown:=@LabelOnMouseDown;
 Alignment := taRightJustify;
 end;

 InstallSpacelabel2:= TLabel.Create(WizardForm);
 with InstallSpacelabel2 do begin
 Parent := WizardForm;
 AutoSize:=True;
 Transparent := True;
 SetBounds(ScaleX(370), ScaleY(330), ScaleX(0), ScaleY(0));
 Font.Name:='Tahoma';
 Font.Size:= 8;
 Font.Color:={#ColorText};
 Font.Style:=[fsBold];
 OnMouseDown:=@LabelOnMouseDown;
 Alignment := taRightJustify;
 end;

 NeedSpaceLabel2:= TLabel.Create(WizardForm);
 with NeedSpaceLabel2 do begin
 Parent := WizardForm;
 AutoSize:=True;
 Transparent := True;
 SetBounds(ScaleX(370), ScaleY(345), ScaleX(0), ScaleY(0));
 Font.Name:='Tahoma';
 Font.Size:= 8;
 Font.Color:={#ColorText};
 Font.Style:=[fsBold];
 OnMouseDown:=@LabelOnMouseDown;
 Alignment := taRightJustify;
 end;
 //===== [Конец - SelectDirPage] =====\\

 #ifdef Components
 //===== [Начало - SelectComponentsPage] =====\\
 SelectComponentsLabel:= TLabel.Create(WizardForm);
 with SelectComponentsLabel do begin
 Parent := WizardForm;
 AutoSize:=True;
 Transparent := True;
 SetBounds(ScaleX(15), ScaleY(225), ScaleX(0), ScaleY(0));
 Font.Name:='Tahoma';
 Font.Size:= 9;
 Font.Color:={#ColorText};
 Font.Style:=[fsBold];
 OnMouseDown:=@LabelOnMouseDown;
 Caption:=ExpandConstant('{cm:SelectComponentsLabel }');
 end;

 with WizardForm.ComponentsList do begin
 Parent:= WizardForm;
 SetBounds(ScaleX(15), ScaleY(270), ScaleX(325), ScaleY(95));
 Color:=$000000;
 Font.Name:='Tahoma';
 Font.Size:= 8;
 Font.Color:={#ColorText};
 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;
 //===== [Конец - SelectComponentsPage] =====\\
 #endif

 //===== [Начало - SelectProgramGroupPage] =====\\
 SelectStartMenuFolderLabel:= TLabel.Create(WizardForm);
 with SelectStartMenuFolderLabel do begin
 Parent:=WizardForm;
 AutoSize:=true;
 Transparent:=True;
 SetBounds(ScaleX(75), ScaleY(225), ScaleX(0), ScaleY(0));
 Font.Name:= 'Tahoma';
 Font.Size:= 10;
 Font.Color:={#ColorText};
 Font.Style:=[fsBold];
 OnMouseDown:=@LabelOnMouseDown;
 Caption:=ExpandConstant('{cm:SelectStartMenuFolder Label}');
 end;

 SelectStartMenuFolderBrowseLabel:= TLabel.Create(WizardForm);
 with SelectStartMenuFolderBrowseLabel do begin
 Parent:=WizardForm;
 AutoSize:=true;
 Transparent:=True;
 SetBounds(ScaleX(15), ScaleY(295), ScaleX(0), ScaleY(0));
 Font.Name:= 'Tahoma';
 Font.Size:= 10;
 Font.Color:={#ColorText};
 Font.Style:=[fsBold];
 OnMouseDown:=@LabelOnMouseDown;
 Caption:=ExpandConstant('{cm:SelectDirBrowseLabel} ');
 end;

 GroupEditLabel:=Tlabel.Create(WizardForm);
 with GroupEditLabel do begin
 Parent := WizardForm;
 AutoSize:=False;
 Transparent := True;
 SetBounds(ScaleX(20), ScaleY(272), ScaleX(305), ScaleY(20));
 Font.Name:= 'Tahoma';
 Font.Size:= 10;
 Font.Color:={#ColorText};
 Font.Style:=[fsBold];
 OnMouseDown:=@LabelOnMouseDown;
 Caption := WizardForm.GroupEdit.Text;
 end;

 NoIconsCheck:=BtnCreate(WizardForm.Handle,ScaleX(1 5),ScaleY(350),ScaleX(13),ScaleY(13),ExpandConstan t('CheckBox.png'),1,True);
 BtnSetEvent(NoIconsCheck,BtnClickEventID,WrapBtnCa llback(@NoIconsClick,1));
 BtnSetCursor(NoIconsCheck,GetSysCursorHandle(32649 ));

 NoIconsLabel := TLabel.Create(WizardForm);
 with NoIconsLabel do begin
 Parent:=WizardForm;
 AutoSize:=true;
 Transparent:=True;
 SetBounds(ScaleX(35), ScaleY(350), ScaleX(0), ScaleY(0));
 Font.Name:= 'Tahoma'
 Font.Size:= 8;
 Font.Color:={#ColorText};
 Font.Style:=[fsBold];
 Caption := ExpandConstant('{cm:NoIconsCheck}');
 Cursor := crHand;
 OnClick:= @ObjectFunc;
 end;
 //===== [Конец - SelectProgramGroupPage] =====\\

 #ifdef Tasks
 //===== [Начало - SelectTasksPage] =====\\
 SelectTasksLabel:= TLabel.Create(WizardForm);
 with SelectTasksLabel do begin
 Parent := WizardForm;
 AutoSize:=True;
 Transparent := True;
 SetBounds(ScaleX(15), ScaleY(225), ScaleX(0), ScaleY(0));
 Font.Name:='Tahoma';
 Font.Size:= 9;
 Font.Color:={#ColorText};
 Font.Style:=[fsBold];
 OnMouseDown:=@LabelOnMouseDown;
 Caption:=ExpandConstant('{cm:SelectTasksLabel}');
 end;

 with WizardForm.TasksList do begin
 Parent:= WizardForm;
 SetBounds(ScaleX(15), ScaleY(259), ScaleX(350), ScaleY(140));
 Color:=$000000;
 Font.Name:='Tahoma';
 Font.Size:= 8;
 Font.Color:={#ColorText};
 BorderStyle := bsNone;
 Font.Style:=[fsBold];
 BorderWidth := (WizardForm.TasksList.Width-WizardForm.TasksList.ClientWidth) div 2;
 LoadBGBmpFromBitmap(BGImage.Bitmap, WizardForm.TasksList.Left+BorderWidth, WizardForm.TasksList.Top+BorderWidth);
 LoadBtnBmpFromBitmap(btnimage.Bitmap);
 end;
 //===== [Конец - SelectTasksPage] =====\\
 #endif

 //===== [Начало - ReadyPage] =====\\
 BGImageStream.position:=0;

 ReadyLabel:= TLabel.Create(WizardForm);
 with ReadyLabel do begin
 Parent := WizardForm;
 AutoSize:=True;
 Transparent := True;
 SetBounds(ScaleX(15), ScaleY(225), ScaleX(0), ScaleY(0));
 Font.Name:='Tahoma';
 Font.Size:= 9;
 Font.Color:={#ColorText};
 Font.Style:=[fsBold];
 OnMouseDown:=@LabelOnMouseDown;
 Caption:=ExpandConstant('{cm:ReadyLabel}');
 end;

 ReadyPanel := TPanel.Create(WizardForm);
 with ReadyPanel do begin
 Parent := WizardForm;
 SetBounds(ScaleX(15), ScaleY(259), ScaleX(350), ScaleY(100));
 BorderStyle := bsSingle;
 end;

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

 ReadyScrollBar := TScrollBar.Create(WizardForm);
 with ReadyScrollBar do begin
 Parent := ReadyPanel;
 SetBounds(ScaleX(330), ScaleY(0), ScaleX(98), ScaleY(15));
 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:={#ColorText};
 Font.Style:=[fsBold];
 OnMouseDown:=@LabelOnMouseDown;
 SetBounds(ScaleX(5), ScaleY(5), ScaleX(325), ScaleY(95));
 Caption := WizardForm.ReadyMemo.Lines.Text;
 end;
 //===== [Конец - ReadyPage] =====\\

 //===== [Начало - InstallingPage] =====\\
 IsDoneAddComponents

 InstallingLabel:= TLabel.Create(WizardForm);
 with InstallingLabel do begin
 Parent := WizardForm;
 AutoSize:=True;
 Transparent := True;
 SetBounds(ScaleX(15), ScaleY(225), ScaleX(0), ScaleY(0));
 Font.Name:='Tahoma';
 Font.Size:= 10;
 Font.Color:={#ColorText};
 Font.Style:=[fsBold];
 OnMouseDown:=@LabelOnMouseDown;
 Caption:=ExpandConstant('{cm:InstallingLabel}');
 end;

 with WizardForm.StatusLabel do
 begin
    Parent := WizardForm;
    AutoSize:=True;
    Transparent := True;
    SetBounds(ScaleX(15), ScaleY(250), ScaleX(0), ScaleY(0));
    Font.Name:='Tahoma';
    Font.Style:=[fsBold];
    OnMouseDown:=@LabelOnMouseDown;
    Caption:=ExpandConstant('{cm:Extracted}');
    Font.Size:= 10;
 end;
 //===== [Конец - InstallingPage] =====\\

 //===== [Начало - FinishedPage] =====\\
 FinishedHeadingLabel:= TLabel.Create(WizardForm);
 with FinishedHeadingLabel do begin
 Parent:=WizardForm;
 AutoSize:=False;
 Transparent:=True;
 SetBounds(ScaleX(15), ScaleY(225), ScaleX(670), ScaleY(80));
 Font.Name:= 'Tahoma';
 Font.Size:= 12;
 Font.Color:={#ColorText};
 Font.Style:=[fsBold];
 Alignment := taCenter;
 WordWrap:=True;
 OnMouseDown:=@LabelOnMouseDown;
 Caption:=ExpandConstant('{cm:FinishedHeadingLabel} ');
 end;

 FinishedLabel:= TLabel.Create(WizardForm);
 with FinishedLabel do begin
 Parent:=WizardForm;
 AutoSize:=False;
 Transparent:=True;
 SetBounds(ScaleX(15), ScaleY(270), ScaleX(670), ScaleY(150));
 Font.Name:= 'Tahoma';
 Font.Size:= 10;
 Font.Color:={#ColorText};
 Font.Style:=[fsBold];
 Alignment := taCenter;
 WordWrap:=True;
 OnMouseDown:=@LabelOnMouseDown;
 Caption:=ExpandConstant('{cm:FinishedLabel}');
 end;
 //===== [Конец - FinishedPage] =====\\

 //=============================== [Конец-Лейблы] ===============================\\
 end;
 //=================================== [Конец-Создание Формы] ===================================\\

 //===== [Начало-Текстуры Кнопок] =====\\
 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.DirB rowseButton.Caption));
 BtnSetText(hGroupBrowseBtn,PAnsiChar(WizardForm.Gr oupBrowseButton.Caption));
 end;

 procedure WizardFormBtnClick(hBtn:HWND);
 var
 Btn:TButton;
 begin
 sndPlaySound(ExpandConstant('{tmp}\Click.wav'),$00 01);
 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;

 #ifdef BASS
 procedure BtnClick(hBtn:HWND);
 begin
 sndPlaySound(ExpandConstant('{tmp}\Click.wav'),$00 01);
 case hBtn of
 MusBtn: if not BtnGetChecked(MusBtn) then BASS_Stop
 else if BASS_Start then BASS_ChannelPlay(mp3Handle, False);
 end;
 end;
 #endif

 procedure WFBtnEnter(hBtn:HWND);
 begin
 sndPlaySound(ExpandConstant('{tmp}\WFEnter.wav'),$ 0001);
 end;

 procedure ButtonsTextures;
 begin
 with WizardForm.BackButton do begin
 hBackBtn:=BtnCreate(WizardForm.Handle,382,362,88,3 4,ExpandConstant('Btn.png'),0,False);
 BtnSetEvent(hBackBtn,BtnMouseEnterEventID,WrapBtnC allback(@WFBtnEnter,1));
 BtnSetEvent(hBackBtn,BtnClickEventID,WrapBtnCallba ck(@WizardFormBtnClick,1));
 BtnSetFont(hBackBtn,WFButtonFont.Handle);
 BtnSetFontColor(hBackBtn,{#ColorButonOn},{#ColorBu tonOff},$000000,$B6B6B6);
 BtnSetCursor(hBackBtn,GetSysCursorHandle(32649));
 Width:=0;
 Height:=0;
 end;

 with WizardForm.NextButton do begin
 hNextBtn:=BtnCreate(WizardForm.Handle,575,362,88,3 4,ExpandConstant('Btn.png'),1,False);
 BtnSetEvent(hNextBtn,BtnMouseEnterEventID,WrapBtnC allback(@WFBtnEnter,1));
 BtnSetEvent(hNextBtn,BtnClickEventID,WrapBtnCallba ck(@WizardFormBtnClick,1));
 BtnSetFont(hNextBtn,WFButtonFont.Handle);
 BtnSetFontColor(hNextBtn,{#ColorButonOn},{#ColorBu tonOff},$000000,$B6B6B6);
 BtnSetCursor(hNextBtn,GetSysCursorHandle(32649));
 Width:=0;
 Height:=0;
 end;

 with WizardForm.CancelButton do begin
 hCancelBtn:=BtnCreate(WizardForm.Handle,478,362,88 ,34,ExpandConstant('Btn.png'),1,False);
 BtnSetEvent(hCancelBtn,BtnMouseEnterEventID,WrapBt nCallback(@WFBtnEnter,1));
 BtnSetEvent(hCancelBtn,BtnClickEventID,WrapBtnCall back(@WizardFormBtnClick,1));
 BtnSetFont(hCancelBtn,WFButtonFont.Handle);
 BtnSetFontColor(hCancelBtn,{#ColorButonOn},{#Color ButonOff},$000000,$B6B6B6);
 BtnSetCursor(hCancelBtn,GetSysCursorHandle(32649)) ;
 Width:=0;
 Height:=0;
 end;

 with WizardForm.DirBrowseButton do begin
 hDirBrowseBtn:=BtnCreate(WizardForm.Handle,340,253 ,45,45,ExpandConstant('browse.png'),1,False);
 BtnSetEvent(hDirBrowseBtn,BtnMouseEnterEventID,Wra pBtnCallback(@WFBtnEnter,1));
 BtnSetEvent(hDirBrowseBtn,BtnClickEventID,WrapBtnC allback(@WizardFormBtnClick,1));
 BtnSetFont(hDirBrowseBtn,WFButtonFont.Handle);
 BtnSetFontColor(hDirBrowseBtn,{#ColorButonOn},{#Co lorButonOff},$000000,$B6B6B6);
 BtnSetCursor(hDirBrowseBtn,GetSysCursorHandle(3264 9));
 Width:=0;
 Height:=0;
 end;

 with WizardForm.GroupBrowseButton do begin
 hGroupBrowseBtn:=BtnCreate(WizardForm.Handle,340,2 53,45,45,ExpandConstant('browse.png'),1,False);
 BtnSetEvent(hGroupBrowseBtn,BtnMouseEnterEventID,W rapBtnCallback(@WFBtnEnter,1));
 BtnSetEvent(hGroupBrowseBtn,BtnClickEventID,WrapBt nCallback(@WizardFormBtnClick,1));
 BtnSetFont(hGroupBrowseBtn,WFButtonFont.Handle);
 BtnSetFontColor(hGroupBrowseBtn,{#ColorButonOn},{# ColorButonOff},$000000,$B6B6B6);
 BtnSetCursor(hGroupBrowseBtn,GetSysCursorHandle(32 649));
 Width:=0;
 Height:=0;
 end;
 #ifdef BASS
 MusBtn:=BtnCreate(WizardForm.Handle,ScaleX(50),Sca leY(30),ScaleX(80),ScaleY(80),ExpandConstant('Musi cButton.png'),1,True);
 BtnSetCursor(MusBtn,GetSysCursorHandle(32649));
 BtnSetChecked(MusBtn, True);
 BtnSetEvent(MusBtn,BtnMouseEnterEventID,WrapBtnCal lback(@WFBtnEnter,1));
 BtnSetEvent(MusBtn,BtnClickEventID,WrapBtnCallback (@BtnClick,1));
 #endif
 (*
 hLogoBtn:=BtnCreate(WizardForm.Handle,35,10,245,81 ,ExpandConstant('logo.png'),15,False);
 BtnSetEvent(hLogoBtn,BtnClickEventID,WrapBtnCallba ck(@LogoBtnClick,1));
 BtnSetCursor(hLogoBtn,GetSysCursorHandle(32649));
 *)
 #ifdef InfBtn
 InfBtn:=BtnCreate(WizardForm.Handle,15,362,88,34,E xpandConstant('Btn.png'),1,False);
 BtnSetEvent(InfBtn,BtnClickEventID,WrapBtnCallback (@InfBtnClick,1));
 BtnSetEvent(InfBtn,BtnMouseEnterEventID,WrapBtnCal lback(@WFBtnEnter,1));
 BtnSetText(InfBtn, '{#InfoText}');
 BtnSetFont(InfBtn,WFButtonFont.Handle);
 BtnSetFontColor(InfBtn,{#ColorText},{#ColorButonOf f},$000000,$B6B6B6);
 BtnSetCursor(InfBtn,GetSysCursorHandle(32649));
 #endif
 end;
 //===== [Конец-Текстуры Кнопок] =====\\

 //===== [Начало-Прячем Компоненты] =====\\
 procedure HideComponents;
 begin;
 WelcomeLabel1.Hide;
 WelcomeLabel2.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;
 WizardForm.StatusLabel.Hide;
 FinishedHeadingLabel.Hide;
 FinishedLabel.Hide;
 IMGSetVisibility(DirEditImg,False);
 IMGSetVisibility(DirFolder,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
 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;
 WizardForm.StatusLabel.Show;
 IsDoneShow();
 end;

 wpFinished: begin
 FinishedHeadingLabel.Show;
 FinishedLabel.Show;
 LabelTime3.Show;
 end;
 end;
 end;
 //===== [Конец-Показываем Компоненты] =====\\

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

 procedure InitializeWizard;
 begin
 ExtractTemporaryFile('Splash.png');
 ShowSplashScreen(WizardForm.Handle,ExpandConstant( '{tmp}\Splash.png'),1000,3000,1000,0,255,True,$FFF FFF,10);
 begin
 CreateWizardForm;
 OldProc:=SetWindowLong(WizardForm.Handle,-4,WrapWFProc(@WFWndProc,4));
 ButtonsTextures;
 #ifdef BASS
 ExtractTemporaryFile('cash.dll');
 ExtractTemporaryFile('BASS.dll');
 BASS_Init(-1, 44100, 0, 0, 0);
 mp3Handle := BASS_StreamCreateFile(FALSE, PAnsiChar(ExpandConstant('{tmp}\cash.dll')), 0, 0, 0, 0, BASS_SAMPLE_LOOP);
 BASS_Start;
 BASS_ChannelPlay(mp3Handle,False);
 #endif
 end;
 end;

 procedure CurPageChanged(CurPageID: Integer);
 begin
 SetStateNewButtons;
 HideComponents;
 ShowComponents(CurPageID);
 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;
 ImgApplyChanges(WizardForm.Handle);
 end;

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

 procedure DeinitializeSetup;
 begin
 BGImageStream.Free;
 BTNImageStream.Free;
 WFButtonFont.Free;
 gdipShutdown;
 UnloadSkin();
 #ifdef BASS
 BASS_Stop();
 BASS_Free();
 #endif
 end;[/SOURCE][/SPOILER]
Пример №2, 
[SPOILER="Code"][SOURCE="inno"][Run]
Filename: {src}\Redist\DirectX\dxwebsetup.exe; WorkingDir: {src}\Redist\; Tasks: Soft\DirectX; BeforeInstall: SoftProgress; Check: CheckError
Filename: {src}\Redist\VCRedist\vcredist_x86.exe; WorkingDir: {src}\Redist\; Tasks: Soft\VCRedist; BeforeInstall: SoftProgress; Check: not IsWin64 and CheckError
Filename: {src}\Redist\VCRedist\vcredist_x64.exe; WorkingDir: {src}\Redist\; Tasks: Soft\VCRedist64; BeforeInstall: SoftProgress; Check: IsWin64 and CheckError

[CustomMessages]
SoftProgress=Установка Дополнительного ПО...

[Code]
procedure SoftProgress;
begin
  StatusLabel.Caption:= ExpandConstant('{cm:SoftProgress}');
end;[/SOURCE][/SPOILER]
 

GolD20

Новичок
Adil, Спасибо. Возможно ли через пример №2 сделать для каждой программы? Чтобы писалось, например, "Обновление DirectX...", затем "Обновление Visual Studio 2010...

В моем старом скрипте было попроще через StatusMsg:

[Run]
Filename: {src}\Redist\VCRedist\vcredist_x86.exe; Parameters: /q ; Tasks: Soft\VCCheck1; StatusMsg: Устанавливаем Microsoft Visual C++ 2010 х86 Redist...; Flags: skipifdoesntexist; Check: not IsWin64 and CheckError
Filename: {src}\Redist\VCRedist\vcredist_x64.exe; Parameters: /q ; Tasks: Soft\VCCheck; StatusMsg: Устанавливаем Microsoft Visual C++ 2010 х64 Redist...; Flags: skipifdoesntexist; Check: IsWin64 and CheckError
Filename: {src}\Redist\DirectX\dxwebsetup.exe; Parameters: /q ; Tasks: Soft\DirectX; StatusMsg: Обновление DirectX...; Flags: skipifdoesntexist; Check: CheckError
 
  • Like
Реакции: Adil

Adil

Старожил
GolD20, я знаю только такую реализацию
[SOURCE="inno"][Run]
Filename: {src}\Redist\DirectX\dxwebsetup.exe; WorkingDir: {src}\Redist\; Tasks: Soft\DirectX; BeforeInstall: DirectX; Check: CheckError
Filename: {src}\Redist\VCRedist\vcredist_x86.exe; WorkingDir: {src}\Redist\; Tasks: Soft\VCRedist; BeforeInstall: VCRedist; Check: not IsWin64 and CheckError
Filename: {src}\Redist\VCRedist\vcredist_x64.exe; WorkingDir: {src}\Redist\; Tasks: Soft\VCRedist64; BeforeInstall: VCRedist; Check: IsWin64 and CheckError

[CustomMessages]
DirectX=Установка DirectX...
VCRedist=Установка VCRedist...

Код:
procedure DirectX;
begin
  StatusLabel.Caption:= ExpandConstant('{cm:DirectX}');
end;

procedure VCRedist;
begin
  StatusLabel.Caption:= ExpandConstant('{cm:VCRedist}');
end;[/SOURCE][/SPOILER]
 

GolD20

Новичок
Adil, Вроде получилось. Спасибо. Теперь синий фон вылезать стал. Не знаете как исправить?

*********
Решено.
 

Вложения

Последнее редактирование:

urban

Старожил
GolD20 какая версия инно?анси или юникод?
зы: как-то не правильно идет последовательность назад-выход-далее должно быть наоборот
 

GolD20

Новичок
urban, Анси 5.5.1 Ultra.

Возник еще вопрос. Где надо менять,чтобы все надписи об дополнительном ПО поднять повыше?(Скриншот).
И как сделать,чтобы надпись на кнопке была всегда видна? А то она появляется только при наведении курсора(Скриншот).

*************
Решено.
 

Вложения

Последнее редактирование:

urban

Старожил
GolD20 поставь юникод
скрипт нужно смотреть
 
Последнее редактирование:

LexBell

Борода
Супер модератор
andrey_167,
[SOURCE="iss"][Files]
Source: "compiler:Examples\logo.bmp"; Flags: dontcopy solidbreak

Код:
procedure logo;
begin
  with TBitmapImage.Create(WizardForm) do
  begin
    Parent := WizardForm;
    SetBounds(ScaleX ( 8), ScaleY(320), ScaleX(88), ScaleY(31));
    ExtractTemporaryFile('logo.bmp');
    Bitmap.LoadFromFile(ExpandConstant('{tmp}\logo.bmp'));
  end;
end;

procedure InitializeWizard();
begin
  logo;
end;[/SOURCE]логично-же вроде?

[b]urban[/b], длл-ку в метр размером изза килобайтового лого? Тебе это не кажется несколько... э.. странным?
 

RameR

Новичок
Всем, Привет!
Как осуществляется "Tap Item Top", то есть закладки на каждую страницу, которые переключались взависмости от страницы соответсвенно?!
 

Mailchik

Старожил
Проверенный
RameR, пример...
 

HoLmEs

Новичок
как на языке inno красный? вот мне здесь надо прописать(#define FontColor "$ffffff")
 
Статус
В этой теме нельзя размещать новые ответы.
Сверху