Показать полную графическую версию : Скрипты Inno Setup. Помощь и советы [часть 6]
Crazy Noise
29-03-2013, 23:31
Mailchik, Благодарю!
Только на каждую из
SOFTWARE\Adobe\Adobe ARM\1.0\ARM
SOFTWARE\Adobe\Acrobat Reader\11.0\Installer\Optimization
должно быть своё сообщение.
habib2302, http://i2.imageban.ru/out/2013/03/29/72f1b353ae87629db4f72f1d125297bc.png
saurn, Еще раз спасибо Вам за помощь. Вы были правы, причина была в библиотеке ISSkin (не та версия).
Может быть Вы сможете помочь и по следующему вопросу, буду вам очень признателен: Мне нужна переменная из Inno Setup в которую записывается значение (количество памяти на диске) необходимое для данной программы. Оно выводится в DiskSpaceLabel на странице "SelecDirSpace". Есть такое? Заранее спасибо!
Alloc
Вам нужна функция вычисления объёма диска?
function GetSpaceOnDisk(const Path: String; const InMegabytes: Boolean; var Free, Total: Cardinal): Boolean;
Простой пример:
[Setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={pf}\My Application
[...Code]
function NextButtonClick(CurPageID:integer): Boolean;
var
Disk: String;
FreeMB, TotalMB: Cardinal;
begin
Result:= True;
case CurPageID of
wpSelectDir:
begin
Disk := ExtractFileDrive(WizardForm.DirEdit.Text);
if GetSpaceOnDisk(Disk, True, FreeMB, TotalMB) then
begin
MsgBoxEx(0, 'Свободно ' + IntToStr(FreeMB) + ' мегабайт на диске ' + Disk, '', MB_OK or MB_ICONINFORMATION ,0 ,0);
end
end;
end;
end;
saurn, спасибо за ответ, но это не совсем то. извиняюсь, может быть не очень понятно объяснил.. мне нужна функция которая отобразит в DiscSpaceLabel точное количество памяти которое программа займет на диске при распаковке... помогите пожалуйста. Есть простой вариант самому прописывать необходимое количество памяти #define NeedSize "5059", но хотелось бы что б программа сама определяла.. Заранее спасибо.
но хотелось бы что б программа сама определяла.. Заранее спасибо. »
Ясно. Вам необходимо сравнить свободное место на диске с фактическим объёмом приложения, который инно вычисляет сама. Как это это сделать, я ,увы ,тоже не знаю. Так же, указываю нужный объём вручную. Где-то у меня был пример от Shegorat'а, там была реализована подобная функция, но насколько я помню, он выплевывал ошибку, если объём файлов был большим.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Вот пример. Может пригодится:
//;#Define NeedSize 5000
;Если у вас архивы FreeArc, то сдесь укажите сколько необходимо места в Мб
;Иначе просто закоментируйте строку
;Автор: Shegorat
[Setup]
AppName=My Program
AppVerName=My Program v 1.5
DefaultDirName={pf}\My Program
DisableFinishedPage=yes
OutputDir=.
Compression=lzma/ultra
InternalCompressLevel=ultra
SolidCompression=yes
[Languages]
Name: ENG; MessagesFile: "compiler:Default.isl"
Name: RUS; MessagesFile: "compiler:Languages\Russian.isl"
[Files]
Source: {win}\help\*.hlp; DestDir: {app}\Files; Flags: external
[CustomMessages]
RUS.FreeSpace=Доступно места на диске:
RUS.NeedSpace=Требуется места на диске:
ENG.FreeSpace=Free space on disk:
ENG.NeedSpace=Need space on disk:
[...Code]
var
NeedSpaceLabel,FreeSpaceLabel: TLabel;
FreeMB, TotalMB: Cardinal;
SizeStr: String;
SizeInt: Integer;
SymbolNumber: Integer;
Function NumToStr(Float: Extended): String;
Begin
Result:= Format('%.2n', [Float]); StringChange(Result, ',', '.');
while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = '.')) and (Pos('.', Result) > 0) do
SetLength(Result, Length(Result)-1);
End;
function GetSize(): Integer;
begin
SizeStr:= WizardForm.DiskSpaceLabel.Caption;
for SymbolNumber:= 97 to 122 do begin
while (Pos(Chr(SymbolNumber), SizeStr) > 0) do Delete(SizeStr, Pos(Chr(SymbolNumber), SizeStr),1); //Находим все символы нижнего регистра и удаляем
while (Pos(AnsiUppercase(Chr(SymbolNumber)), SizeStr) > 0) do Delete(SizeStr, Pos(AnsiUppercase(Chr(SymbolNumber)), SizeStr),1); end; //Находим все символы верхнего регистра и удаляем
for SymbolNumber:= 192 to 255 do begin
while (Pos(Chr(SymbolNumber), SizeStr) > 0) do Delete(SizeStr, Pos(Chr(SymbolNumber), SizeStr),1); end; //Находим все символы нижнего регистра и удаляем
while (Pos('.', SizeStr) > 0) do Delete(SizeStr, Pos('.', SizeStr), 1) //Удаляем точки
Delete(SizeStr, Pos(',', SizeStr), 5) //Удаляем дробную часть
Result:= StrToInt(Trim(SizeStr)); //Переводим в число
end;
function CompareNum(FirstNum, SecondNum: Integer): Boolean;
begin
if FirstNum < SecondNum then Result:= False else Result:= True;
end;
Function MbOrTb(Byte: Extended): String;
begin
if Byte < 1024 then Result:= NumToStr(Byte) + ' Мб' else
if Byte/1024 < 1024 then Result:= NumToStr(round(Byte/1024*100)/100) + ' Гб' else
Result:= NumToStr(round((Byte/(1024*1024))*100)/100) + ' Тб'
end;
procedure GetFreeSpaceCaption(Sender: TObject);
var Path: String;
begin
Path := ExtractFileDrive(WizardForm.DirEdit.Text);
GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
FreeSpaceLabel.Caption:= ExpandConstant('{cm:FreeSpace} ') + MbOrTb(FreeMB)
NeedSpaceLabel.Caption := ExpandConstant('{cm:NeedSpace} ') + MbOrTb(SizeInt)
if WizardForm.CurPageID = wpSelectDir then begin
WizardForm.NextButton.Enabled:= CompareNum(FreeMB, SizeInt)
end;
end;
procedure InitializeWizard();
begin
WizardForm.DiskSpaceLabel.Hide;
#ifdef NeedSize
SizeInt:= {#NeedSize}
#else
SizeInt:= GetSize;
#endif
NeedSpaceLabel := TLabel.Create(WizardForm);
NeedSpaceLabel.SetBounds(ScaleX(0), ScaleY(198), ScaleX(209), ScaleY(13))
NeedSpaceLabel.Parent := WizardForm.SelectDirPage;
NeedSpaceLabel.Transparent:=true;
FreeSpaceLabel := TLabel.Create(WizardForm);
FreeSpaceLabel.SetBounds(ScaleX(0), ScaleY(216), ScaleX(209), ScaleY(13))
FreeSpaceLabel.Parent := WizardForm.SelectDirPage;
FreeSpaceLabel.Transparent:=true;
WizardForm.DirEdit.OnChange:= @GetFreeSpaceCaption;
WizardForm.DirEdit.Text:= WizardForm.DirEdit.Text + #0;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpSelectDir then begin
GetFreeSpaceCaption(nil)
end;
end;
Johny777
30-03-2013, 07:01
Alloc, saurn, текущее кол-во требуемого места можно выдрать из текста в WizardForm.ComponentsDiskSpaceLabel (да не быть мне извращенцем :) )
при помощи самопальной function GetFloatFormText(const UndefText: String): String;
тк инсталл даже без секции файлов по дефолту всегда требует минимум 0.9 мб, то можно смело использовать функцию преобразования строки в Extended ( StrToFloat(...) )
для последующего сравнения свободного и требуемого места без боязни получить исключение конвертации нечисел в числа
вот полный пример динамичной(тк во время/в зависимости от выбора компонентов и текущего харда) проверки свободного места:
[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
[Components]
// пусть этот клмпонент занимает много места для теста :)
Name: A; Description: 1; Flags: disablenouninstallwarning; ExtraDiskSpaceRequired: 564591185599
Name: B; Description: 2; Flags: disablenouninstallwarning; ExtraDiskSpaceRequired: 564591185
Name: C; Description: 2; Flags: disablenouninstallwarning; ExtraDiskSpaceRequired: 564591185
Name: D; Description: 4; Flags: disablenouninstallwarning; ExtraDiskSpaceRequired: 564591185
[Code]
var
OldCompListOnClickCheckProc: TNotifyEvent;
function GetFloatFormText(const UndefText: String): String; // число из строки
var
i: Integer;
begin
for i := 1 to Length(UndefText) do
case UndefText[i] of
'0','1','2','3','4','5','6','7','8','9': Result := Result + UndefText[i];
',': Result := Result + '.';
end;
end;
function GetFreeDriveSpace(const UndefInstallPath: String): Cardinal; // упрощённая функция получения свободного места из входного аргумента (из пути)
var
TotalMB: Cardinal;
begin
GetSpaceOnDisk(ExtractFileDrive(UndefInstallPath), True, Result, TotalMB);
end;
function ComapreSpace(): Boolean; // проверяем свободное место
var
UndefNeedSize, UndefFreeSize: Extended;
begin
UndefNeedSize := StrToFloat( GetFloatFormText(WizardForm.ComponentsDiskSpaceLabel.Caption) );
UndefFreeSize := Extended( GetFreeDriveSpace( WizardDirValue() ) );
Result := UndefFreeSize > UndefNeedSize;
if not Result then if MsgBox('На выбранном Вами жёстком диске не хватает' + #32 + FloatToStr(UndefNeedSize-UndefFreeSize) + #32 + 'MB' + #13#10 +
'Изменить директорию установки?', mbError, MB_YESNO) = IDYES then
begin
WizardForm.BackButton.OnClick(nil);
WizardForm.DirBrowseButton.OnClick(nil);
Result := True;
end;
end;
procedure ComponentsListOnClickCheck(Sender: TObject);
begin
OldCompListOnClickCheckProc( TNewCheckListBox(Sender) );
WizardForm.NextButton.Enabled := ComapreSpace();
//WizardForm.Caption := GetFloatFormText(WizardForm.ComponentsDiskSpaceLabel.Caption); // debug
end;
procedure InitializeWizard();
begin
OldCompListOnClickCheckProc := WizardForm.ComponentsList.OnClickCheck; // пишем указатель на старую/родную процедуру в переменную, чтоб делать с чеклистбоксом то что делает инно по умолчению в строке 61
WizardForm.ComponentsList.OnClickCheck := @ComponentsListOnClickCheck;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpSelectComponents then WizardForm.NextButton.Enabled := ComapreSpace();
end;
habib2302
30-03-2013, 16:19
как в странице лицензии заменить Radio Button http://i48.fastpic.ru/big/2013/0330/08/f7d7af350a4570630892f0028f36f408.png (http://i33.fastpic.ru/big/2013/0330/6b/61597fc3b69a5d48401ed6e3d2242a6b.png) на Checkbox
Johny777, спасибо. Как я понял, по этому самому принципу можно извлечь кол-во необходимого места и из WizardForm.DiskSpaceLabel. Если нет компонентов в инстале.
Так верно?
[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
[Files]
Source: {win}\Fonts\*; DestDir: {app}; Flags: external; ExternalSize: 56459118550
[...Code]
function GetFloatFormText(const UndefText: String): String;
var
i: Integer;
begin
for i := 1 to Length(UndefText) do
case UndefText[i] of
'0','1','2','3','4','5','6','7','8','9': Result := Result + UndefText[i];
',': Result := Result + '.';
end;
end;
function GetFreeDriveSpace(const UndefInstallPath: String): Cardinal;
var
TotalMB: Cardinal;
begin
GetSpaceOnDisk(ExtractFileDrive(UndefInstallPath), True, Result, TotalMB);
end;
procedure ComapreSpace(Sender: TObject);
var
UndefNeedSize, UndefFreeSize: Extended;
begin
case Sender of
WizardForm.DirEdit:
begin
UndefNeedSize := StrToFloat(GetFloatFormText(WizardForm.DiskSpaceLabel.Caption));
UndefFreeSize := Extended(GetFreeDriveSpace(WizardDirValue()));
WizardForm.NextButton.Enabled := UndefFreeSize > UndefNeedSize;
if WizardForm.NextButton.Enabled then
WizardForm.DiskSpaceLabel.Font.Color := clBlack else WizardForm.DiskSpaceLabel.Font.Color := clRed;
end;
end;
end;
procedure InitializeWizard();
begin
WizardForm.DirEdit.OnChange := @ComapreSpace;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpSelectDir then ComapreSpace(WizardForm.DirEdit);
end;
------------------------------------------------------------------------------------------------
habib2302,
[Setup]
AppName=My License
AppVerName=My License v 1.3
CreateAppDir=False
OutputDir=.
licenseFile=compiler:Examples\Readme.txt
[Languages]
Name: rus; MessagesFile: compiler:Languages\Russian.isl
[...Code]
var
CheckLicense: TCheckBox;
procedure LicenseOnClick(Sender: TObject);
begin
if (CheckLicense.Checked) = True then
begin
WizardForm.LicenseAcceptedRadio.Checked := True;
end else
begin
WizardForm.LicenseNotAcceptedRadio.Checked := True;
end;
end;
procedure InitializeWizard();
begin
WizardForm.LicenseNotAcceptedRadio.Hide;
WizardForm.LicenseAcceptedRadio.Hide;
WizardForm.LicenseMemo.Height := ScaleY(175);
CheckLicense:= TCheckBox.Create(WizardForm);
CheckLicense.Left:= ScaleX(0);
CheckLicense.Top:= ScaleY(216);
CheckLicense.Caption:= WizardForm.LicenseAcceptedRadio.Caption;
CheckLicense.Width:= ScaleX(417);
CheckLicense.OnClick:= @LicenseOnClick;
CheckLicense.Parent:= WizardForm.LicensePage;
end;
Спасибо за помощь ребята, это именно то, что я искал
audiofeel
31-03-2013, 01:55
доброй ночи всем, подскажите как мне сделать "DirEdit" и "GroupEdit" = Transparent, ну или может есть другой способ
audiofeel
ParentColor := True;
Crazy Noise
31-03-2013, 02:29
audiofeel, Текст не виден?
WizardForm.DirEdit.Font.Color := clRed;
WizardForm.DirEdit.ParentColor := True;
audiofeel, да, щас проверил, на изображении такой способ не прокатывает. Кстати, вот тут вам уже приводили подобный пример: Пост #1586 (http://forum.oszone.net/post-2074787-1586.html) не оно?
audiofeel
31-03-2013, 02:33
saurn, да спасибо за участие но я его переношу в свой "скрипт" и эффекта нет
Crazy Noise
31-03-2013, 02:35
Вот как вариант
WizardForm.DirEdit.BorderStyle := bsNone;
audiofeel, ну этот пример рабочий 100%. Может, что не так делаете? Скрипт можно глянуть?
Crazy Noise
31-03-2013, 02:54
audiofeel, Вместе пробовал использовать?
WizardForm.DirEdit.ParentColor := True;
WizardForm.DirEdit.BorderStyle := bsNone;
audiofeel
31-03-2013, 03:04
Crazy Noise, нет не выходит, все "белое"
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;
audiofeel
31-03-2013, 03:38
saurn, скажи те вот а чтобы оное обвести (рамка) придется бевел создавать, или как то по "проще" - и ещё как мне быть с таск лист, он тоже не "красивый" = "делать" чек боксы" или ... - по другому нельзя?
© OSzone.net 2001-2012
vBulletin v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.