Ветеран
Сообщения: 517
Благодарности: 314
|
Профиль
|
Отправить PM
| Цитировать
audiofeel, не получалось у вас с этим примером потому, что у вас все элементы находятся на WizardForm, просто надо было указать, где показать лейбл, а где спрятать. И DirEdit спрятать совсем. Вообщем скрипты я объединил, там пометил, где что вставил и изменил. По этому же самому принципу можете сделать и для GroupEdit.
читать дальше »
Код:
#define AppName "BioShock Infinite"
#include "ISDone\ISDone.iss"
[Setup]
AppName={#AppName}
AppVerName={#AppName}
DefaultDirName={pf}\{#AppName}
DefaultGroupName={#AppName}
WizardImageFile=style\big.bmp
AppID={{461C5FA1-3CDE-45CA-9255-158B25DBF171}
SetupIconFile=style\app.ico
VersionInfoCompany=Irrational Games
VersionInfoVersion=1.1.21.7860
VersionInfoDescription={#AppName}
VersionInfoCopyright=Copyright 2002-2013 Irrational Games and Take-Two Interactive Software, Inc.
UninstallDisplayName={#AppName}
AppVersion=1.0.1384116
UninstallDisplayIcon={app}\Binaries\Win32\BioShockInfinite.exe
AppSupportURL=http://www.bioshockinfinite.com/ru
AppPublisher=2K Games
AppPublisherURL=http://www.2kgames.com/
AppUpdatesURL=http://www.1csc.ru/games/pc/21611-bioshock-infinite
MinVersion=,6.1.7600
ExtraDiskSpaceRequired=11046539264
[Run]
Filename: {src}\redist\DXSETUP.exe; Tasks: directx; Parameters: /silent; WorkingDir: {src}\redist; StatusMsg: Обновление компонентов библиотеки DirectX
[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}
Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
Name: directx; Description: Обновление компонентов библиотеки DirectX; GroupDescription: Установка дополнительного програмного обеспечения:; Flags: unchecked
[Icons]
Name: {group}\{cm:UninstallProgram, {#AppName}}; Filename: {uninstallexe}
Name: {group}\{#AppName}; Filename: {app}\Binaries\Win32\BioShockInfinite.exe; WorkingDir: {app}\Binaries\Win32
Name: {commondesktop}\{#AppName}; Filename: {app}\Binaries\Win32\BioShockInfinite.exe; Tasks: desktopicon; WorkingDir: {app}\Binaries\Win32
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\Tomb Raider; Filename: {app}\Binaries\Win32\BioShockInfinite.exe; WorkingDir: {app}\Binaries\Win32; Tasks: quicklaunchicon
[Registry]
Root: HKCU; SubKey: Software\Valve\Steam\ActiveProcess; ValueType: string; ValueName: SteamClientDll; ValueData:
Root: HKCU; SubKey: Software\Valve\Steam\ActiveProcess; ValueType: string; ValueName: SteamClientDll64; ValueData:
Root: HKLM; SubKey: SOFTWARE\Valve\Steam; ValueType: string; ValueName: InstallPath; ValueData: {pf}\Steam; Flags: createvalueifdoesntexist
[UninstallDelete]
Type: filesandordirs; Name: {app}
[Files]
Source: Slides\*; DestDir: {tmp}; Flags: dontcopy
[...Code]
#ifdef UNICODE
#define A "W"
#else
#define A "A"
#endif
const
MAX_PATH = 260;
MAX_PATH_LEN = 55;
type
TProc=procedure(HandleW, msg, idEvent, TimeSys: LongWord);
var
TimerID: LongWord;
CurrentPicture: integer;
PicList: TStringlist;
WlcLbl, DirLbl, DirLbl1, DirLbl2, DirLbl3, TasksLbl, TasksLbl1: TLabel;
DirBvl, DirBvl1, TasksBvl, TasksBvl1: TBevel;
PathLabel: TLabel;
function PathCompactPathEx(pszOut: String; pszSrc: String; cchMax: UINT; dwFlags: DWORD): BOOL; external 'PathCompactPathEx{#A}@shlwapi.dll stdcall';
function WrapTimerProc(callback:TProc; paramcount:integer):longword; external 'wrapcallback@files:ISDone.dll stdcall';
function SetTimer(hWnd, nIDEvent, uElapse, lpTimerFunc: LongWord): LongWord; external 'SetTimer@user32.dll stdcall';
function KillTimer(hWnd, nIDEvent: LongWord): LongWord; external 'KillTimer@user32.dll stdcall';
function GetSystemMetrics(nIndex:Integer):integer; external 'GetSystemMetrics@user32.dll stdcall';
procedure InitializeSlideShow(Hwnd:Thandle; l,t,w,h:integer;Animate:boolean; Stretch:integer); external 'InitializeSlideShow@files:isslideshow.dll stdcall';
procedure DeinitializeSlideShow; external 'DeinitializeSlideShow@files:isslideshow.dll stdcall';
procedure ShowImage(ipath:PAnsiChar; Effect:integer); external 'ShowImage@files:isslideshow.dll stdcall';
/////////////////////////////////////////////////////////////////////////////////////
function ShortPath(Input: String; Length: Integer): String;
begin
Result := StringOfChar(#32, MAX_PATH);
PathCompactPathEx(Result, Input, Length, 0);
end;
procedure DirEditOnChange(Sender: TObject);
begin
PathLabel.Caption := ShortPath(TEdit(Sender).Text, MAX_PATH_LEN);
end;
////////////////////////////////////////////////////////////////////////////////////
procedure InitializeWizard();
var
i: integer;
begin
WizardForm.Position := poScreenCenter;
WizardForm.ClientWidth := ScaleX(600);
WizardForm.ClientHeight := ScaleX(366);
WizardForm.InnerNotebook.Hide;
WizardForm.OuterNotebook.Hide;
WizardForm.Bevel.Parent := WizardForm;
WizardForm.Bevel.Top := ScaleX(313);
WizardForm.Bevel.Width := ScaleX(600);
WizardForm.NextButton.SetBounds(420,328,80,26);
WizardForm.CancelButton.SetBounds(500,328,80,26);
WizardForm.BackButton.SetBounds(340,328,80,26);
WizardForm.WizardBitmapImage.Parent := WizardForm;
WizardForm.WizardBitmapImage.SetBounds(0,0,600,313);
WizardForm.DirEdit.Parent := WizardForm;
// WizardForm.DirEdit.AutoSelect := False;
// WizardForm.DirEdit.ParentColor := True; //Color := clBlack;
// WizardForm.DirEdit.Font.Color := clWhite;
WizardForm.DirEdit.SetBounds(20,142,325,21);
WizardForm.DirEdit.OnChange := @DirEditOnChange;
WizardForm.DirEdit.Hide;
WizardForm.GroupEdit.Parent := WizardForm;
WizardForm.GroupEdit.AutoSelect := False;
WizardForm.GroupEdit.Color := clBlack;
WizardForm.GroupEdit.Font.Color := clWhite;
WizardForm.GroupEdit.SetBounds(20,222,325,21);
WizardForm.DirBrowseButton.Parent := WizardForm;
WizardForm.DirBrowseButton.SetBounds(350,141,80,23);
WizardForm.DirBrowseButton.Caption := 'Изменить';
WizardForm.GroupBrowseButton.Parent := WizardForm;
WizardForm.GroupBrowseButton.SetBounds(350,221,80,23);
WizardForm.GroupBrowseButton.Caption := 'Изменить';
WizardForm.TasksList.Parent := WizardForm;
WizardForm.TasksList.ParentColor := True; //clBlack;
WizardForm.TasksList.Font.Color := clWhite;
WizardForm.TasksList.SetBounds(36,110,295,150);
WizardForm.StatusLabel.Parent := WizardForm;
WizardForm.StatusLabel.Font.Name := 'Arial';
WizardForm.StatusLabel.Font.Height := -12;
WizardForm.StatusLabel.Font.Style := [fsBold];
WizardForm.StatusLabel.SetBounds(20,314,450,14);
WlcLbl := TLabel.Create(WizardForm);
With WlcLbl do begin
Parent := WizardForm;
Transparent := True;
WordWrap := True;
Font.Name := 'Arial';
Font.Color := clWhite;
Font.Height := -13;
Font.Style := [fsBold];
Caption := 'Вас приветствует Мастер установки {#AppName}' + #13#10#13#10#13#10 + 'Программа установит {#AppName} на Ваш компьютер. Рекомендуется закрыть все прочие приложения и отключить антивирусное программное обеспечение перед тем, как продолжить.' + #13#10#13#10#13#10 + 'Нажмите «Далее», чтобы продолжить, или «Отмена», чтобы выйти из программы установки.';
SetBounds(20,106,390,176);
end;
DirLbl := TLabel.Create(WizardForm);
With DirLbl do begin
Parent := WizardForm;
Transparent := True;
WordWrap := True;
Font.Name := 'Arial';
Font.Color := clWhite;
Font.Height := -12;
Font.Style := [fsBold];
Caption := 'Требуется как минимум наличие 10.2 Гб свободного дискового пространства.';
SetBounds(15,275,385,30);
end;
DirLbl1 := TLabel.Create(WizardForm);
With DirLbl1 do begin
Parent := WizardForm;
Transparent := True;
WordWrap := True;
Font.Name := 'Arial';
Font.Color := clWhite;
Font.Height := -12;
Font.Style := [fsBold];
Caption := 'Папка в меню «Пуск»';
SetBounds(35,200,135,20);
end;
DirLbl2 := TLabel.Create(WizardForm);
With DirLbl2 do begin
Parent := WizardForm;
Transparent := True;
WordWrap := True;
Font.Name := 'Arial';
Font.Color := clWhite;
Font.Height := -12;
Font.Style := [fsBold];
Caption := 'Путь установки';
SetBounds(35,120,90,20);
end;
DirLbl3 := TLabel.Create(WizardForm);
With DirLbl3 do begin
Parent := WizardForm;
Transparent := True;
WordWrap := True;
Font.Name := 'Arial';
Font.Color := clWhite;
Font.Height := -12;
Font.Style := [fsBold];
Caption := 'Выбор параметров установки. Если Вы хотите выбрать другую папку, нажмите «Изменить». Нажмите «Далее», чтобы продолжить';
SetBounds(15,65,365,45);
end;
TasksLbl := TLabel.Create(WizardForm);
With TasksLbl do begin
Parent := WizardForm;
Transparent := True;
WordWrap := True;
Font.Name := 'Arial';
Font.Color := clWhite;
Font.Height := -12;
Font.Style := [fsBold];
Caption := 'Выбор компонентов';
SetBounds(30,72,120,20);
end;
TasksLbl1 := TLabel.Create(WizardForm);
With TasksLbl1 do begin
Parent := WizardForm;
Transparent := True;
WordWrap := True;
Font.Name := 'Arial';
Font.Color := clWhite;
Font.Height := -12;
Font.Style := [fsBold];
Caption := 'Когда Вы будете готовы приступить к установке нажмите «Установить»';
SetBounds(30,272,290,30);
end;
DirBvl := TBevel.Create(WizardForm);
with DirBvl do
begin
Parent := WizardForm;
Style := bsFrame;
SetBounds(10,115,430,75);
end;
DirBvl1 := TBevel.Create(WizardForm);
with DirBvl1 do
begin
Parent := WizardForm;
Style := bsFrame;
SetBounds(10,195,430,75);
end;
TasksBvl := TBevel.Create(WizardForm);
with TasksBvl do
begin
Parent := WizardForm;
Style := bsFrame;
SetBounds(10,65,430,240);
end;
TasksBvl1 := TBevel.Create(WizardForm);
with TasksBvl1 do
begin
Parent := WizardForm;
Style := bsFrame;
SetBounds(25,95,400,175);
end;
PicList := TStringlist.Create;
for i:= 1 to 30 do begin
ExtractTemporaryFile(IntToStr(i)+'.jpg');
piclist.add(ExpandConstant('{tmp}\') + IntToStr(i)+'.jpg');
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////
PathLabel := TLabel.Create(WizardForm)
with PathLabel do
begin
Parent := WizardForm;
Caption := ShortPath(WizardForm.DirEdit.Text, MAX_PATH_LEN);
Transparent := True;
Font.Size := 9;
Font.Color := clWhite;
Font.Style := [fsBold];
Left := WizardForm.DirEdit.Left;
Top := WizardForm.DirEdit.Top + Round((WizardForm.DirEdit.Height - Height) div 2);
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////
end;
procedure OnTimer(HandleW, msg, idEvent, TimeSys: LongWord);
begin
CurrentPicture := CurrentPicture+1;
if CurrentPicture = piclist.count+1 then CurrentPicture := 1;
ShowImage(piclist.strings[CurrentPicture - 1], 1);
end;
Procedure HideComponents();
begin
WizardForm.WizardBitmapImage.Hide;
WizardForm.GroupEdit.Hide;
WizardForm.DirBrowseButton.Hide;
WizardForm.GroupBrowseButton.Hide;
WizardForm.TasksList.Hide;
WizardForm.StatusLabel.Hide;
WlcLbl.Hide;
DirLbl.Hide;
DirLbl1.Hide;
DirLbl2.Hide;
DirLbl3.Hide;
DirBvl.Hide;
DirBvl1.Hide;
TasksBvl.Hide;
TasksBvl1.Hide;
TasksLbl.Hide;
TasksLbl1.Hide;
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssInstall then begin
WizardForm.ProgressGauge.Hide;
WizardForm.CancelButton.Hide;
CreateControls;
WizardForm.StatusLabel.Caption := 'Распаковка файлов...';
ISDoneCancel:=0;
ExtractTemporaryFile('unarc.dll');
ExtractTemporaryFile('CLS-precomp.dll');
ExtractTemporaryFile('packjpg_dll.dll');
ExtractTemporaryFile('packjpg_dll1.dll');
ExtractTemporaryFile('precomp.exe');
ExtractTemporaryFile('zlib1.dll');
ExtractTemporaryFile('CLS-srep.dll');
ExtractTemporaryFile('facompress.dll');
#ifdef records
ExtractTemporaryFile('records.inf');
#endif
ExtractTemporaryFile('russian.ini');
#ifdef precomp
PCFVer:={#precomp};
#else
PCFVer:=0;
#endif
ISDoneError:=true;
if ISDoneInit(ExpandConstant('{src}\records.inf'), $F777, 0,0,0, MainForm.Handle, 0, @ProgressCallback) then begin
repeat
if not SrepInit (ExpandConstant('{app}\'),512,0) then break;
if not PrecompInit(ExpandConstant('{app}\'),128,0) then break;
if not FileSearchInit(false) then break;
if not ISArcExtract ( 0, 0, ExpandConstant('{src}\data1.bin'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY) then break;
if not ISArcExtract ( 0, 0, ExpandConstant('{src}\data2.bin'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY) then break;
if not ISArcExtract ( 0, 0, ExpandConstant('{src}\data3.bin'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY) then break;
if not ISArcExtract ( 0, 0, ExpandConstant('{src}\data4.bin'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY) then break;
if not ShowChangeDiskWindow ('Пожалуйста, вставьте второй диск и дождитесь его инициализации.', ExpandConstant('{src}'),'data5.bin') then break;
if not ISArcExtract ( 0, 0, ExpandConstant('{src}\data5.bin'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY) then break;
ISDoneError:=false;
until true;
ISDoneStop;
end;
HideControls;
WizardForm.CancelButton.Visible:=true;
WizardForm.CancelButton.Enabled:=false;
end;
if (CurStep=ssPostInstall) and ISDoneError then begin
Exec2(ExpandConstant('{uninstallexe}'), '/VERYSILENT', false);
end;
end;
procedure CurPageChanged(CurPageID: integer);
begin
PathLabel.Hide;/// Здесь: лейбл скрывается
if CurPageID = wpWelcome then begin
HideComponents;
WizardForm.WizardBitmapImage.Show;
WlcLbl.Show;
end;
if CurPageID = wpSelectDir then begin
HideComponents;
WizardForm.WizardBitmapImage.Show;
PathLabel.Show;/// здесь: показывается только на странице выбора папок
WizardForm.GroupEdit.Show;
WizardForm.DirBrowseButton.Show;
WizardForm.GroupBrowseButton.Show;
DirBvl.Show;
DirBvl1.Show;
DirLbl.Show;
DirLbl1.Show;
DirLbl2.Show;
DirLbl3.Show;
end;
if CurPageID = wpSelectTasks then begin
HideComponents;
WizardForm.WizardBitmapImage.Show;
WizardForm.TasksList.Show;
WizardForm.NextButton.Caption := 'Установить';
TasksBvl.Show;
TasksBvl1.Show;
TasksLbl.Show;
TasksLbl1.Show;
end;
if CurPageID = wpInstalling then begin
InitializeSlideShow(WizardForm.Handle, 0, 0, scaleX(600), ScaleY(313), true, 2);
CurrentPicture := 1;
ShowImage(piclist.strings[CurrentPicture-1], 1);
TimerID := SetTimer(0, 0, 10000, WrapTimerProc(@OnTimer, 4));
HideComponents;
WizardForm.WizardBitmapImage.Show;
WizardForm.StatusLabel.Show;
end;
if CurPageID = wpFinished then begin
DeinitializeSlideShow;
KillTimer(0, TimerID);
HideComponents;
WizardForm.WizardBitmapImage.Show;
WlcLbl.Show;
WlcLbl.Caption := 'Завершение Мастера установки {#AppName}' + #13#10#13#10#13#10 + 'Игра {#AppName} установлена на ваш компьютер. Приложение можно запустить с помощью соответствующего значка.' + #13#10#13#10#13#10 + 'Нажмите «Завершить», чтобы выйти из программы установки.';
end;
if (CurPageID = wpFinished) and ISDoneError then
begin
WizardForm.Caption := 'Ошибка распаковки!';
WlcLbl.Font.Color := clRed;
WlcLbl.Caption := SetupMessage(msgSetupAborted) ;
end;
end;
function ShouldSkipPage(PageID: Integer): Boolean;
begin
if (PageID=wpSelectProgramGroup) or (PageID=wpReady) or (PageID=wpSelectComponents) then Result := true;
end;
procedure DeinitializeSetup();
begin
DeinitializeSlideShow;
KillTimer(0, TimerID);
end;
|