Вопрос Как сделать кликабельный логотип в Inno Setup ?

Canek77

Мимокрокодил
В скрипте всё прописано но не работает клик по логотипу, не пойму что не так...
Код:
#ifdef logo
procedure LogoLabelOnClick(Sender: TObject);
var
  ErrorCode: Integer;
begin
  ShellExec('open', 'https://krinkels.org/', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;

procedure logo();
begin
  LogoPanel:=TPanel.Create(WizardForm);
  with LogoPanel do begin
    Parent:=WizardForm;
    Left:=ScaleX(7);
    Top:=ScaleY(319);
    Width:=ScaleX(188);
    Height:=ScaleY(44);
    BevelOuter:=bvNone;
  end;

  LogoImage:=TBitmapImage.Create(WizardForm);
  with LogoImage do begin
    Parent:=LogoPanel;
    Left:=ScaleX(0);
    Top:=ScaleY(0);
    AutoSize:=true;
    ReplaceColor:=clFuchsia;
    ReplaceWithColor:=clBtnFace;
  #ifndef Skin
    ExtractTemporaryFile('logo.bmp');
  #else
    ExtractTemporaryFile('logo.bmp');
  #endif

  #ifndef Skin
    Bitmap.LoadFromFile(ExpandConstant('{tmp}\logo.bmp'));
  #else
    Bitmap.LoadFromFile(ExpandConstant('{tmp}\logo.bmp'));
  #endif
  end;

  LogoLabel := TLabel.Create(WizardForm);
  with LogoLabel do begin
    Parent:=LogoPanel;
    Width:=LogoPanel.Width;
    Height:=LogoPanel.Height;
    Transparent:=True;
  //Cursor:=crHand;
    OnClick:=@LogoLabelOnClick;
  end;
end;
#endif
 
Последнее редактирование модератором:

Nemko

Дилетант
Модератор
Canek77, воссоздал кусок кода, он рабочий. Дела не ясные:
  • Либо Inno на Вашей стороне, какой-то неадекватной версии (раз с кодировкой проблемы).
  • Может система "блочит" вызов ShellExec, а может Вы в ней не хозяин.
  • Так же с браузерами бывают прения и блокировщиками реклам.
  • Ссылки необходимо указывать с указание протокола передачи данных (http://).
  • Код не весь представлен, не исключены сюрпризы.
Склоняюсь больше к первому пункту, т.к. функция ShellExecute имеет две версии в системе Ansi\Unicode, раз с кодировкой беда, может в сборке Inno что-то не так. Но вполне и последняя заметка.
Думаю стоит протестировать маленькие примерчики, что на форуме: exp1, exp2 и т.д.
 

Shegorat

Lord of Madness
Администратор
Последние браузеры отказываются от протокола "http://" , т.к. он не безопасный, так что в системе вполне может не быть ассоциированного приложения для данного протокола.
Также не исключен вариант с тем, что код неполный и данный кусок в принципе не используется в реальном инсталляторе.
 

SBalykov

Старожил
В скрипте всё прописано но не работает клик по логотипу, не пойму что не так...
Код:
#ifdef logo
procedure LogoLabelOnClick(Sender: TObject);
var
  ErrorCode: Integer;
begin
  ShellExec('open', 'https://krinkels.org/', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;

procedure logo();
begin
  LogoPanel:=TPanel.Create(WizardForm);
  with LogoPanel do begin
    Parent:=WizardForm;
    Left:=ScaleX(7);
    Top:=ScaleY(319);
    Width:=ScaleX(188);
    Height:=ScaleY(44);
    BevelOuter:=bvNone;
  end;

  LogoImage:=TBitmapImage.Create(WizardForm);
  with LogoImage do begin
    Parent:=LogoPanel;
    Left:=ScaleX(0);
    Top:=ScaleY(0);
    AutoSize:=true;
    ReplaceColor:=clFuchsia;
    ReplaceWithColor:=clBtnFace;
  #ifndef Skin
    ExtractTemporaryFile('logo.bmp');
  #else
    ExtractTemporaryFile('logo.bmp');
  #endif

  #ifndef Skin
    Bitmap.LoadFromFile(ExpandConstant('{tmp}\logo.bmp'));
  #else
    Bitmap.LoadFromFile(ExpandConstant('{tmp}\logo.bmp'));
  #endif
  end;

  LogoLabel := TLabel.Create(WizardForm);
  with LogoLabel do begin
    Parent:=LogoPanel;
    Width:=LogoPanel.Width;
    Height:=LogoPanel.Height;
    Transparent:=True;
  //Cursor:=crHand;
    OnClick:=@LogoLabelOnClick;
  end;
end;
#endif
Добавьте процедуру:
Код:
procedure InitializeWizard();
begin
  logo();
end;
И вообще если не собираетесь делать ндпись то можно и упростить:
[Setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={pf}\My Ap

[Files]
Source: logo.bmp; DestDir: {tmp};
; Flags: dontcopy

Код:
var
LogoPanel: TPanel;
LogoImage: TBitmapImage;
ErrorCode: Integer;

procedure LogoLabelOnClick(Sender: TObject);
begin
ShellExec('open', 'http://vk.com/', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;

procedure logo();
begin
ExtractTemporaryFile('logo.bmp');
LogoPanel := TPanel.Create(WizardForm);
with LogoPanel do
begin
Parent := WizardForm;
Left := ScaleX(7);
Top := ScaleY(318);
Width := ScaleX(188);
Height := ScaleY(40);
BevelOuter := bvNone;
end;

LogoImage := TBitmapImage.Create(WizardForm);
with LogoImage do
begin
Bitmap.LoadFromFile(ExpandConstant('{tmp}\logo.bmp'));
Parent := LogoPanel;
Left := ScaleX(0);
Top := ScaleY(0);
AutoSize := True;
OnClick :=@LogoLabelOnClick;
Cursor := crHand;
end;
end;

procedure InitializeWizard();
begin
  logo();
end;
 
Последнее редактирование:

Canek77

Мимокрокодил
что-то из тех способов которые посоветовали у меня не сработали, постоянно различные ошибки ловлю, кто может пофиксить, приложу к сообщению скрипт с файлами.
 

Вложения

Хамик

Старожил
что-то из тех способов которые посоветовали у меня не сработали, постоянно различные ошибки ловлю, кто может пофиксить, приложу к сообщению скрипт с файлами.
Код:
  LogoImage := TBitmapImage.Create(WizardForm);
with LogoImage do
begin
  OnClick:=@LogoLabelOnClick;
  Cursor := crHand;
  Parent := LogoPanel;
  Left := ScaleX(0);
  Top := ScaleY(0);
  AutoSize:=true;
  ReplaceColor:=clFuchsia;
  ReplaceWithColor:=clBtnFace;
#ifndef Skin
  ExtractTemporaryFile('logo.bmp');
#else
  ExtractTemporaryFile('logo.bmp');
#endif
#ifndef Skin
  Bitmap.LoadFromFile(ExpandConstant('{tmp}\logo.bmp'));
#else
  Bitmap.LoadFromFile(ExpandConstant('{tmp}\logo.bmp'));
#endif
end;
 

Canek77

Мимокрокодил
Код:
  LogoImage := TBitmapImage.Create(WizardForm);
with LogoImage do
begin
  OnClick:=@LogoLabelOnClick;
  Cursor := crHand;
  Parent := LogoPanel;
  Left := ScaleX(0);
  Top := ScaleY(0);
  AutoSize:=true;
  ReplaceColor:=clFuchsia;
  ReplaceWithColor:=clBtnFace;
#ifndef Skin
  ExtractTemporaryFile('logo.bmp');
#else
  ExtractTemporaryFile('logo.bmp');
#endif
#ifndef Skin
  Bitmap.LoadFromFile(ExpandConstant('{tmp}\logo.bmp'));
#else
  Bitmap.LoadFromFile(ExpandConstant('{tmp}\logo.bmp'));
#endif
end;
очередная ошибка
 

Хамик

Старожил
Ну я прикрепил файлы, можно вставить и посмотреть, каждый раз делать скрины различных ошибок, это ну такое себе занятие.
файлы скачал, скомпилировал, посмотрел где косяк, исправил, проверил, скинул ответ исправленную часть. ошибок нет.
Код:
#define AppId                           "{5300663-7990-4437-0330-9B899FC263F9}"
#define MyAppName                       "Unreal Tournament 2003"
#define AppVerName                      "Unreal Tournament 2003 v.2225"
#define DefaultGroupName                "Unreal Tournament 2003"

#define CurentNeedSize                  "3520"
#define TotalNeedSize                   "3562"

#define NeedMem                         "512"

#define MyAppExeName                    "\System\UT2003.exe"
#define path                            "{app}\System\UT2003.exe"
#define IconFile                        "icon.ico"

; Если нужна музыка. Если нет, закомментировать
;#define Music

; Если нужны компоненты. Если нет, закомментировать
;#define Components

#define FirewallInstallHelper

; Если нужны скины. Если нет, закомментировать
#define Skin                            "Tiger.cjstyles"

; Если нужно лого. Если нет, закомментировать
#define logo

; Если нужен 2 прогрессбар. Если нет, закомментировать
;#define SecondProgressBar

;#define records
;#define precomp04
;#define precomp038
;#define unrar

#define records

[Setup]
AppId={{#AppId}
AppName={#MyAppName}
AppVerName={#AppVerName}
DefaultDirName=C:\Games\{#MyAppName}
DefaultGroupName={#DefaultGroupName}
AppPublisher=Repack by Canek77
InfoBeforeFile=Files\InfoBefore.rtf
OutputBaseFilename=setup
Compression=lzma/ultra64
SolidCompression=true
AllowNoIcons=true
OutputDir=Output
VersionInfoCopyright=Canek77™
SetupIconFile=Files\Install\{#IconFile}
WizardImageFile=Files\Install\WizardImage.bmp
#ifdef Skin
WizardSmallImageFile=Files\Install\WizardSmallImage1.bmp
#else
WizardSmallImageFile=Files\Install\WizardSmallImage1.bmp
#endif
DirExistsWarning=no
UninstallFilesDir={app}\Uninstall
ShowTasksTreeLines=true
#ifdef NeedSize
ExtraDiskSpaceRequired={#TotalNeedSize}
#endif

[Languages]
Name: rus; MessagesFile: compiler:Languages\Russian.isl
Name: eng; MessagesFile: compiler:Default.isl


[CustomMessages]
rus.ExtractedFile=Извлекается файл:
rus.Extracted=Распаковка архивов...
rus.Error=Ошибка распаковки!
rus.ElapsedTime=Прошло времени:
rus.RemainingTime=Осталось времени:
rus.EstimatedTime=Всего:
rus.AllElapsedTime=Время установки:
rus.Welcome1=Вас приветствует %nМастер установки игры %n{#MyAppName}
rus.Welcome2=Программа установит игру %n{#AppVerName} на Ваш компьютер.%n%nРекомендуется закрыть антивирусные пакеты, %nа также все прочие приложения перед тем, %nкак продолжить.%n%n%nНажмите «Далее», чтобы продолжить, или  %n«Отмена», чтобы выйти из программы установки.
rus.Finished1=Установка игры %n{#MyAppName} %nуспешно завершена.
rus.Finished2=Игра {#AppVerName} %nбыла успешно установлена на Ваш компьютер.
rus.Finished3=Нажмите «Завершить», чтобы выйти из программы установки.
rus.ISDoneFinishedHeading=Установка игры %n{#MyAppName} %nне завершена!
rus.ISDoneTitleBack=Откат установки...
rus.DeleteSave=Удалить сохраненные игры и профили?

eng.ExtractedFile=The file is extracted:
eng.Extracted=Unpacking archives...
eng.Error=Unpacking error!
eng.ElapsedTime=Time elapsed:
eng.RemainingTime=Time left:
eng.EstimatedTime=Total:
eng.AllElapsedTime=Installation time:
eng.Welcome1=Welcome to %n Game Installer %n{#MyAppName}
eng.Welcome2=The program will install the game %n{#AppVerName} to your computer.%n%nIt is recommended to close anti-virus packages, %nas well as all other applications before, %nhow to continue.%n%n%nClick «Next» to continue, or %n«Cancel», to exit the installer.
eng.Finished1=Installing the game %n{#MyAppName} %ncompleted successfully.
eng.Finished2=Game {#AppVerName} %nhas been successfully installed on your computer.
eng.Finished3=Click «Finish» to exit the installer.
eng.ISDoneFinishedHeading=Installing the game %n{#MyAppName} %nnot completed!
eng.ISDoneTitleBack=Install rollback...
eng.DeleteSave=Delete saved games and profiles?

[Files]
Source: Files\Install\*; Flags: dontcopy
Source: Files\Install\5.ico; DestDir: {app}; Flags: ignoreversion; Attribs: hidden system
#ifdef FirewallInstallHelper
Source: Files\Install\FirewallInstallHelper.dll; DestDir: {app}; Flags: ignoreversion
#endif
#ifdef Skin
Source: Files\ISSkin\{#Skin}; DestDir: {app}; Flags: ignoreversion; Attribs: hidden system
Source: Files\ISSkin\ISSkin.dll; DestDir: {app}; Flags: ignoreversion; Attribs: hidden system
#endif
#ifdef records
Source: records.inf; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef precomp04
Source: Files\Install\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
Source: Files\Install\RTconsole.exe; DestDir: {tmp}; Flags: dontcopy
Source: Files\Install\precomp04.exe; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef precomp038
Source: Files\Install\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
Source: Files\Install\RTconsole.exe; DestDir: {tmp}; Flags: dontcopy
Source: Files\Install\precomp038.exe; DestDir: {tmp}; Flags: dontcopy
Source: Files\Install\zlib1.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef unrar
Source: Files\Install\Unrar.dll; DestDir: {tmp}; Flags: dontcopy
#endif

#ifdef Music
Source: Files\Music\*; Flags: dontcopy
#endif

#ifdef Components
[Types]
Name: full; Description: Full installation; Flags: iscustom

[Components]
#endif

[Registry]
Root: HKLM; SubKey: SOFTWARE\Unreal Technology\Installed Apps\UT2003; ValueType: string; ValueName: Folder; ValueData: "{app}";
Root: HKLM; SubKey: SOFTWARE\Unreal Technology\Installed Apps\UT2003; ValueType: string; ValueName: Version; ValueData: 2225
Root: HKLM; SubKey: SOFTWARE\Unreal Technology\Installed Apps\UT2003; ValueType: string; ValueName: CDKey; ValueData: EKBD7-BNG9Y-BBDE9-PGER2
Root: HKLM; SubKey: SOFTWARE\Unreal Technology\Installed Apps\UT2003; ValueType: string; ValueName: ADMIN_RIGHTS; ValueData: You need to run this program as an administrator, not as a guest or limited user account.
Root: HKLM; SubKey: SOFTWARE\Unreal Technology\Installed Apps\UT2003; ValueType: string; ValueName: NO_DISC; ValueData: No disc in drive.  Please insert the disc labelled 'Unreal Tournament 2003 Play Disc' to continue.
Root: HKLM; SubKey: SOFTWARE\Unreal Technology\Installed Apps\UT2003; ValueType: string; ValueName: NO_DRIVE; ValueData: No CD-ROM or DVD-ROM drive detected.
Root: HKLM; SubKey: SOFTWARE\Unreal Technology\Installed Apps\UT2003; ValueType: string; ValueName: TITLEBAR; ValueData: Unreal Tournament 2003
Root: HKLM; SubKey: SOFTWARE\Unreal Technology\Installed Apps\UT2003; ValueType: string; ValueName: WRONG_DISC; ValueData: Wrong disc in drive.  Please insert the disc labelled 'Unreal Tournament 2003 Play Disc' to continue.
Root: HKLM; SubKey: SOFTWARE\Unreal Technology\Installed Apps\UT2003; ValueType: string; ValueName: YEAR; ValueData: 2003
Root: HKLM; SubKey: SOFTWARE\WOW6432Node\Unreal Technology\Installed Apps\UT2003; ValueType: string; ValueName: Folder; ValueData: "{app}";
Root: HKLM; SubKey: SOFTWARE\WOW6432Node\Unreal Technology\Installed Apps\UT2003; ValueType: string; ValueName: Version; ValueData: 2225
Root: HKLM; SubKey: SOFTWARE\WOW6432Node\Unreal Technology\Installed Apps\UT2003; ValueType: string; ValueName: CDKey; ValueData: EKBD7-BNG9Y-BBDE9-PGER2
Root: HKLM; SubKey: SOFTWARE\WOW6432Node\Unreal Technology\Installed Apps\UT2003; ValueType: string; ValueName: ADMIN_RIGHTS; ValueData: You need to run this program as an administrator, not as a guest or limited user account.
Root: HKLM; SubKey: SOFTWARE\WOW6432Node\Unreal Technology\Installed Apps\UT2003; ValueType: string; ValueName: NO_DISC; ValueData: No disc in drive.  Please insert the disc labelled 'Unreal Tournament 2003 Play Disc' to continue.
Root: HKLM; SubKey: SOFTWARE\WOW6432Node\Unreal Technology\Installed Apps\UT2003; ValueType: string; ValueName: NO_DRIVE; ValueData: No CD-ROM or DVD-ROM drive detected.
Root: HKLM; SubKey: SOFTWARE\WOW6432Node\Unreal Technology\Installed Apps\UT2003; ValueType: string; ValueName: TITLEBAR; ValueData: Unreal Tournament 2003
Root: HKLM; SubKey: SOFTWARE\WOW6432Node\Unreal Technology\Installed Apps\UT2003; ValueType: string; ValueName: WRONG_DISC; ValueData: Wrong disc in drive.  Please insert the disc labelled 'Unreal Tournament 2003 Play Disc' to continue.
Root: HKLM; SubKey: SOFTWARE\WOW6432Node\Unreal Technology\Installed Apps\UT2003; ValueType: string; ValueName: YEAR; ValueData: 2003

[Icons]
Name: {group}\{#MyAppName}; Filename: {app}\System\UT2003.exe; WorkingDir: {app}; IconFilename: {#path}; Comment: {#MyAppName}; Check: CheckError
Name: {group}\Удалить игру; Filename: {uninstallexe}; WorkingDir: {app}\Uninstall\; IconFilename: {app}\5.ico; Comment: Удалить игру {#MyAppName}; Check: CheckError
Name: {commondesktop}\Unreal Tournament 2003; Filename: {app}\System\UT2003.exe; WorkingDir: {app}; IconFilename: {#path};

[Run]
Filename: "{src}\Soft\dxwebsetup.exe"; StatusMsg: "Идет установка DirectX..."; Tasks: Redist1;

[Tasks]
Name: desktopicon; Description: Добавить ярлык на рабочий стол;
Name: "redist1"; Description: "Установить DirectX";   

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

#ifdef Music
  #include "Files\Music\Music.iss"
#endif

[Code]
const
  PCFonFLY=true;
  oneMb = 1048576;
  notPCFonFLY=false;
   Color = clBlack;
var
  LabelPct1,LabelCurrFileName,LabelTime1,LabelTime2,LabelTime3,LabelTime4,PageNameLabel,PageNameLabel1,PageDescriptionLabel,
  PageDescriptionLabel1,WelcomeLabel1,WelcomeLabel2,WelcomeLabel3,WelcomeLabel4,TotalNeedSpaceLabel,NeedSpaceLabel,FreeSpaceLabel,
  FinishedHeadingLabel,FinishedHeadingLabel1,FinishedLabel,FinishedLabel1,FinishedLabel2,FinishedLabel3,StatusLabel,LogoLabel: TLabel;
  BmpFile,LogoImage: TBitmapImage;
  ISDoneProgressBar1: TNewProgressBar;
#ifdef SecondProgressBar
  LabelPct2: TLabel;
  ISDoneProgressBar2:TNewProgressBar;
#endif
  MyCancelButton: TButton;
  FreeMB, TotalMB: Cardinal;
  MyError:boolean;
  PCFVer:double;
  CurentNeedSize, TotalNeedSize,Cancel: Integer;
  path, name: String;
  LogoPanel: TPanel;

type
  TCallback = function (OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;

function ISArcExtract(CurComponent:longword; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password, CfgFile, WorkPath: AnsiString; ExtractPCF: BOOL ):BOOL; external 'ISArcExtract@files:ISDone.dll stdcall';
function IS7ZipExtract(CurComponent:longword; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password: AnsiString):BOOL; external 'IS7zipExtract@files:ISDone.dll stdcall';
function ISRarExtract(CurComponent:longword; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password: AnsiString):BOOL; external 'ISRarExtract@files:ISDone.dll stdcall';
function ISPrecompExtract(CurComponent:longword; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):BOOL; external 'ISPrecompExtract@files:ISDone.dll stdcall';
function ISSRepExtract(CurComponent:longword; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):BOOL; external 'ISSrepExtract@files:ISDone.dll stdcall';
function ShowChangeDiskWindow(Text, DefaultPath, SearchFile:AnsiString):BOOL; external 'ShowChangeDiskWindow@files:ISDone.dll stdcall';
function ISDoneInitialize(RecordFileName:AnsiString; TimeType,Comp1,Comp2,Comp3:longword; PrecompVers: double; RecursiveSubDir:boolean; WinHandle, NeededMem:longint; callback:TCallback):BOOL; external 'ISDoneInitialize@files:ISDone.dll stdcall';
function ISDoneStop:BOOL; external 'ISDoneStop@files:ISDone.dll stdcall';
#ifdef FirewallInstallHelper
function AddApplicationToExceptionList(path: String; name: String): Boolean; external 'AddApplicationToExceptionListA@files:FirewallInstallHelper.dll stdcall setuponly';
function RemoveApplicationFromExceptionList(path: String): Boolean; external 'RemoveApplicationFromExceptionListA@{app}\FirewallInstallHelper.dll stdcall uninstallonly';
#endif
#ifdef Skin
procedure LoadSkin(lpszPath: PAnsiChar; lpszIniFileName: PAnsiChar); external 'LoadSkin@{tmp}\isskin.dll stdcall delayload';
procedure UnloadSkin; external 'UnloadSkin@{tmp}\isskin.dll stdcall delayload';
function ShowWindow(hWnd: Integer; uType: Integer): Integer; external 'ShowWindow@user32.dll stdcall';
#endif

function InitializeSetup: Boolean;
begin
#ifdef Music
  InitializeMusicSetup;
#endif
#ifdef Skin
  ExtractTemporaryFile('isskin.dll');
  ExtractTemporaryFile('{#Skin}');
  LoadSkin(ExpandConstant('{tmp}\{#Skin}'), '');
#endif
  Result:=true;
end;

function ProgressCallback(OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
begin
  if OveralPct<=1000 then ISDoneProgressBar1.Position := OveralPct;
  LabelPct1.Caption := IntToStr(OveralPct div 10)+'.'+chr(48 + OveralPct mod 10)+'%';
#ifdef SecondProgressBar
  if CurrentPct<=1000 then
    ISDoneProgressBar2.Position := CurrentPct;
  LabelPct2.Caption := IntToStr(CurrentPct div 10)+'.'+chr(48 + CurrentPct mod 10)+'%';
#endif
  LabelCurrFileName.Caption:=MinimizePathName(ExpandConstant('{cm:ExtractedFile} ')+CurrentFile, LabelCurrFileName.Font, LabelCurrFileName.Width);
  LabelTime1.Caption:=ExpandConstant('{cm:ElapsedTime} ')+TimeStr2;
  LabelTime2.Caption:=ExpandConstant('{cm:RemainingTime} ')+TimeStr1;
  LabelTime3.Caption:=ExpandConstant('{cm:AllElapsedTime} ')+TimeStr3;
  LabelTime4.Caption:=ExpandConstant('{cm:AllElapsedTime} ')+TimeStr3;
  Result := Cancel;
end;

// Перевод числа в строку с точностью 3 знака (%.3n) с округлением дробной части, если она есть
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 Size64(Hi, Lo: Integer): Extended;
Begin
    Result:= Lo;
    if Lo<0 then Result:= Result + $7FFFFFFF + $7FFFFFFF + 2;
    for Hi:= Hi-1 Downto 0 do
        Result:= Result + $7FFFFFFF + $7FFFFFFF + 2;
End;

procedure CancelButtonOnClick(Sender: TObject);
begin
  if MsgBox(SetupMessage(msgExitSetupMessage), mbConfirmation, MB_YESNO) = IDYES then Cancel:=1;
end;

//***************************************** [ начало изображения 497 360 ] *********************************************//

procedure Images_labels();
var
Page: TWizardPage;
begin
  with WizardForm do
  begin
  WizardBitmapImage.Width:=497
  WelcomeLabel1.Hide;
  WelcomeLabel2.Hide;
  WizardBitmapImage2.Hide;
  FinishedLabel.Hide;
  FinishedHeadingLabel.Hide;
  DiskSpaceLabel.Hide;
  ComponentsDiskSpaceLabel.Hide;
end;

//***************************************** [ конец 497 360 изображения  ] *********************************************//

//***************************************** [ начало 497 58 изображения  ] *********************************************//

PageNameLabel:= TLabel.Create(WizardForm);
  with PageNameLabel do
  begin
    Left:= WizardForm.PageNameLabel.Left;
    Top:= WizardForm.PageNameLabel.Top;
    Width:= WizardForm.PageNameLabel.Width;
    Height:= WizardForm.PageNameLabel.Height;
    AutoSize:= False;
    WordWrap:= True;
    Font.Name:= WizardForm.PageNameLabel.Font.Name;
    Font.Style:= [fsBold];
    Transparent:= True;
    Parent:= WizardForm.MainPanel;
  end;

PageDescriptionLabel:= TLabel.Create(WizardForm);
  with PageDescriptionLabel do
  begin
    Left:= WizardForm.PageDescriptionLabel.Left-12;
    Top:= WizardForm.PageDescriptionLabel.Top;
    Height:= WizardForm.PageDescriptionLabel.Height;
    Width:= ScaleX(260);
    AutoSize:= False;
    WordWrap:= True;
    Font.Name:= WizardForm.PageDescriptionLabel.Font.Name;
    Transparent:= True;
    Parent:= WizardForm.MainPanel;
  end;

  with WizardForm do
  begin
    PageNameLabel.Hide;
    PageDescriptionLabel.Hide;
    with MainPanel do
    begin
      with WizardSmallBitmapImage do
       begin
        Left:= ScaleX(0);
        Top:= ScaleY(0);
        Width:= Mainpanel.Width;
        Height:= MainPanel.Height;
       end;
    end;
 end;


//****************************************** [конец 497 58 изображения  ] **********************************************//

#ifdef FinishImage
  ExtractTemporaryFile('{#FinishImage}');
#else
  ExtractTemporaryFile('WizardImage.bmp');
#endif

  BmpFile:= TBitmapImage.Create(WizardForm);
#ifdef FinishImage
  BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\{#FinishImage}'));
#else
  BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\WizardImage.bmp'));
#endif
  BmpFile.Top:= ScaleY(0);
  BmpFile.Left:= ScaleX(0);
  BmpFile.Width:= ScaleX(497);
  BmpFile.Height:= ScaleY(313);
  BmpFile.Stretch:= true;
  BmpFile.Parent:= WizardForm.FinishedPage;

//******************************************* [ начало WelcomePage ] ***************************************************//

   WelcomeLabel1:= TLabel.Create(WizardForm);
  with WelcomeLabel1 do begin
    AutoSize:=False;
    SetBounds(ScaleX(-26), ScaleY(31), ScaleX(550), ScaleY(70));
    WordWrap:=True;
    Alignment := taCenter;
    Transparent:=True;
    Font.Name:='Georgia';
    Font.Size:= 14;
    Font.Color:=clSilver;
    Font.Style:=[fsBold];
    Caption:= ExpandConstant('{cm:Welcome1}');
    Parent:=WizardForm.WelcomePage;
  end;
  WelcomeLabel2:= TLabel.Create(WizardForm);
  with WelcomeLabel2 do begin
    AutoSize:=False;
    SetBounds(ScaleX(-27), ScaleY(30), ScaleX(550), ScaleY(70));
    WordWrap:=True;
    Alignment := taCenter;
    Transparent:=True;
    Font.Name:='Georgia';
    Font.Size:= 14;
    Font.Color:=$FFFFFF;
    Font.Style:=[fsBold];
    Caption:= ExpandConstant('{cm:Welcome1}');
    Parent:=WizardForm.WelcomePage;
  end;

  WelcomeLabel3:=TLabel.Create(WizardForm);
  with WelcomeLabel3 do begin
    AutoSize:=False;
    SetBounds(ScaleX(-26), ScaleY(121), ScaleX(550), ScaleY(200));
    WordWrap:=True;
    Alignment := taCenter;
    Transparent:=True;
    Font.Name:='Georgia';
    Font.Size:= 10;
    Font.Color:=clSilver;
    Font.Style := [fsBold, fsItalic];
    Caption:= ExpandConstant('{cm:Welcome2}');
    Parent:=WizardForm.WelcomePage;
  end;
  WelcomeLabel4:=TLabel.Create(WizardForm);
  with WelcomeLabel4 do begin
    AutoSize:=False;
    SetBounds(ScaleX(-27), ScaleY(120), ScaleX(550), ScaleY(200));
    WordWrap:=True;
    Alignment := taCenter;
    Transparent:=True;
    Font.Name:='Georgia';
    Font.Size:= 10;
    Font.Color:=$FFFFFF;
    Font.Style := [fsBold, fsItalic];
    Caption:= ExpandConstant('{cm:Welcome2}');
    Parent:=WizardForm.WelcomePage;
end;

//******************************************* [ конец WelcomePage ] ****************************************************//

//****************************************** [ начало SelectDirPage ] **************************************************//

WizardForm.DirEdit.Text:= MinimizePathName(WizardForm.DirEdit.Text, WizardForm.DirEdit.Font, WizardForm.DirEdit.Width);

//******************************************* [ конец SelectDirPage ] **************************************************//

//******************************************* [ начало FinishedPage ] **************************************************//

  FinishedHeadingLabel:= TLabel.Create(WizardForm);
  with FinishedHeadingLabel do begin
    SetBounds(ScaleX(-29), ScaleY(11), ScaleX(550), ScaleY(65));
    AutoSize:= false;
    Alignment := taCenter;
    Transparent:= true;
    WordWrap:= true;
    Font.Name:='Georgia';
    Font.Size:= 13;
    Font.Color:=clSilver;
    Font.Style := [fsBold];
    Caption:= ExpandConstant('{cm:Finished1}');
    Parent:=WizardForm.FinishedPage;
  end;
  FinishedHeadingLabel1:= TLabel.Create(WizardForm);
  with FinishedHeadingLabel1 do begin
    SetBounds(ScaleX(-30), ScaleY(10), ScaleX(550), ScaleY(65));
    AutoSize:= false;
    Alignment := taCenter;
    Transparent:= true;
    WordWrap:= true;
    Font.Name:='Georgia';
    Font.Size:= 13;
    Font.Color:=$FFFFFF;
    Font.Style := [fsBold];
    Caption:= ExpandConstant('{cm:Finished1}');
    Parent:=WizardForm.FinishedPage;
  end;

  FinishedLabel:=TLabel.Create(WizardForm);
  with FinishedLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(26), ScaleY(121), ScaleX(450), ScaleY(200));
    WordWrap:=True;
    Alignment := taCenter;
    Transparent:=True;
    Font.Name:='Georgia';
    Font.Size:= 10;
    Font.Color:=clSilver;
    Font.Style := [fsBold, fsItalic];
    Caption:= ExpandConstant('{cm:Finished2}');
    Parent:=WizardForm.FinishedPage;
  end;
  FinishedLabel1:=TLabel.Create(WizardForm);
  with FinishedLabel1 do begin
    AutoSize:=False;
    SetBounds(ScaleX(25), ScaleY(120), ScaleX(450), ScaleY(200));
    WordWrap:=True;
    Alignment := taCenter;
    Transparent:=True;
    Font.Name:='Georgia';
    Font.Size:= 10;
    Font.Color:=$FFFFFF;
    Font.Style := [fsBold, fsItalic];
    Caption:= ExpandConstant('{cm:Finished2}');
    Parent:=WizardForm.FinishedPage;
  end;
  FinishedLabel2:=TLabel.Create(WizardForm);
  with FinishedLabel2 do begin
    AutoSize:=False;
    SetBounds(ScaleX(26), ScaleY(261), ScaleX(450), ScaleY(200));
    WordWrap:=True;
    Alignment := taCenter;
    Transparent:=True;
    Font.Name:='Georgia';
    Font.Size:= 10;
    Font.Color:=clSilver;
    Font.Style := [fsBold, fsItalic];
    Caption:= ExpandConstant('{cm:Finished3}');
    Parent:=WizardForm.FinishedPage;
  end;
  FinishedLabel3:=TLabel.Create(WizardForm);
  with FinishedLabel3 do begin
    AutoSize:=False;
    SetBounds(ScaleX(25), ScaleY(260), ScaleX(450), ScaleY(200));
    WordWrap:=True;
    Alignment := taCenter;
    Transparent:=True;
    Font.Name:='Georgia';
    Font.Size:= 10;
    Font.Color:=$FFFFFF;
    Font.Style := [fsBold, fsItalic];
    Caption:= ExpandConstant('{cm:Finished3}');
    Parent:=WizardForm.FinishedPage;
  end;
end;


//******************************************* [ конец FinishedPage ] ***************************************************//

//*************************************** [ начало Место для установки ] ***********************************************//

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);
  NeedSpaceLabel.Caption := 'Игра займет на диске: '+ MbOrTb(CurentNeedSize)
  TotalNeedSpaceLabel.Caption := 'Для распаковки требуется: '+ MbOrTb(TotalNeedSize)
  FreeSpaceLabel.Caption := 'Доступно места на диске: '+ MbOrTb(FreeMB)
  WizardForm.NextButton.Enabled:= (FreeMB>TotalNeedSize);
  if (FreeMB<TotalNeedSize) then
    FreeSpaceLabel.Font.Color:=clRed else
    FreeSpaceLabel.Font.Color:=WizardForm.Font.Color;
end;

procedure SpaceLabel();
begin
  CurentNeedSize := {#CurentNeedSize};
  TotalNeedSize := {#TotalNeedSize};

  FreeSpaceLabel := TLabel.Create(WizardForm);
  FreeSpaceLabel.Parent := WizardForm.SelectDirPage;
  FreeSpaceLabel.SetBounds(ScaleX(5), ScaleY(180), ScaleX(209), ScaleY(13));

  TotalNeedSpaceLabel := TLabel.Create(WizardForm);
  TotalNeedSpaceLabel.Parent := WizardForm.SelectDirPage;
  TotalNeedSpaceLabel.SetBounds(ScaleX(5), ScaleY(200), ScaleX(209), ScaleY(13));

  NeedSpaceLabel := TLabel.Create(WizardForm);
  NeedSpaceLabel.Parent := WizardForm.SelectDirPage;
  NeedSpaceLabel.SetBounds(ScaleX(5), ScaleY(220), ScaleX(209), ScaleY(13));

  WizardForm.DirEdit.OnChange := @GetFreeSpaceCaption;
end;

//****************************************** [ конец Место для установки ] *************************************************//

//******************************************* [ начало элементы ISDone ] ***************************************************//

procedure HideComponents;
begin
  ISDoneProgressBar1.Hide;
  LabelPct1.Hide;
  LabelCurrFileName.Hide;
  LabelTime1.Hide;
  LabelTime2.Hide;
  MyCancelButton.Hide;
#ifdef SecondProgressBar
  ISDoneProgressBar2.Hide;
  LabelPct2.Hide;
#endif
end;

procedure ShowComponents;
var PBTop:integer;
begin
  PBTop:=WizardForm.ProgressGauge.Top;
  ISDoneProgressBar1 := TNewProgressBar.Create(WizardForm);
  with ISDoneProgressBar1 do begin
    Parent   := WizardForm.InstallingPage;
    Left     := ScaleX(0);
    Top      := PBTop;
    Width    := ScaleX(365);
    Max      := 1000;
    Height   := WizardForm.ProgressGauge.Height;
  end;
  LabelPct1 := TLabel.Create(WizardForm);
  with LabelPct1 do begin
    Parent    := WizardForm.InstallingPage;
    AutoSize  := False;
    Left      := ISDoneProgressBar1.Width+10;
    Top       := ISDoneProgressBar1.Top + 4;
    Width     := ScaleX(80);
  end;
  LabelCurrFileName := TLabel.Create(WizardForm);
  with LabelCurrFileName do begin
    Parent   := WizardForm.InstallingPage;
    AutoSize := False;
    Width    := ISDoneProgressBar1.Width+ScaleX(30);
    Left     := ScaleX(0);
    Top      := WizardForm.FileNamelabel.Top;
  end;
#ifdef SecondProgressBar
  PBTop:=PBTop+ScaleY(25);
  ISDoneProgressBar2 := TNewProgressBar.Create(WizardForm);
  with ISDoneProgressBar2 do begin
    Parent   := WizardForm.InstallingPage;
    Left     := ScaleX(0);
    Top      := PBTop+ScaleY(8);
    Width    := ISDoneProgressBar1.Width;
    Max      := 1000;
    Height   := WizardForm.ProgressGauge.Height;
  end;
  LabelPct2 := TLabel.Create(WizardForm);
  with LabelPct2 do begin
    Parent    := WizardForm.InstallingPage;
    AutoSize  := False;
    Left      := ISDoneProgressBar2.Width+ScaleX(10);
    Top       := ISDoneProgressBar2.Top + ScaleY(4);
    Width     := ScaleX(80);
  end;
#endif
  LabelTime1 := TLabel.Create(WizardForm);
  with LabelTime1 do begin
    Parent   := WizardForm.InstallingPage;
    AutoSize := False;
    Width    := 300;
    Left     := ScaleX(0);
    Top      := PBTop + ScaleY(35);
  end;
  LabelTime2 := TLabel.Create(WizardForm);
  with LabelTime2 do begin
    Parent   := WizardForm.InstallingPage;
    AutoSize := False;
    Width    := 300;
    Left     := ScaleX(0);
    Top      := PBTop + ScaleY(55);
  end;
  LabelTime3 := TLabel.Create(WizardForm);
  with LabelTime3 do begin
    Parent   := WizardForm.FinishedPage;
    Transparent:=True;
    Font.Name:='Georgia';
    Font.Size:= 10;
    Font.Color:=$000000;
    Font.Style := [fsBold, fsItalic];
    AutoSize := False;
    Alignment := taCenter;
    Width    := 450;
    Left     := 27;
    Top      := 222;
  end;
  LabelTime4 := TLabel.Create(WizardForm);
  with LabelTime4 do begin
    Parent   := WizardForm.FinishedPage;
    Transparent:=True;
    Font.Name:='Georgia';
    Font.Size:= 10;
    Font.Color:=$FFFFFF;
    Font.Style := [fsBold, fsItalic];
    AutoSize := False;
    Alignment := taCenter;
    Width    := 450;
    Left     := 25;
    Top      := 220;
  end;
  StatusLabel := TLabel.Create(WizardForm);
  with StatusLabel do begin
    Parent   := WizardForm.InstallingPage;
    AutoSize := False;
    Width    := 300;
    Left     := WizardForm.StatusLabel.Left;
    Top      := WizardForm.StatusLabel.Top;
    Caption  := ExpandConstant('{cm:ISDoneTitleBack}');
  end;
  MyCancelButton:=TButton.Create(WizardForm);
  with MyCancelButton do begin
    Parent:=WizardForm;
    Width:=WizardForm.Cancelbutton.Width;
    Caption:=WizardForm.Cancelbutton.Caption;
    Left:=WizardForm.Cancelbutton.Left;
    Top:=WizardForm.Cancelbutton.top;
    OnClick:=@CancelButtonOnClick;
  end;
end;

Procedure UnpackingISDoneFinished(CurPageID: Integer);
Begin
  if (CurPageID = wpFinished) and MyError then
  begin
    LabelTime3.Hide;
    LabelTime4.Hide;
    WizardForm.Caption:= ExpandConstant('{cm:Error}');
    FinishedHeadingLabel.Caption:= ExpandConstant('{cm:ISDoneFinishedHeading}');
    FinishedHeadingLabel.Font.Color:= $000000;
    FinishedHeadingLabel1.Caption:= ExpandConstant('{cm:ISDoneFinishedHeading}');
    FinishedHeadingLabel1.Font.Color:= $0000C0;    // red (красный)
    FinishedLabel.Font.Color:= $000000;
    FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
    FinishedLabel1.Font.Color:= $0000C0;
    FinishedLabel1.Caption:= SetupMessage(msgSetupAborted) ;
  end;
  if (CurPageID = wpFinished) and (Cancel <> 0) then
  begin
    LabelTime3.Hide;
    LabelTime4.Hide;
    WizardForm.Caption:= ExpandConstant('{cm:Error1}');
    FinishedHeadingLabel.Caption:= ExpandConstant('{cm:ISDoneFinishedHeading}');
    FinishedHeadingLabel.Font.Color:= $000000;
    FinishedHeadingLabel1.Caption:= ExpandConstant('{cm:ISDoneFinishedHeading}');
    FinishedHeadingLabel1.Font.Color:= $0000C0;    // red (красный)
    FinishedLabel.Font.Color:= $000000;
    FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
    FinishedLabel1.Font.Color:= $0000C0;
    FinishedLabel1.Caption:= SetupMessage(msgSetupAborted) ;
  end;
end;

function CheckError:boolean;
begin
  result:= not MyError;
end;

procedure UnpackingISDone(CurStep: TSetupStep);
var Comps1,Comps2,Comps3, TmpValue:longword;
    tmp:integer;
begin
  if CurStep = ssInstall then begin  //Если необходимо, можно поменять на ssPostInstall
    WizardForm.FileNamelabel.Hide;
    WizardForm.ProgressGauge.Hide;
    WizardForm.CancelButton.Hide;
    ShowComponents;
    WizardForm.StatusLabel.Caption:=ExpandConstant('{cm:Extracted}');
    Cancel:=0;

// Распаковка всех необходимых файлов в папку {tmp}.

    ExtractTemporaryFile('facompress.dll'); //ускоряет распаковку .arc архивов.
//    ExtractTemporaryFile('arc.ini');
//    ExtractTemporaryFile('srep.exe');

#ifdef records
    ExtractTemporaryFile('records.inf');
#endif
#ifdef precomp04
    ExtractTemporaryFile('packjpg_dll.dll');
    ExtractTemporaryFile('RTconsole.exe');
    ExtractTemporaryFile('precomp04.exe');
#endif
#ifdef precomp038
    ExtractTemporaryFile('packjpg_dll.dll');
    ExtractTemporaryFile('RTconsole.exe');
    ExtractTemporaryFile('precomp038.exe');
    ExtractTemporaryFile('zlib1.dll');
#endif
#ifdef unrar
    ExtractTemporaryFile('Unrar.dll');
#endif

// Подготавливаем переменную, содержащую всю информацию о выделенных компонентах для ISDone.dll
// максимум 96 компонентов.
    Comps1:=0; Comps2:=0; Comps3:=0;
#ifdef Components
    TmpValue:=1;
    if IsComponentSelected('text\rus') then Comps1:=Comps1+TmpValue;     //компонент 1
    TmpValue:=TmpValue*2;
    if IsComponentSelected('text\eng') then Comps1:=Comps1+TmpValue;     //компонент 2
    TmpValue:=TmpValue*2;
    if IsComponentSelected('voice\rus') then Comps1:=Comps1+TmpValue;    //компонент 3
    TmpValue:=TmpValue*2;
    if IsComponentSelected('voice\eng') then Comps1:=Comps1+TmpValue;    //компонент 4
//    .....
#endif

#ifdef precomp04
    PCFVer:=0.4;
#else
#ifdef precomp038
    PCFVer:=0.38;
#else
    PCFVer:=0;
#endif
#endif
    repeat
      MyError:=true;
      if not ISDoneInitialize(ExpandConstant('{src}\records.inf'), $F777, Comps1,Comps2,Comps3, PCFVer, false, MainForm.Handle, {#NeedMem}, @ProgressCallback) then break;
      repeat

//распаковка 7зип архивов
//if not IS7ZipExtract   ( 0, 0, ExpandConstant('{src}\bin.7z'), ExpandConstant('{app}'), false, '' ) then break;

//распаковка арг архивов

if not ISArcExtract    ( 0, 0, ExpandConstant('{src}\data-1.arc'),  ExpandConstant('{app}\'),        false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;

if not ISArcExtract    ( 0, 0, ExpandConstant('{src}\data-2.arc'),  ExpandConstant('{app}\'),        false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;

//распаковка зип--среп--арк архивов (в последовательности)
//if not ISArcExtract    ( 0, 0, ExpandConstant('{src}\DI.bin'),  ExpandConstant('{app}\'),        false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
//if not ISSRepExtract   ( 0, 0, ExpandConstant('{app}\DI.srp'),ExpandConstant('{app}\DI.7z'),      true                         ) then break;
//if not IS7ZipExtract   ( 0, 0, ExpandConstant('{app}\DI.7z'),     ExpandConstant('{app}\'),          true, ''                     ) then break;

        MyError:=false;
      until true;
      ISDoneStop;
    until true;
    HideComponents;
    WizardForm.ProgressGauge.Show;
    WizardForm.FileNamelabel.Show;
    WizardForm.CancelButton.Visible:=true;
    WizardForm.CancelButton.Enabled:=false;
  end;
  if (CurStep=ssPostInstall) and MyError then begin
    Exec(ExpandConstant('{uninstallexe}'), '/SILENT','', sw_Hide, ewWaitUntilTerminated, tmp);
  end;
end;

//******************************************** [ конец элементы ISDone ] ***************************************************//

//******************************************* [ начало UninstallingPage ] **************************************************//

#ifdef Skin
function InitializeUninstall: Boolean;
begin
  FileCopy(ExpandConstant('{app}\isskin.dll'), ExpandConstant('{tmp}\isskin.dll'), False);
  FileCopy(ExpandConstant('{app}\{#Skin}'), ExpandConstant('{tmp}\{#Skin}'), False);
  LoadSkin(ExpandConstant('{tmp}\{#Skin}'), '');
  Result:=True;
end;
#endif

//================== Удаление сохранений ==================//

procedure DeleteSavedGames(CurUninstallStep: TUninstallStep);
begin
  if CurUninstallStep=usUninstall then
  if DirExists(ExpandConstant('{userdocs}')+'\Criterion Games\{#MyAppName}') then
  if MsgBox(ExpandConstant('{cm:DeleteSave}'), mbInformation, MB_YESNO) = idYes then
  DelTree(ExpandConstant('{userdocs}')+'\Criterion Games\{#MyAppName}', True, True, True)
end;

//================== Удаление сохранений ==================//

//******************************************** [ конец UninstallingPage ] **************************************************//

//************************************ [ начало logo - Лого как ссылка внизу слева ] ***************************************//

#ifdef logo
procedure LogoLabelOnClick(Sender: TObject);
var
  ErrorCode: Integer;
begin
  ShellExec('open', 'http://vk.com/repack_canek77', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;

procedure logo();
begin
  LogoPanel := TPanel.Create(WizardForm);
with LogoPanel do
begin
  Parent := WizardForm;
  Left := ScaleX(7);
  Top := ScaleY(319);
  Width := ScaleX(188);
  Height := ScaleY(44);
  BevelOuter := bvNone;
end;

  LogoImage := TBitmapImage.Create(WizardForm);
with LogoImage do
begin
  OnClick:=@LogoLabelOnClick;
  Cursor := crHand;
  Parent := LogoPanel;
  Left := ScaleX(0);
  Top := ScaleY(0);
  AutoSize:=true;
  ReplaceColor:=clFuchsia;
  ReplaceWithColor:=clBtnFace;
#ifndef Skin
  ExtractTemporaryFile('logo.bmp');
#else
  ExtractTemporaryFile('logo.bmp');
#endif
#ifndef Skin
  Bitmap.LoadFromFile(ExpandConstant('{tmp}\logo.bmp'));
#else
  Bitmap.LoadFromFile(ExpandConstant('{tmp}\logo.bmp'));
#endif
end;

  LogoLabel := TLabel.Create(WizardForm);
with LogoLabel do
 begin
  Parent := LogoPanel;
  Width := LogoPanel.Width;
  Height := LogoPanel.Height;
  Transparent:=True;
  //Cursor := crHand;
//  OnClick:=@LogoLabelOnClick;
 end;
end;
#endif

//************************************ [ конец logo - Лого как ссылка внизу слева ] ***************************************//

procedure InitializeWizard();
begin
WizardForm.Bevel.visible:=False;
WizardForm.BeveledLabel.visible:=False;
WizardForm.Bevel1.visible:=False;

    Images_labels;
    SpaceLabel;
#ifdef SysReq
    HWREQ_CreatePanelSimple(nil);
#endif
#ifdef logo
    logo;
#endif
#ifdef Music
    InitializeMusic;
#endif

begin
WizardForm.Font.Color:=clSilver;
WizardForm.Color:=Color;
WizardForm.WelcomePage.Color:=Color;
WizardForm.InnerPage.Color:=Color;
WizardForm.FinishedPage.Color:=Color;
WizardForm.LicensePage.Color:=Color;
WizardForm.PasswordPage.Color:=Color;
WizardForm.InfoBeforePage.Color:=Color;
WizardForm.UserInfoPage.Color:=Color;
WizardForm.SelectDirPage.Color:=Color;
WizardForm.SelectComponentsPage.Color:=Color;
WizardForm.SelectProgramGroupPage.Color:=Color;
WizardForm.SelectTasksPage.Color:=Color;
WizardForm.ReadyPage.Color:=Color;
WizardForm.PreparingPage.Color:=Color;
WizardForm.InstallingPage.Color:=clBlack;
WizardForm.InfoAfterPage.Color:=Color;
WizardForm.DirEdit.Color:=Color;
WizardForm.DiskSpaceLabel.Color:=Color;
WizardForm.DirEdit.Color:=Color;
WizardForm.GroupEdit.Color:=Color;
WizardForm.PasswordLabel.Color:=Color;
WizardForm.PasswordEdit.Color:=Color;
WizardForm.PasswordEditLabel.Color:=Color;
WizardForm.ReadyMemo.Color:=Color;
WizardForm.TypesCombo.Color:=Color;
WizardForm.WelcomeLabel1.Color:=Color;
WizardForm.WelcomeLabel1.Font.Color:=clSilver;
WizardForm.InfoBeforeClickLabel.Color:=Color;
WizardForm.MainPanel.Color:=Color;
WizardForm.PageNameLabel.Color:=Color;
WizardForm.PageDescriptionLabel.Color:=Color;
WizardForm.ReadyLabel.Color:=Color;
WizardForm.FinishedLabel.Color:=Color;
WizardForm.YesRadio.Color:=Color;
WizardForm.NoRadio.Color:=Color;
WizardForm.WelcomeLabel2.Color:=Color;
WizardForm.LicenseLabel1.Color:=Color;
WizardForm.InfoAfterClickLabel.Color:=Color;
WizardForm.ComponentsList.Color:=Color;
WizardForm.ComponentsDiskSpaceLabel.Color:=Color;
WizardForm.BeveledLabel.Color:=Color;
WizardForm.StatusLabel.Color:=Color;
WizardForm.FilenameLabel.Color:=Color;
WizardForm.SelectDirLabel.Color:=Color;
WizardForm.SelectStartMenuFolderLabel.Color:=Color;
WizardForm.SelectComponentsLabel.Color:=Color;
WizardForm.SelectTasksLabel.Color:=Color;
WizardForm.LicenseAcceptedRadio.Color:=Color;
WizardForm.LicenseNotAcceptedRadio.Color:=Color;
WizardForm.UserInfoNameLabel.Color:=Color;
WizardForm.UserInfoNameEdit.Color:=Color;
WizardForm.UserInfoOrgLabel.Color:=Color;
WizardForm.UserInfoOrgEdit.Color:=Color;
WizardForm.PreparingLabel.Color:=Color;
WizardForm.FinishedHeadingLabel.Color:=Color;
WizardForm.FinishedHeadingLabel.Font.Color:=clSilver;
WizardForm.UserInfoSerialLabel.Color:=Color;
WizardForm.UserInfoSerialEdit.Color:=Color;
WizardForm.TasksList.Color:=Color;
WizardForm.RunList.Color:=Color;
WizardForm.SelectDirBrowseLabel.Color:=Color;
WizardForm.SelectStartMenuFolderBrowseLabel.Color:=Color;
WizardForm.PageNameLabel.Font.Color:=clSilver;
WizardForm.Bevel.visible:=False;
WizardForm.BeveledLabel.visible:=False;
WizardForm.Bevel1.visible:=False;
end;
 end;
Procedure CurPageChanged(CurPageID: Integer);
Begin
  PageNameLabel.Caption:= WizardForm.PageNameLabel.Caption;
    PageDescriptionLabel.Caption:= WizardForm.PageDescriptionLabel.Caption;
    if CurPageID = wpSelectDir then GetFreeSpaceCaption(nil);
    UnpackingISDoneFinished(CurPageID);
#ifdef SysReq
    TestChanged(CurPageID);
    if CurPageID = HWREQPage.ID then begin
    HWREQ_CompareSimple();
  end;
#endif
#ifdef Music
  CurPageMusicChanged(CurPageID);
#endif
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
#ifdef FirewallInstallHelper
  if CurStep = ssPostInstall then
    begin
    path:=ExpandConstant('{#path}');
    name:=ExpandConstant('{#MyAppName}');
    AddApplicationToExceptionList(path, name);
  end;
#endif
    UnpackingISDone(CurStep);
  if MyError then begin
    WizardForm.StatusLabel.Hide;
    StatusLabel.Show;
    WizardForm.FileNamelabel.Hide;
    WizardForm.ProgressGauge.Hide;
    HideComponents;
  end;
end;

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
    DeleteSavedGames(CurUninstallStep);
#ifdef FirewallInstallHelper
    if CurUninstallStep=usUninstall then
  begin
    path:=ExpandConstant('{#path}');
    RemoveApplicationFromExceptionList(path)
    UnloadDll(ExpandConstant('{app}\FirewallInstallHelper.dll'));
  end;
#endif
end;

procedure DeinitializeSetup;
begin
#ifdef Skin
    ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')),0);
      UnloadSkin;
#endif
#ifdef Music
    DeinitializeMusic;
#endif
end;

#ifdef Skin
procedure DeinitializeUninstall;
begin
  UnloadSkin;
end;
#endif
 

SBalykov

Старожил
Можешь прикрепить исправленную версию?
Не знаю в чем у Вас проблема...
Может в версии Inno или в чем-то другом, но у меня все работает, с учетом тех исправлений о которых писал выше...
 

Вложения

Canek77

Мимокрокодил
Не знаю в чем у Вас проблема...
Может в версии Inno или в чем-то другом, но у меня все работает, с учетом тех исправлений о которых писал выше...
спасибо большое, скачал исправленный скрипт всё работает!!! наверно я что-то не так вставлял, еще такой вопрос, вот где окно информации почему-то обычный текст всегда черный и на черном фоне не видно надписей, мне приходиться весь текст под ссылку делать чтобы текст выделялся, как сделать чтобы фон был белым или это только стиль менять надо?
 

SBalykov

Старожил
спасибо большое, скачал исправленный скрипт всё работает!!! наверно я что-то не так вставлял, еще такой вопрос, вот где окно информации почему-то обычный текст всегда черный и на черном фоне не видно надписей, мне приходиться весь текст под ссылку делать чтобы текст выделялся, как сделать чтобы фон был белым или это только стиль менять надо?
Где именно?
screenshot 2022-05-14 007.pngscreenshot 2022-05-14 008.pngscreenshot 2022-05-14 009.pngscreenshot 2022-05-14 010.pngscreenshot 2022-05-14 011.pngscreenshot 2022-05-14 012.png
 

Canek77

Мимокрокодил
Где текст подчёркнуты в описании сборки, получается если обычный текст написать то будет чёрными буквами на чёрном фоне их не видно соответственно, поэтому лишний раз приходиться добавлять как описание ссылки что очень не удобно, пробовал текст менять другим цветом всё ровно не помогает.
 

SBalykov

Старожил
Где текст подчёркнуты в описании сборки, получается если обычный текст написать то будет чёрными буквами на чёрном фоне их не видно соответственно, поэтому лишний раз приходиться добавлять как описание ссылки что очень не удобно, пробовал текст менять другим цветом всё ровно не помогает.
В данном случае необходима настройка скина соответствующей программой или заменить его...
 

Ka1dz0

Мимокрокодил
Может кто подсказать как сделать Два+ кликабельных логотипа\ссылки
и можно ли вообще так сделать?
 

Nemko

Дилетант
Модератор
Ka1dz0,
Код:
[Setup]
AppName=Example
AppVerName=0.1
OutputBaseFilename=Example
DefaultDirName={sd}\Example
DisableWelcomePage=False
OutputDir=.

[Code]
procedure URLClick(Obj: TObject);
var
  Path: AnsiString;
  ErrorCode: Integer;
begin
  if Obj is TLabel then begin
    case TLabel(Obj).Tag of
      0: Path:='https://jrsoftware.org/';
      1: Path:='https://krinkels.org/';
      {...}
      else Exit;
    end;
    ShellExec('open', Path, '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
  end;
end;

procedure InitializeWizard;
var
  i: Byte;
  Link: array of TLabel;
begin
  SetArrayLength(Link, 3);
  for i:=0 to GetArrayLength(Link)-1 do begin
    Link[i]:=TLabel.Create(nil);
    with Link[i] do begin
      Parent:=WizardForm;
      OnClick:=@URLClick;
      Font.Style:=Font.Style + [fsUnderline];
      Font.Color:=clBlue;
      Cursor:=crHand;
      Top:=340+14*i;
      Left:=10;
      Tag:=i;
      case i of
        0: Caption:='www.innosetup.com';
        1: Caption:='www.krinkels.org';
        {...}
        else Caption:='empty'
      end;
    end;
  end;
end;
 
Сверху