Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
  #961  
Old 22-02-2014, 02:31
Logrim Logrim is offline
Registered User
 
Join Date: Jun 2009
Location: Spain
Posts: 153
Thanks: 116
Thanked 72 Times in 44 Posts
Logrim is on a distinguished road
I try with invisible tbuttons like in my other forms, you know the others .. but nothing,, i try with botva buttons and nothing,, and i try making a form like my detect installation form in that way:

function ShowOptionsForm: TModalResult;
var
OptionsLabel, RepairButtonLabel, UninstallButtonLabel, OptionsCancelLabel: TLabel;
RepairButton, UninstallButton, OptionsCancelButton: TNewButton;
begin
Result := mrNone;
OptionsForm := CreateCustomForm;
try
etc
etc

But nothing seems to work.

The botva butons showing correctly but seems not to aply mrCancel and mrOk.
Reply With Quote
Sponsored Links
  #962  
Old 22-02-2014, 02:43
y_thelastknight's Avatar
y_thelastknight y_thelastknight is offline
Registered User
 
Join Date: Mar 2010
Location: Canada
Posts: 437
Thanks: 616
Thanked 576 Times in 213 Posts
y_thelastknight is on a distinguished road
Quote:
Originally Posted by Logrim View Post
I try with invisible tbuttons like in my other forms, you know the others .. but nothing,, i try with botva buttons and nothing,, and i try making a form like my detect installation form in that way:

function ShowOptionsForm: TModalResult;
var
OptionsLabel, RepairButtonLabel, UninstallButtonLabel, OptionsCancelLabel: TLabel;
RepairButton, UninstallButton, OptionsCancelButton: TNewButton;
begin
Result := mrNone;
OptionsForm := CreateCustomForm;
try
etc
etc

But nothing seems to work.

The botva butons showing correctly but seems not to aply mrCancel and mrOk.
Change the invisible button to visible and try click it. If it works set the botva2 button click tbutton

Eg ( botva2 button name.onclick=tbutton name.click )

Hope you understand what iam saying
__________________
Glass BB | BlackBox v2 | Portable Installer
Reply With Quote
  #963  
Old 22-02-2014, 03:10
Logrim Logrim is offline
Registered User
 
Join Date: Jun 2009
Location: Spain
Posts: 153
Thanks: 116
Thanked 72 Times in 44 Posts
Logrim is on a distinguished road
not work.. aggg,,, nah, y_thelasknight, thanks,, dont worry,, i'll try make the work later,, i need a beer :P..
Reply With Quote
  #964  
Old 22-02-2014, 03:27
y_thelastknight's Avatar
y_thelastknight y_thelastknight is offline
Registered User
 
Join Date: Mar 2010
Location: Canada
Posts: 437
Thanks: 616
Thanked 576 Times in 213 Posts
y_thelastknight is on a distinguished road
Quote:
Originally Posted by Logrim View Post
not work.. aggg,,, nah, y_thelasknight, thanks,, dont worry,, i'll try make the work later,, i need a beer :P..
Rofl
__________________
Glass BB | BlackBox v2 | Portable Installer
Reply With Quote
  #965  
Old 22-02-2014, 09:34
Logrim Logrim is offline
Registered User
 
Join Date: Jun 2009
Location: Spain
Posts: 153
Thanks: 116
Thanked 72 Times in 44 Posts
Logrim is on a distinguished road
Problems solved y_thelastknight,, all work ok now.
Reply With Quote
The Following User Says Thank You to Logrim For This Useful Post:
y_thelastknight (22-02-2014)
  #966  
Old 22-02-2014, 10:20
y_thelastknight's Avatar
y_thelastknight y_thelastknight is offline
Registered User
 
Join Date: Mar 2010
Location: Canada
Posts: 437
Thanks: 616
Thanked 576 Times in 213 Posts
y_thelastknight is on a distinguished road
Quote:
Originally Posted by Logrim View Post
Problems solved y_thelastknight,, all work ok now.
Beer fix it
__________________
Glass BB | BlackBox v2 | Portable Installer
Reply With Quote
The Following User Says Thank You to y_thelastknight For This Useful Post:
oltjon (22-02-2014)
  #967  
Old 23-02-2014, 00:18
Alfons Alfons is offline
Registered User
 
Join Date: Feb 2014
Location: Bulgaria
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Alfons is on a distinguished road
Hello all!
Im new in this thingy aaaaand i dont really have some expirience in Inno or Issi or Isskin and so on and on aaaaaaaand my question might be dumb but i wasted 2 days of thinking how to solve the problem aaaaand i cant.Im working with INNO, ISSI, and ISSkin

So i have some codes with InitializeWizard and InitializaSetup i know that in _issi.isi has the same lines aaaaaaand i tryed with making #define ISSI_useMyInitializeWizard and ISSI_useMyInitializeSetup and add it the same in the [CODE] Line but then the code dont work.

I tryed to make the line liiiike InitializeWizard() and InitializeWizard(1/2/3/4 and so on) aaand the codes dont respawn again. I even tryed to change the lines in .isi file (that idea was retard i know) aaand nothing again xD

I guess there is solution but i dont have the point of view to see it (if you know what i mean) so please i will be really happy if someone has some ideas how to work that out.
Reply With Quote
  #968  
Old 23-02-2014, 01:10
Razor12911's Avatar
Razor12911 Razor12911 is offline
Noob
 
Join Date: Jul 2012
Location: South Africa
Posts: 3,749
Thanks: 2,170
Thanked 11,206 Times in 2,307 Posts
Razor12911 is on a distinguished road
Quote:
Originally Posted by Alfons View Post
Hello all!
Im new in this thingy aaaaand i dont really have some expirience in Inno or Issi or Isskin and so on and on aaaaaaaand my question might be dumb but i wasted 2 days of thinking how to solve the problem aaaaand i cant.Im working with INNO, ISSI, and ISSkin

So i have some codes with InitializeWizard and InitializaSetup i know that in _issi.isi has the same lines aaaaaaand i tryed with making #define ISSI_useMyInitializeWizard and ISSI_useMyInitializeSetup and add it the same in the [CODE] Line but then the code dont work.

I tryed to make the line liiiike InitializeWizard() and InitializeWizard(1/2/3/4 and so on) aaand the codes dont respawn again. I even tryed to change the lines in .isi file (that idea was retard i know) aaand nothing again xD

I guess there is solution but i dont have the point of view to see it (if you know what i mean) so please i will be really happy if someone has some ideas how to work that out.
It's best to copy and fill a custom script by yourself else some line will repeat then error.
Reply With Quote
  #969  
Old 23-02-2014, 01:38
Alfons Alfons is offline
Registered User
 
Join Date: Feb 2014
Location: Bulgaria
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Alfons is on a distinguished road
Quote:
Originally Posted by Razor12911 View Post
It's best to copy and fill a custom script by yourself else some line will repeat then error.
I did that aaand same thingy BUT
I think i made it just now xD im not really sure how but it works now hahahahah.

Thanx for the quick answer thanx you so much
Reply With Quote
  #970  
Old 23-02-2014, 04:30
GloverK1911's Avatar
GloverK1911 GloverK1911 is offline
Registered User
 
Join Date: Nov 2013
Location: Viet Nam
Posts: 116
Thanks: 22
Thanked 8 Times in 4 Posts
GloverK1911 is on a distinguished road
I have a problem with my setup: the eplapsed not show time but when i'm click English button and click again to my language it's works with show time. How to fixx it???



This is my script
Code:
;======================================================;
;                                                      ;
;      $$$$  $$     $$     $$ $$$$$$$$ $$       $$     ;
;     $$$$$$ $$            $$ $$    $$ $$       $$     ;
;     $$     $$     $$     $$ $$    $$  $$     $$      ;
;       $$$  $$$$$$ $$ $$$$$$ $$    $$  $$  $  $$      ;
;         $$ $$   $ $$ $   $$ $$    $$  $$ $ $ $$      ;
;     $$$$$$ $$   $ $$ $   $$ $$    $$   $$   $$       ;
;      $$$$  $$   $ $$ $$$$$$ $$$$$$$$   $$   $$       ;
;                                                      ;
;========================================= © shidow====;
//-------- Информация по игре
// Название игры
#define GameName "DmC: Devil May Cry"
// Название папки игры (без /:*?"<>|)
#define PathGameName "DmC Devil May Cry"
// Исполняемый файл (ехе)
#define GameExeName "NFS13.exe"
// Версия
#define GameVersion "1.0
// Необходимое место для установки
#define NeedSize "5300"
//-------- Настройки инсталлятора
// Цвет текста
#define FontColor "$FFFFFF"
// Цвет текста на кнопках
#define ButtonColor "clBlack"
// Шрифт
#define FontName "UVF Assassin"
//-------- Дополнительные функции
// Каталог расположения exe файла игры (полный путь от корня {app}, если это не корень, то завершающий слэш "\" обязателен!)
#define GameExeFolder ""
// Каталог расположения деинсталлятора
#define UninstallFolder "Uninstall"
// Проверка на наличие русских букв в пути установки, если не нужно - закомментировать
#define RusLetters
// Английский язык инсталлятора, если не нужно - закомментировать
#define English
// Интеграция с социальными сетями, если не нужно - закомментировать 
// Текст для сохранения. Вместо пробелов "+"
;#define SocialNetwork "RePack+Need+for+Speed:+Most+Wanted+by+shidow"
// Autorun, если не нужен - закомментировать
;#define Autorun
// Путь до мануала, если не нужен манул - закомментировать
;#define ManualPath "{src}\support\manual.txt"
// URL оф.сайта игры, если не нужен сайт - закомментировать
#define SiteURL "http://www.needforspeed.com/"
// Проверка на наличие установленной игры через реестр, если не нужно - закомментировать 
#define RegCheck
// Ветка реестра
#define RegPath "SOFTWARE\EA Games\Need for Speed(TM) Most Wanted"
// Параметр
#define RegValue "DisplayName"
//-------- Компоненты
// Закоментировать, которые не используются (en - не обязательно)!
// Ru, En соответственно на русском и английском.
;#define Comp1Ru "Язык интерфейса"
#define Comp1En "Language text"
//---------------
;#define Comp2Ru "Английский"
#define Comp2En "English"
//---------------
;#define Comp3Ru "Русский"
#define Comp3En "Russian"
//---------------
;#define Comp4Ru "Таблетка"
#define Comp4En "Crack"
//---------------
;#define Comp5Ru "SKiDROW"
#define Comp5En "SKiDROW"
//---------------
;#define Comp6Ru "3DM"
#define Comp6En "3DM"
//---------------
;#define Comp7Ru ""
#define Comp7En ""
//---------------
;#define Comp8Ru ""
#define Comp8En ""
//-------- Проверка MD5-хеша файлов
// Хеш-суммы архивов по порядку data-1.bin, data-2.bin, ... data-8.bin.
// Закоментировать, которые не используются
;#define MD5_1 "8c3ebbccc64527c57aa08904860a9fba1"
;#define MD5_2 "9c7ccdce4e77225ad8d42c52e614fb2b"
;#define MD5_3 "c938c10d268cfc013fa6073e272522ad"
;#define MD5_4 ""
;#define MD5_5 ""
;#define MD5_6 ""
;#define MD5_7 ""
;#define MD5_8 ""
//-------- ISDone
// Компоненты ISDone
;#define Components
// Плавный прогрессбар
#define records
// а) первым делом убедитесь, что в начале скрипта закомментирована строка #define records
// б) компилим проект и запускаем на установку. Это и будет нашим тестовым проходом. Все операции должны дойти до конца и завершиться удачно.
// в) после тестового прогона в указанной папке создастся файл records.inf, его необходимо добавить в проект, раскомметировав строку
// Версия precomp'a
;#define precomp "0.42"
// Распаковка diff архивов
;#define XDelta
// Упаковка файлов в .zip архив
;#define PackZIP
// Распаковка .rar архивов
;#define unrar
// Увеличивает скорость распаковки архивов FreeArc'a
#define facompress
// Для распаковки FreeArc архивов с алгоритмом типа precomp+lzma
#define PrecompInside
// Для распаковки FreeArc архивов с алгоритмом типа srep+lzma
#define SrepInside
;#define MSCInside

[Setup]                    
AppName={#GameName}
AppPublisher=CongTruongIT
AppVersion={#GameVersion}
DefaultDirName={pf}\{#PathGameName}
DefaultGroupName={#PathGameName}
outputdir=New folder
OutputBaseFilename=setup
;SetupIconFile=D:\Other\RePack\Games\icon.ico
UninstallFilesDir={app}\{#UninstallFolder}

Compression=lzma/ultra64
SolidCompression=yes
RestartIfNeededByRun=no
ShowComponentSizes=false
ShowTasksTreeLines=True

[Files]
Source: Files\Include\Russian.ini; DestDir: {tmp}; Flags: dontcopy
Source: Files\Include\English.ini; DestDir: {tmp}; Flags: dontcopy
Source: Files\Include\unarc.dll; DestDir: {tmp}; Flags: dontcopy
Source: Files\ISDone.dll; DestDir: {tmp}; Flags: dontcopy
#ifdef records
Source: Files\records.inf; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef PrecompInside

Source: Files\Include\CLS-precomp.dll; DestDir: {tmp}; Flags: dontcopy
Source: Files\Include\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
Source: Files\Include\packjpg_dll1.dll; DestDir: {tmp}; Flags: dontcopy
Source: Files\Include\precomp.exe; DestDir: {tmp}; Flags: dontcopy
Source: Files\Include\zlib1.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef SrepInside
Source: Files\Include\CLS-srep.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef MSCInside
Source: Files\Include\CLS-MSC.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef facompress
Source: Files\Include\facompress.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef precomp
  #if precomp == "0.38"
  Source: Files\Include\precomp038.exe; DestDir: {tmp}; Flags: dontcopy
  #else
    #if precomp == "0.4"
    Source: Files\Include\precomp040.exe; DestDir: {tmp}; Flags: dontcopy
    #else
      #if precomp == "0.41"
      Source: Files\Include\precomp041.exe; DestDir: {tmp}; Flags: dontcopy
      #else
        #if precomp == "0.42"
        Source: Files\Include\precomp042.exe; DestDir: {tmp}; Flags: dontcopy
        #else
        Source: Files\Include\precomp038.exe; DestDir: {tmp}; Flags: dontcopy
        Source: Files\Include\precomp040.exe; DestDir: {tmp}; Flags: dontcopy
        Source: Files\Include\precomp041.exe; DestDir: {tmp}; Flags: dontcopy
        Source: Files\Include\precomp042.exe; DestDir: {tmp}; Flags: dontcopy
        #endif
      #endif
    #endif
  #endif
#endif
#ifdef unrar
Source: Files\Include\Unrar.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef XDelta
Source: Files\Include\XDelta3.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef PackZIP
Source: Files\Include\7z.dll; DestDir: {tmp}; Flags: dontcopy
Source: Files\Include\packZIP.exe; DestDir: {tmp}; Flags: dontcopy
#endif
Source: Files\CallbackCtrl.dll; DestDir: {tmp}; Flags: dontcopy;
Source: Files\ISDone.dll; DestDir: {tmp}; Flags: dontcopy;
Source: Files\botva2.dll; DestDir: {tmp}; Flags: dontcopy;
Source: Files\b2p.dll; DestDir: {tmp}; Flags: dontcopy;
Source: Files\WinTB.dll; DestDir: {tmp}; Flags: dontcopy;
Source: Files\background.bmp; DestDir: {tmp}; Flags: dontcopy; 
Source: Files\ProgressBackground.png; DestDir: {tmp}; Flags: dontcopy;
Source: Files\ProgressImg.png; DestDir: {tmp}; Flags: dontcopy;
Source: Files\button.png; DestDir: {tmp}; Flags: dontcopy;
Source: Files\edit.png; DestDir: {tmp}; Flags: dontcopy;
#ifdef SocialNetwork
Source: Files\vk.bmp; DestDir: {tmp}; Flags: dontcopy;
Source: Files\facebook.bmp; DestDir: {tmp}; Flags: dontcopy;
Source: Files\twitter.bmp; DestDir: {tmp}; Flags: dontcopy;
#endif
#ifdef Autorun
Source: Files\background-autorun.bmp; DestDir: {tmp}; Flags: dontcopy;
#endif

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

[Components]
;Name: text; Description: {#Comp1Ru}; Types: full; Flags: fixed
;Name: text\eng; Description: {#Comp2Ru}; Flags: exclusive;
;Name: text\rus; Description: {#Comp3Ru}; Flags: exclusive;
;Name: crack; Description: {#Comp4Ru}; Types: full; Flags: fixed
;Name: crack\skid; Description: {#Comp5Ru}; Flags: exclusive;
;Name: crack\3dm; Description: {#Comp6Ru}; Flags: exclusive;
;Name: voice\fra; Description: {#Comp7Ru}; Flags: exclusive;
;Name: voice\ita; Description: {#Comp8Ru}; Flags: exclusive;

[Icons]
Name: {userdesktop}\{#PathGameName}; IconFilename: {app}\{#GameExeFolder}{#GameExeName}; Filename: {app}\{#GameExeFolder}{#GameExeName}; WorkingDir: {app}\{#GameExeFolder}; Tasks: icon\desktop; Comment: Запустить {#GameName};
Name: {group}\{#PathGameName}; IconFilename: {app}\{#GameExeFolder}{#GameExeName}; Filename: {app}\{#GameExeFolder}{#GameExeName}; WorkingDir: {app}\{#GameExeFolder}; Tasks: icon\start;
Name: {group}\Удалить игру; IconFilename: {app}\{#GameExeFolder}{#GameExeName}; Filename: {uninstallexe}; WorkingDir: {app}\{#UninstallFolder}; Tasks: icon\start;
// Manual и ReadMe если есть
;Name: {group}\Руководство пользователя; Filename: {app}\Support\Russian\manual.pdf; WorkingDir: {app}; Check: NoIconsCheck;
;Name: {group}\ReadMe; Filename: {app}\Support\Russian\readme.txt; WorkingDir: {app}; Check: NoIconsCheck;


[Run]
Filename: {src}\Redist\vcredist_x86.exe; WorkingDir: {src}\Redist; Tasks: Redist\1; Flags: skipifdoesntexist; Check: CheckError;
Filename: {src}\Redist\dxwebsetup.exe; WorkingDir: {src}\Redist; Tasks: Redist\2; Flags: skipifdoesntexist; Check: CheckError;
;Filename: {src}\Redist\oalinst.exe; WorkingDir: {src}\Redist\; Tasks: Redist\3; Flags: skipifdoesntexist; Check: CheckError;
;Filename: {src}\Redist\vcredist_x86.exe; WorkingDir: {src}\Redist; Tasks: Redist\3; Flags: skipifdoesntexist; Check: CheckError and not IsWin64;
;Filename: {src}\Redist\vcredist_x64.exe; WorkingDir: {src}\Redist; Tasks: Redist\3; Flags: skipifdoesntexist; Check: CheckError and IsWin64;
;Filename: {src}\Redist\Rapture3D\rapture3d_2.4.9game.exe; WorkingDir: {src}\Redist\Rapture3D\; Tasks: Redist\4; Flags: skipifdoesntexist; Check: CheckError;
;Filename: msiexec.exe; Parameters: "-i ""{src}\Redist\xnafx31_redist.msi"" -qf"; WorkingDir: {src}\Redist\; Tasks: Redist\2; Flags: skipifdoesntexist; Check: CheckError;

[Tasks]
Name: icon; Description: Biк̉u tượng;  Flags: checkablealone
Name: icon\desktop; Description: Tạo icon ngoài màn hình;  Flags: checkablealone
Name: icon\start; Description: Tạo icon trкn Start Menu;  Flags: checkablealone
Name: redist; Description: Phв̀n mк̀m khác;  Flags: checkablealone
Name: redist\1; Description: Microsoft Visual C++;  Flags: checkablealone
Name: redist\2; Description: DirectX;  Flags: checkablealone
;Name: redist\3; Description: NET Framework;  Flags: checkablealone
;Name: redist\4; Description: OpenAL;  Flags: checkablealone

;[Registry]
[Languages]
Name: Via; MessagesFile:Vietnamese_2.isl
[CustomMessages]
Via.WizardForm=WizardForm - {#GameName}
Via.AutorunForm=Autorun - {#GameName}
Via.WelcomeLabel1=Chào mừng bạn đќn với trình cài đặt
Via.WelcomeLabel2=«{#GameName}» sẽ được cài trкn máy tính của bạn.%n%nBạn nкn đóng các ứng dụng đang chạy trước khi tiќp tục.%n%nNhв́n «Next» đк̉ tiќp tục, hoặc «Cancel» đк̉ thoát.
Via.SelectDirLabel1=Chọn thư mục cài đặt và các phв̀n mк̀m khác.%nNhв́n «Install» đк̉ bắt đв̀u.
Via.SelectDirLabel2_1=Cв̀n ít nhв́t
Via.SelectDirLabel2_2=ф̉ đĩa trф́ng đк̉ cài game.
Via.StatusLabel_1=Đang giải nén...
Via.StatusLabel_2=Giải nén hoàn tв́t...
Via.StatusLabel_3=Đang cài đặt các phв̀n mк̀m khác...
Via.StatusLabel_4=Đã dừng giải nén...
Via.FinishedLabel1=Completing the Setup Wizard of the game
Via.FinishedLabel2=Trò chơi «{#GameName}» Đã được cài đặt trкn máy tính của bạn!.%n%nTrò chơi có thк̉khởi  đф̣ng ngay bвy giờ bằng cách mở biк̉u tượng trò chơi.%n%nNhв́n «Finish», đк̉thoát trình cài đặt.
Via.FinishedLabel2_error=Đã có lф̃i xảy ra trong quá trình cài đặt «{#GameName}»%n%nHãy chắc chắn bạn đã khắc phục sự cф́ và chạy trình cài đặt mф̣t lв̀n nữa.%n%nNhв́n «Finish» đк̉ thoát.
Via.SelectDirForm=Duyк̣t thư mục
Via.SelectDirFormLabel=chọn mф̣t thư mục ở danh sách dưới rф̀i nhв́n «ОК».
Via.RusLetters_header=Invalid characters
Via.RusLetters=There're russian letters in the folder name so it can't be.%nPlease remove russian letters and repeat operation.
Via.ElapsedTime=Thời gian đã qua:
Via.RemainingTime=Tф̉ng thời gian cài:
Via.NewFolder=Thư mục mới
Via.CancelButton=Cancel
Via.NextButton=Next >
Via.BackButton=< Back
Via.BrowseButton=Browse...
Via.InstallButton=Install
Via.FinishButton=Finish
Via.PauseButton=Pause
Via.ResumeButton=Rumse
Via.EnglishButton=English
Via.RussianButton=Vietnamese
Via.OKButton=OK
Via.SocialNetworkButton=Social Network
Via.SocialNetworkFormLabel=Share
Via.RunGameError=Gặp lф̃i trong lúc bắt đв̀u trò chơi
Via.GameSet=«{#GameName}» Đã được cài trкn máy tính của bạn.%nVв̃n tiќp tục cài?
Via.InstallAutorunButton=Installation
Via.PlayAutorunButton=Play
Via.ManualAutorunButton=Manual
Via.SiteAutorunButton=Game Site
Via.ExitAutorunButton=Exit
Via.MD5ErrorEn=Hash checksums do not match!%nThis means that the files are corrupted.%nLoad distribution otherwise performance can not be guaranteed.%nAll still start the installation?


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




//-------- Подключаем модули
#Include "iss\botva2.iss"
#Include "iss\ProgressBar.iss"
#Include "iss\WinTB.iss"
#ifdef MD5_1
 #Include "iss\MD5.iss"
#endif
//--------------------------

const
  MB_ICONEXCLAMATION = $30;
  PCFonFLY=true;
  notPCFonFLY=false;

type
  LCID = LongInt;

var
  CloseLabel, WelcomeLabel1, WelcomeLabel2, DirEditLabel, SelectDirLabel1, SelectDirLabel2, SelectDirFormLabel,
  LabelPct1, LabelTime1, LabelTime2, StatusLabel, FinishedLabel1, FinishedLabel2: TLabel;
  CancelButton, NextButton, BackButton, BrowseButton, PauseButton, ResumeButton: HWND;
  SelectDirFormOKButton, SelectDirFormCancelButton, SelectDirFormNewFolderButton: TButton;
  BackgroundImg, DirEditImg: Longint;
  ISDoneCancel, ResultCode: Integer;
  FolderTreeView: TFolderTreeView;
  ISDoneProgressBar1: TImgPB;
  FreeMB, TotalMB: Cardinal;
  SelectDirForm: TSetupForm;
  ISDoneError: Boolean;
  ButtonFont: TFont;
  DirEdit: TEdit;
  PCFVer: Double;
 #ifdef SocialNetwork
  SocialNetworkFormLabel, CloseSocialNetworkFormLabel: TLabel;
  VKImage, FacebookImage, TwitterImage: TBitmapImage;
  SocialNetworkForm: TSetupForm;
  SocialNetworkButton: HWND;
 #endif
 #ifdef Autorun
  InstallAutorunButton, ManualAutorunButton, SiteAutorunButton, SocialNetworkAutorunButton,
  ExitAutorunButton, InfoAutorunButton: HWND;
  BackgroundAutorunImg: Longint;
  AutorunForm: TSetupForm;
  InstallCreate: boolean;
  Language: string;
 #ifdef English
  EnglishAutorunButton, RussianAutorunButton: HWND;
 #endif
 #ifdef RegCheck
  PlayAutorunButton: HWND;
  ResultReg: string;
 #endif
 #endif
 #ifdef English
  EnglishButton, RussianButton: HWND;
 #endif
 
function ReleaseCapture(): Longint; external '[email protected] stdcall';

function GetWindowLong(Wnd: HWnd; Index: Integer): Longint; external '[email protected] stdcall';
function SetClassLong(hWnd: HWND; Index, NewLong: Longint): Longint; external 'SetClassLongA@user32 stdcall';

function MessageBox(hWnd: Integer; lpText, lpCaption: String; uType: Cardinal): Integer; external '[email protected] stdcall';

function GetSystemDefaultLCID() : LCID; external '[email protected] stdcall';

procedure WizardFormOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  ReleaseCapture;
  SendMessage(WizardForm.Handle,$0112,$F012,0);
end;

procedure CancelButtonOnClick(hBtn:HWND);
begin
  WizardForm.CancelButton.OnClick(nil);
end;

procedure NextButtonOnClick(hBtn:HWND);
begin
  WizardForm.NextButton.OnClick(nil);
end;

procedure BackButtonOnClick(hBtn:HWND);
begin
  WizardForm.BackButton.OnClick(nil);
end;

procedure CloseLabelOnClick(Sender: TObject);
begin
  WizardForm.CancelButton.OnClick(nil);
end;

procedure CloseLabelOnMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
  CloseLabel.SetBounds(ScaleX(640), ScaleY(10), ScaleX(20), ScaleY(20));
end;

procedure WizardFormOnMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
  CloseLabel.SetBounds(ScaleX(640), ScaleY(7), ScaleX(20), ScaleY(20));
end;

//------- Необходимое место для установки
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 CompareNum(FirstNum, SecondNum: Integer): Boolean;
begin
  if FirstNum < SecondNum then Result:= False else Result:= True;
end;

function MbOrTb(Byte: Extended): String;
begin
 #ifdef English
  if BtnGetVisibility(RussianButton) then begin
    if Byte < 1024 then Result:= NumToStr(Byte) + ' MB' else
    if Byte/1024 < 1024 then Result:= NumToStr(round(Byte/1024*100)/100) + ' GB' else
    Result:= NumToStr(round((Byte/(1024*1024))*100)/100) + ' TB'
  end else begin
 #endif
    if Byte < 1024 then Result:= NumToStr(Byte) + ' MB' else
    if Byte/1024 < 1024 then Result:= NumToStr(round(Byte/1024*100)/100) + ' GB' else
    Result:= NumToStr(round((Byte/(1024*1024))*100)/100) + ' TB'
 #ifdef English
  end;
 #endif
end;

procedure GetFreeSpaceCaption(Sender: TObject);
var Path: String;
begin
  Path := ExtractFileDrive(WizardForm.DirEdit.Text);
  GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
  if CompareNum(FreeMB, {#NeedSize}) then begin
    BtnSetEnabled(NextButton, True);
    SelectDirLabel2.Font.Color:={#FontColor};
  end else begin
    BtnSetEnabled(NextButton, False);
    SelectDirLabel2.Font.Color:=clRed;
 end;
end;

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

function WrapCallback(callback:TCallback; paramcount:integer):longword;external 'wrapcallback@files:ISDone.dll stdcall delayload';

function ISArcExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath, ExtractedPath: AnsiString; DeleteInFile:boolean; Password, CfgFile, WorkPath: AnsiString; ExtractPCF: boolean ):boolean; external 'ISArcExtract@files:ISDone.dll stdcall delayload';
function IS7ZipExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password: AnsiString):boolean; external 'IS7zipExtract@files:ISDone.dll stdcall delayload';
function ISRarExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password: AnsiString):boolean; external 'ISRarExtract@files:ISDone.dll stdcall delayload';
function ISPrecompExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):boolean; external 'ISPrecompExtract@files:ISDone.dll stdcall delayload';
function ISSRepExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):boolean; external 'ISSrepExtract@files:ISDone.dll stdcall delayload';
function ISxDeltaExtract(CurComponent:Cardinal; PctOfTotal:double; minRAM,maxRAM:integer; InName, DiffFile, OutFile: AnsiString; DeleteInFile, DeleteDiffFile:boolean):boolean; external 'ISxDeltaExtract@files:ISDone.dll stdcall delayload';
function ISPackZIP(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString;ComprLvl:integer; DeleteInFile:boolean):boolean; external 'ISPackZIP@files:ISDone.dll stdcall delayload';
function ShowChangeDiskWindow(Text, DefaultPath, SearchFile:AnsiString):boolean; external 'ShowChangeDiskWindow@files:ISDone.dll stdcall delayload';

function Exec2 (FileName, Param: PAnsiChar;Show:boolean):boolean; external 'Exec2@files:ISDone.dll stdcall delayload';
function ISFindFiles(CurComponent:Cardinal; FileMask:AnsiString; var ColFiles:integer):integer; external 'ISFindFiles@files:ISDone.dll stdcall delayload';
function ISPickFilename(FindHandle:integer; OutPath:AnsiString; var CurIndex:integer; DeleteInFile:boolean):boolean; external 'ISPickFilename@files:ISDone.dll stdcall delayload';
function ISGetName(TypeStr:integer):PAnsichar; external 'ISGetName@files:ISDone.dll stdcall delayload';
function ISFindFree(FindHandle:integer):boolean; external 'ISFindFree@files:ISDone.dll stdcall delayload';
function ISExec(CurComponent:Cardinal; PctOfTotal,SpecifiedProcessTime:double; ExeName,Parameters,TargetDir,OutputStr:AnsiString;Show:boolean):boolean; external 'ISExec@files:ISDone.dll stdcall delayload';

function SrepInit(TmpPath:PAnsiChar;VirtMem,MaxSave:Cardinal):boolean; external 'SrepInit@files:ISDone.dll stdcall delayload';
function PrecompInit(TmpPath:PAnsiChar;VirtMem:cardinal;PrecompVers:single):boolean; external 'PrecompInit@files:ISDone.dll stdcall delayload';
function FileSearchInit(RecursiveSubDir:boolean):boolean; external 'FileSearchInit@files:ISDone.dll stdcall delayload';
function ISDoneInit(RecordFileName:AnsiString; TimeType,Comp1,Comp2,Comp3:Cardinal; WinHandle, NeededMem:longint; callback:TCallback):boolean; external 'ISDoneInit@files:ISDone.dll stdcall';
function ISDoneStop:boolean; external 'ISDoneStop@files:ISDone.dll stdcall';
function ChangeLanguage(Language:AnsiString):boolean; external 'ChangeLanguage@files:ISDone.dll stdcall delayload';
function SuspendProc:boolean; external 'SuspendProc@files:ISDone.dll stdcall';
function ResumeProc:boolean; external 'ResumeProc@files:ISDone.dll stdcall';

function ProgressCallback(OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
begin
  if OveralPct<=1000 then ImgPBSetPosition(ISDoneProgressBar1,OveralPct);
  LabelPct1.Caption := IntToStr(OveralPct div 10)+'.'+chr(48 + OveralPct mod 10)+'%';
 #ifdef English
  if BtnGetVisibility(RussianButton) then begin
    if BtnGetVisibility(PauseButton) then begin
      LabelTime1.Caption:=ExpandConstant('{cm:ElapsedTimeEn} ')+TimeStr2;
      LabelTime2.Caption:=ExpandConstant('{cm:RemainingTimeEn} ')+TimeStr1;
    end else begin
      LabelTime1.Caption:=ExpandConstant('{cm:ElapsedTimeEn}');
      LabelTime2.Caption:=ExpandConstant('{cm:RemainingTimeEn}');
    end;
  end else begin
 #endif
    if BtnGetVisibility(PauseButton) then begin
      LabelTime1.Caption:=ExpandConstant('{cm:ElapsedTime} ')+TimeStr2;
      LabelTime2.Caption:=ExpandConstant('{cm:RemainingTime} ')+TimeStr1;
    end else begin
      LabelTime1.Caption:=ExpandConstant('{cm:ElapsedTime}');
      LabelTime2.Caption:=ExpandConstant('{cm:RemainingTime}');
    end;
 #ifdef English
  end;
 #endif
  Result := ISDoneCancel;
end;

procedure ISDoneCancelButtonOnClick(hBtn:HWND);
begin
  ISDoneCancel:=1;
end;

procedure HideControls;
begin
  LabelPct1.Hide;
  LabelTime1.Hide;
  LabelTime2.Hide;
  BtnSetEnabled(CancelButton, False);
  ImgPBVisibility(ISDoneProgressBar1, False);
  BtnSetVisibility(PauseButton, False);
  BtnSetVisibility(ResumeButton, False);
 #ifdef English
  if BtnGetVisibility(RussianButton) then begin
    StatusLabel.Caption:=ExpandConstant('{cm:StatusLabel_2En}');
    BtnSetEnabled(RussianButton, False);
  end else begin
 #endif
    StatusLabel.Caption:=ExpandConstant('{cm:StatusLabel_2}');
 #ifdef English
    BtnSetEnabled(EnglishButton, False);
  end;
 #endif
#ifdef SocialNetwork
 BtnSetEnabled(SocialNetworkButton, False);
#endif
end;

//-------- Подключаем модуль смены языка
#ifdef English
 #Include "iss\ChangeLanguage.iss"
#endif
//--------------------------

//------- Пауза
// Отмена
procedure ISDoneCancelButtonOnClick2(hBtn:HWND);
begin
  ResumeProc;
  ISDoneCancel:=1;
end;

// Пауза
procedure PauseButtonOnClick(hBtn:HWND);
begin
  SuspendProc;                       
  BtnSetVisibility(PauseButton, False);
  BtnSetVisibility(ResumeButton, True);
  BtnSetEvent(CancelButton,BtnClickEventID,WrapBtnCallback(@ISDoneCancelButtonOnClick2,1));
 #ifdef English
  if BtnGetVisibility(RussianButton) then begin
    StatusLabel.Caption:=ExpandConstant('{cm:StatusLabel_4En}');
  end else begin
 #endif
    StatusLabel.Caption:=ExpandConstant('{cm:StatusLabel_4}');
 #ifdef English
  end;
 #endif
  ImgApplyChanges(WizardForm.Handle);
end;

// Продолжить
procedure ResumeButtonOnClick(hBtn:HWND);
begin
  ResumeProc;
  BtnSetVisibility(PauseButton, True);
  BtnSetVisibility(ResumeButton, False);
  BtnSetEvent(CancelButton,BtnClickEventID,WrapBtnCallback(@ISDoneCancelButtonOnClick,1));
 #ifdef English
  if BtnGetVisibility(RussianButton) then begin
    StatusLabel.Caption:=ExpandConstant('{cm:StatusLabel_1En}');
  end else begin
 #endif
    StatusLabel.Caption:=ExpandConstant('{cm:StatusLabel_1}');
 #ifdef English
  end;
 #endif
  ImgApplyChanges(WizardForm.Handle);
end;

//------- Форма выбора папки установки
procedure FolderTreeViewOnChange(Sender: TObject);
begin
  if FolderTreeView.Directory <> WizardForm.DirEdit.Text then
  DirEdit.Text:=AddBackslash(FolderTreeView.Directory) + '{#PathGameName}' else
  DirEdit.Text:=FolderTreeView.Directory;
end;

procedure SelectDirFormOKButtonOnClick(Sender: TObject);        
begin
  WizardForm.DirEdit.Text:=DirEdit.Text;
  DirEditLabel.Caption:=MinimizePathName(WizardForm.DirEdit.Text, DirEditLabel.Font, DirEditLabel.Width);
end;
                                                                        
procedure SelectDirFormNewFolderButtonOnClick(Sender: TObject);
begin
#ifdef English
 if BtnGetVisibility(RussianButton) then begin
  FolderTreeView.CreateNewDirectory(ExpandConstant('{cm:NewFolderEn}'));
 end else begin
#endif
  FolderTreeView.CreateNewDirectory(ExpandConstant('{cm:NewFolder}'));
#ifdef English
 end;
#endif
  DirEdit.Text := AddBackslash(FolderTreeView.Directory) + '{#PathGameName}';
end;

procedure BrowseButtonOnClick(hBtn:HWND);
begin
// Форма
 SelectDirForm:=CreateCustomForm;
  with SelectDirForm do begin
    SetBounds(ScaleX(0), ScaleY(0), ScaleX(355), ScaleY(365));
    Position:=poScreenCenter;
    Caption:=ExpandConstant('{cm:SelectDirForm}');
  end;

// Дерево дисков и папок
 FolderTreeView:=TFolderTreeView.Create(WizardForm);
  with FolderTreeView do begin
    SetBounds(ScaleX(16), ScaleY(64), ScaleX(317), ScaleY(229));
    Parent:=SelectDirForm;
    OnChange:=@FolderTreeViewOnChange;
  end;

// Эдит
  DirEdit:= TEdit.Create(WizardForm);
   with DirEdit do begin
    SetBounds(ScaleX(16), ScaleY(36), ScaleX(317), ScaleY(21));
    Text:=WizardForm.DirEdit.Text;
    Parent:=SelectDirForm;
  end;

// Лейблы
 SelectDirFormLabel:= TLabel.Create(WizardForm);
  with SelectDirFormLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(10), ScaleY(10), ScaleX(300), ScaleY(18));
    Transparent:=True;
    Font.Color:=clBlack;
    Font.Name:='Tahoma';
    Font.Size:=8;
    Caption:=ExpandConstant('{cm:SelectDirFormLabel}');
    Parent:=SelectDirForm;
  end;           

// Кнопки
 SelectDirFormOKButton:= TNewButton.Create(WizardForm);
  with SelectDirFormOKButton do begin
    SetBounds(ScaleX(181), ScaleY(305), ScaleX(75), ScaleY(23));
    Caption:=ExpandConstant('{cm:OKButton}');
    Parent:=SelectDirForm;
    OnClick:=@SelectDirFormOKButtonOnClick;
    ModalResult:=mrOk;
  end;

 SelectDirFormCancelButton:= TNewButton.Create(WizardForm);
  with SelectDirFormCancelButton do begin
    SetBounds(ScaleX(262), ScaleY(305), ScaleX(75), ScaleY(23));
    Caption :=ExpandConstant('{cm:CancelButton}');
    Parent:=SelectDirForm;
    ModalResult:=mrCancel;        
  end;
  
 SelectDirFormNewFolderButton:= TNewButton.Create(WizardForm);
  with SelectDirFormNewFolderButton do begin
    SetBounds(ScaleX(12), ScaleY(305), ScaleX(85), ScaleY(23));
    Caption :=ExpandConstant('{cm:NewFolder}');
    Parent:=SelectDirForm;
    OnClick:=@SelectDirFormNewFolderButtonOnClick;
  end;
  
 #ifdef English
  if BtnGetVisibility(RussianButton) then begin
    SelectDirForm.Caption:=ExpandConstant('{cm:SelectDirFormEn}');
    SelectDirFormLabel.Caption:=ExpandConstant('{cm:SelectDirFormLabelEn}');
    SelectDirFormCancelButton.Caption :=ExpandConstant('{cm:CancelButtonEn}');
    SelectDirFormNewFolderButton.Caption :=ExpandConstant('{cm:NewFolderEn}')
  end else begin
    SelectDirForm.Caption:=ExpandConstant('{cm:SelectDirForm}');
    SelectDirFormLabel.Caption:=ExpandConstant('{cm:SelectDirFormLabel}');
    SelectDirFormCancelButton.Caption :=ExpandConstant('{cm:CancelButton}');
    SelectDirFormNewFolderButton.Caption :=ExpandConstant('{cm:NewFolder}')
  end;
 #endif
  
  FolderTreeView.ChangeDirectory(AddBackslash(WizardForm.DirEdit.Text), True);
  SelectDirForm.ShowModal;
  SelectDirForm.Free;
end;

#ifdef SocialNetwork
//------- Интеграция с социальными сетями
procedure SocialNetworkFormOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  ReleaseCapture;
  SendMessage(SocialNetworkForm.Handle,$0112,$F012,0);
end;

procedure VKImageOnClick(Sender: TObject);
begin
  ShellExec('open', 'http://vk.com/share.php?url=http%3A%2F%2Fshidow.com&title={#SocialNetwork}&description=%20%D0%91%D0%BB%D0%BE%D0%B3%20%D1%8E%D0%B7%D0%B5%D1%80%D0%B0%20shidow', '', '', SW_SHOWNORMAL, ewNoWait, ResultCode);
  SocialNetworkForm.Close;
end;

procedure FacebookImageOnClick(Sender: TObject);
begin
  ShellExec('open', 'http://www.facebook.com/sharer/sharer.php?src=sp&u=http%3A%2F%2Fshidow.com', '', '', SW_SHOWNORMAL, ewNoWait, ResultCode);
  SocialNetworkForm.Close;
end;

procedure TwitterImageOnClick(Sender: TObject);
begin
  ShellExec('open', 'http://twitter.com/intent/tweet?status={#SocialNetwork}+http%3A%2F%2Fshidow.com', '', '', SW_SHOWNORMAL, ewNoWait, ResultCode);
  SocialNetworkForm.Close;
end;

procedure CloseSocialNetworkFormLabelOnClick(Sender: TObject);
begin
  SocialNetworkForm.Close;
end;

procedure SocialNetworkButtonOnClick(hBtn:HWND);
begin
// Форма
 SocialNetworkForm:=CreateCustomForm;
  with SocialNetworkForm do begin
    SetBounds(ScaleX(0), ScaleY(0), ScaleX(205), ScaleY(85));
    Position:=poScreenCenter;
    BorderStyle:=bsNone;
    OnMouseDown:=@SocialNetworkFormOnMouseDown;
  end;
  
 CloseSocialNetworkFormLabel:= TLabel.Create(nil);
  with CloseSocialNetworkFormLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(187), ScaleY(5), ScaleX(10), ScaleY(18));
    Transparent:=True;
    Font.Color:=clBlack;
    Font.Name:='Tahoma';
    Font.Size:=10;
    Caption:='X';
    Cursor:=crHand;
    Parent:=SocialNetworkForm;
    OnClick:=@CloseSocialNetworkFormLabelOnClick;
  end;
  
 SocialNetworkFormLabel:= TLabel.Create(nil);
  with SocialNetworkFormLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(10), ScaleY(10), ScaleX(150), ScaleY(18));
    Transparent:=True;
    Font.Color:=clBlack;
    Font.Name:='Tahoma';
    Font.Size:=8;
    Caption:=ExpandConstant('{cm:SocialNetworkFormLabel}');
    Parent:=SocialNetworkForm;
    OnMouseDown:=@SocialNetworkFormOnMouseDown;
  end;
  
// ВКонтакте                      
 VKImage:= TBitmapImage.Create(nil);
  with VKImage do begin
    SetBounds(ScaleX(40), ScaleY(35), ScaleX(35), ScaleY(35));
    Bitmap.LoadFromFile(ExpandConstant('{tmp}\vk.bmp'));
    Cursor:=crHand;
    Parent:=SocialNetworkForm;
    OnClick:=@VKImageOnClick;
  end;

// Facebook
  FacebookImage:= TBitmapImage.Create(nil);
  with FacebookImage do begin
    SetBounds(ScaleX(85), ScaleY(35), ScaleX(35), ScaleY(35));
    Bitmap.LoadFromFile(ExpandConstant('{tmp}\facebook.bmp'));
    Cursor:=crHand;
    Parent:=SocialNetworkForm;
    OnClick:=@FacebookImageOnClick;
  end;
                       
// Twitter
 TwitterImage:= TBitmapImage.Create(nil);
  with TwitterImage do begin
    SetBounds(ScaleX(130), ScaleY(35), ScaleX(35), ScaleY(35));
    Bitmap.LoadFromFile(ExpandConstant('{tmp}\twitter.bmp'));
    Cursor:=crHand;
    Parent:=SocialNetworkForm;
    OnClick:=@TwitterImageOnClick;
  end;
  
 #ifdef English
 #ifdef Autorun
  if BtnGetVisibility(RussianButton) or BtnGetVisibility(RussianAutorunButton) then begin
 #else
  if BtnGetVisibility(RussianButton) then begin
 #endif
    SocialNetworkFormLabel.Caption:=ExpandConstant('{cm:SocialNetworkFormLabelEn}');
  end else begin
    SocialNetworkFormLabel.Caption:=ExpandConstant('{cm:SocialNetworkFormLabel}');
  end;
 #endif
  
  SetClassLong(SocialNetworkForm.Handle, (-26), GetWindowLong(SocialNetworkForm.Handle, (-26)) or $00020000);
  SocialNetworkForm.ShowModal;
  SocialNetworkForm.Free;
end;
#endif

//------- Шрифт для кнопок
procedure ButtonFontCreate;
begin
 ButtonFont:=TFont.Create;
  with ButtonFont do begin
    Size:=12;
    Name:='{#FontName}';
  end;
end;

//-------- Подключаем Autorun
#ifdef Autorun
 #include "iss\Autorun.iss"
#endif
//--------

function InitializeSetup:boolean;
begin
  ButtonFontCreate
 #ifdef MD5_1
  MD5Check;
 #endif
  if not FileExists(ExpandConstant('{tmp}\WinTB.dll')) then ExtractTemporaryFile('WinTB.dll');
 #ifdef SocialNetwork
  if not FileExists(ExpandConstant('{tmp}\vk.bmp')) then ExtractTemporaryFile('vk.bmp');
  if not FileExists(ExpandConstant('{tmp}\facebook.bmp')) then ExtractTemporaryFile('facebook.bmp');
  if not FileExists(ExpandConstant('{tmp}\twitter.bmp')) then ExtractTemporaryFile('twitter.bmp');
 #endif
  if not FileExists(ExpandConstant('{tmp}\b2p.dll')) then ExtractTemporaryFile('b2p.dll');
  if not FileExists(ExpandConstant('{tmp}\botva2.dll')) then ExtractTemporaryFile('botva2.dll');
  if not FileExists(ExpandConstant('{tmp}\CallbackCtrl.dll')) then ExtractTemporaryFile('CallbackCtrl.dll');
 #ifdef MD5_1
 #ifdef Autorun
  if MD5Error = True then begin
    if MsgBox(ExpandConstant('{cm:MD5Error}'), mbError, MB_YESNO) = IDYES then Result:=AutorunCreate else Result:=False;
  end else begin
    Result:=AutorunCreate;
  end;
 #else
  if MD5Error = True then begin
    if MsgBox(ExpandConstant('{cm:MD5Error}'), mbError, MB_YESNO) = IDYES then Result:=True else Result:=False;
  end else begin
    Result:=True;
  end;
 #endif
 #else
 #ifdef Autorun
    Result:=AutorunCreate;
 #else
    Result:=True;
 #endif
 #endif
end;

procedure InitializeWizard;
begin
  
  with WizardForm do begin
    Width:=ScaleX(666);   // Ширина
    Height:=ScaleY(370);  // Высота
    Position:=poScreenCenter; // Выравниваем инсталлятор по центру монитора
    BorderStyle:=bsNone;
    CancelButton.SetBounds(ScaleX(0), ScaleY(0), ScaleX(0), ScaleY(0));
    NextButton.SetBounds(ScaleX(0), ScaleY(0), ScaleX(0), ScaleY(0));
    BackButton.SetBounds(ScaleX(0), ScaleY(0), ScaleX(0), ScaleY(0));
    OnMouseDown:=@WizardFormOnMouseDown;
    OnMouseMove:=@WizardFormOnMouseMove;
    InnerNotebook.Hide;
    OuterNotebook.Hide;
    Bevel.Hide;
  end;
  
//------- Извлекаем файлы в Temp
  ExtractTemporaryFile('background.bmp');
 #ifdef Autorun
  ExtractTemporaryFile('background-autorun.bmp');
 #endif
 #ifdef English
  ExtractTemporaryFile('russian.ini');
  ExtractTemporaryFile('english.ini');
 #endif

  TaskBarV11(WizardForm.Handle);
  SetClassLong(WizardForm.Handle, (-26), GetWindowLong(WizardForm.Handle, (-26)) or $00020000);

//------- Лейблы
 CloseLabel:= TLabel.Create(WizardForm);
  with CloseLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(640), ScaleY(7), ScaleX(20), ScaleY(20));
    Transparent:=True;
    Font.Color:={#FontColor};
    Font.Name:='{#FontName}';
    Font.Size:= 16;
    Font.Style:=[fsBold];
    Caption:='X';
    Cursor:=crHand;
    Parent:=WizardForm;
    OnClick:=@CloseLabelOnClick;
    OnMouseMove:=@CloseLabelOnMouseMove;
  end;
  
// WelcomePage
WelcomeLabel1:= TLabel.Create(WizardForm);
  with WelcomeLabel1 do begin
    AutoSize:=False;
    SetBounds(ScaleX(100), ScaleY(100), ScaleX(510), ScaleY(40));
    Transparent:=True;
    Font.Color:={#FontColor};
    Font.Name:='{#FontName}';
    Font.Size:= 13;
    Font.Style:=[fsBold];
    Caption:=ExpandConstant('{cm:WelcomeLabel1} ') + '«{#GameName}»';
    Parent:=WizardForm;
    OnMouseDown:=@WizardFormOnMouseDown;
  end;

// Посчитаем количество символов
  if Length(WelcomeLabel1.Caption) <= 55 then begin
    WelcomeLabel1.Caption:=ExpandConstant('{cm:WelcomeLabel1} ') + '«{#GameName}»';
  end else begin
    WelcomeLabel1.Caption:=ExpandConstant('{cm:WelcomeLabel1} ') + #13 + '«{#GameName}»';
  end;

 WelcomeLabel2:= TLabel.Create(WizardForm);
  with WelcomeLabel2 do begin
    AutoSize:=False;
    WordWrap:=True;
    SetBounds(ScaleX(100), ScaleY(160), ScaleX(490), ScaleY(120));
    Transparent:=True;
    Font.Color:={#FontColor};
    Font.Name:='{#FontName}';
    Font.Size:= 11;
    Caption:=ExpandConstant('{cm:WelcomeLabel2}');
    Parent:=WizardForm;
    OnMouseDown:=@WizardFormOnMouseDown;
  end;
  
// SelectDirPage
 DirEditLabel:= TLabel.Create(WizardForm);
  with DirEditLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(110), ScaleY(114), ScaleX(350), ScaleY(16));
    Transparent:=True;
    Font.Color:={#FontColor};
    Font.Name:='{#FontName}';
    Font.Size:=12;
    Caption:=MinimizePathName(WizardForm.DirEdit.Text, DirEditLabel.Font, DirEditLabel.Width);
    Parent:=WizardForm;
    OnMouseDown:=@WizardFormOnMouseDown;
  end;
  
 SelectDirLabel1:= TLabel.Create(WizardForm);
  with SelectDirLabel1 do begin
    AutoSize:=False;
    SetBounds(ScaleX(110), ScaleY(70), ScaleX(500), ScaleY(36));
    Transparent:=True;
    Font.Color:={#FontColor};
    Font.Name:='{#FontName}';
    Font.Size:= 12;
    Caption:=ExpandConstant('{cm:SelectDirLabel1}');
    Parent:=WizardForm;
    OnMouseDown:=@WizardFormOnMouseDown;
  end;
  
 SelectDirLabel2:= TLabel.Create(WizardForm);
  with SelectDirLabel2 do begin
    AutoSize:=False;
    SetBounds(ScaleX(100), ScaleY(290), ScaleX(450), ScaleY(18));
    Transparent:=True;
    Font.Color:={#FontColor};
    Font.Name:='{#FontName}';
    Font.Size:=12;
    Caption:=ExpandConstant('{cm:SelectDirLabel2_1}') + MbOrTb({#NeedSize}) + ExpandConstant(' {cm:SelectDirLabel2_2} ');
    Parent:=WizardForm;
    OnMouseDown:=@WizardFormOnMouseDown;
  end;
  
// InstallingPage
 StatusLabel:= TLabel.Create(WizardForm);
  with StatusLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(100), ScaleY(130), ScaleX(450), ScaleY(18));
    Transparent:=True;
    Font.Color:={#FontColor};
    Font.Name:='{#FontName}';
    Font.Size:=10;
    Caption:=ExpandConstant('{cm:StatusLabel_1}');
    Parent:=WizardForm;
    OnMouseDown:=@WizardFormOnMouseDown;
  end;
                             
// FinishedPage
 FinishedLabel1:= TLabel.Create(WizardForm);
  with FinishedLabel1 do begin
    AutoSize:=False;
    SetBounds(ScaleX(100), ScaleY(100), ScaleX(510), ScaleY(40));
    Transparent:=True;
    Font.Color:={#FontColor};
    Font.Name:='{#FontName}';
    Font.Size:=13;
    Font.Style:=[fsBold];
    Caption:=ExpandConstant('{cm:FinishedLabel1} ') + '«{#GameName}»';
    Parent:=WizardForm;
    OnMouseDown:=@WizardFormOnMouseDown;
  end;
  
  if Length(FinishedLabel1.Caption) <= 55 then begin
    FinishedLabel1.Caption:=ExpandConstant('{cm:FinishedLabel1} ') + '«{#GameName}»';
  end else begin
    FinishedLabel1.Caption:=ExpandConstant('{cm:FinishedLabel1}') + #13 + '«{#GameName}»';
  end;

 FinishedLabel2:= TLabel.Create(WizardForm);
  with FinishedLabel2 do begin
    AutoSize:=False;
    WordWrap:=True;
    SetBounds(ScaleX(100), ScaleY(160), ScaleX(490), ScaleY(120));
    Transparent:=True;
    Font.Color:={#FontColor};
    Font.Name:='{#FontName}';
    Font.Size:=11;
    Caption:=ExpandConstant('{cm:FinishedLabel2}');
    Parent:=WizardForm;
    OnMouseDown:=@WizardFormOnMouseDown;
  end;

//------- Таск лист
 with WizardForm.TasksList do begin
    SetBounds(ScaleX(100), ScaleY(142), ScaleX(170), ScaleY(145));
    Font.Color:={#FontColor};
    Font.Name:='MS Sans Serif';
    BorderStyle:=bsNone;
    WantTabs:=False;
    MinItemHeight:=0;
    LoadBGBmpFromFile(ExpandConstant('{tmp}\background.bmp'), WizardForm.TasksList.Left, WizardForm.TasksList.Top);
    Parent:=WizardForm;
    OnMouseDown:=@WizardFormOnMouseDown;
  end;

//------- Компонент лист
#ifdef Comp1Ru
  with WizardForm.ComponentsList do begin
    SetBounds(ScaleX(350), ScaleY(142), ScaleX(170), ScaleY(145));
    Font.Color:={#FontColor};
    Font.Name:='MS Sans Serif';
    BorderStyle:=bsNone;
    MinItemHeight:=0;
    LoadBGBmpFromFile(ExpandConstant('{tmp}\background.bmp'), WizardForm.ComponentsList.Left, WizardForm.ComponentsList.Top);
    Parent:=WizardForm;
    OnMouseDown:=@WizardFormOnMouseDown;
  end;
#endif

//------- Эдит
  WizardForm.DirEdit.OnChange:=@GetFreeSpaceCaption;
  WizardForm.DirEdit.Text:=WizardForm.DirEdit.Text + #0;
  
//------- Картинки
// Фон
  BackgroundImg:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\background.bmp'), ScaleX(0), ScaleY(0), ScaleX(666), ScaleY(370) ,True,True);
// Рамка
  DirEditImg:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\edit.png'), ScaleX(100), ScaleY(110), ScaleX(370), ScaleY(24) ,True,True);
// Прогессбар
//------- Кнопки
// Отмена
  CancelButton:=BtnCreate(WizardForm.Handle, ScaleX(515), ScaleY(320), ScaleX(105), ScaleY(44), ExpandConstant('{tmp}\button.png'),1,False);
  BtnSetEvent(CancelButton,BtnClickEventID,WrapBtnCallback(@CancelButtonOnClick,1));
  BtnSetText(CancelButton, ExpandConstant('{cm:CancelButton}'));
  BtnSetFont(CancelButton, ButtonFont.Handle);
  BtnSetFontColor(CancelButton, {#ButtonColor}, {#ButtonColor}, {#ButtonColor}, {#ButtonColor});
// Далее
  NextButton:=BtnCreate(WizardForm.Handle, ScaleX(415), ScaleY(320), ScaleX(105), ScaleY(44), ExpandConstant('{tmp}\button.png'),1,False);
  BtnSetEvent(NextButton,BtnClickEventID,WrapBtnCallback(@NextButtonOnClick,1));
  BtnSetFont(NextButton, ButtonFont.Handle);
  BtnSetFontColor(NextButton, {#ButtonColor}, {#ButtonColor}, {#ButtonColor}, {#ButtonColor});
// Назад
  BackButton:=BtnCreate(WizardForm.Handle, ScaleX(320), ScaleY(320), ScaleX(105), ScaleY(44), ExpandConstant('{tmp}\button.png'),1,False);
  BtnSetEvent(BackButton,BtnClickEventID,WrapBtnCallback(@BackButtonOnClick,1));
  BtnSetText(BackButton, ExpandConstant('{cm:BackButton}'));
  BtnSetFont(BackButton, ButtonFont.Handle);
  BtnSetFontColor(BackButton, {#ButtonColor}, {#ButtonColor}, {#ButtonColor}, {#ButtonColor});
// Обзор
  BrowseButton:=BtnCreate(WizardForm.Handle, ScaleX(469), ScaleY(100), ScaleX(105), ScaleY(43), ExpandConstant('{tmp}\button.png'),1,False);
  BtnSetEvent(BrowseButton,BtnClickEventID,WrapBtnCallback(@BrowseButtonOnClick,1));
  BtnSetText(BrowseButton, ExpandConstant('{cm:BrowseButton}'));
  BtnSetFont(BrowseButton, ButtonFont.Handle);
  BtnSetFontColor(BrowseButton, {#ButtonColor}, {#ButtonColor}, {#ButtonColor}, {#ButtonColor});
// Пауза
  PauseButton:=BtnCreate(WizardForm.Handle, ScaleX(415), ScaleY(320), ScaleX(105), ScaleY(44), ExpandConstant('{tmp}\button.png'),1,False);
  BtnSetEvent(PauseButton,BtnClickEventID,WrapBtnCallback(@PauseButtonOnClick,1));
  BtnSetText(PauseButton, ExpandConstant('{cm:PauseButton}'));
  BtnSetFont(PauseButton, ButtonFont.Handle);
  BtnSetFontColor(PauseButton, {#ButtonColor}, {#ButtonColor}, {#ButtonColor}, {#ButtonColor});
// Продолжить
  ResumeButton:=BtnCreate(WizardForm.Handle, ScaleX(415), ScaleY(320), ScaleX(105), ScaleY(44), ExpandConstant('{tmp}\button.png'),1,False);
  BtnSetEvent(ResumeButton,BtnClickEventID,WrapBtnCallback(@ResumeButtonOnClick,1));
  BtnSetText(ResumeButton, ExpandConstant('{cm:ResumeButton}'));
  BtnSetFont(ResumeButton, ButtonFont.Handle);
  BtnSetVisibility(ResumeButton, False);
  BtnSetFontColor(ResumeButton, {#ButtonColor}, {#ButtonColor}, {#ButtonColor}, {#ButtonColor});
// Social Network
#ifdef SocialNetwork
#ifdef English
  SocialNetworkButton:=BtnCreate(WizardForm.Handle, ScaleX(153), ScaleY(320), ScaleX(25), ScaleY(44), ExpandConstant('{tmp}\button.png'),1,False);
#else
   SocialNetworkButton:=BtnCreate(WizardForm.Handle, ScaleX(53), ScaleY(320), ScaleX(25), ScaleY(44), ExpandConstant('{tmp}\button.png'),1,False);
#endif
  BtnSetEvent(SocialNetworkButton,BtnClickEventID,WrapBtnCallback(@SocialNetworkButtonOnClick,1));
  BtnSetText(SocialNetworkButton, 'S');
  BtnSetFont(SocialNetworkButton, ButtonFont.Handle);
  BtnSetFontColor(SocialNetworkButton, {#ButtonColor}, {#ButtonColor}, {#ButtonColor}, {#ButtonColor});
#endif
//--- Кнопки смены языков
#ifdef English
// English
  EnglishButton:=BtnCreate(WizardForm.Handle, ScaleX(53), ScaleY(320), ScaleX(105), ScaleY(44), ExpandConstant('{tmp}\button.png'),1,False);
  BtnSetEvent(EnglishButton,BtnClickEventID,WrapBtnCallback(@EnglishButtonOnClick,1));
  BtnSetText(EnglishButton, ExpandConstant('{cm:EnglishButton}'));
  BtnSetFont(EnglishButton, ButtonFont.Handle);
  BtnSetFontColor(EnglishButton, {#ButtonColor}, {#ButtonColor}, {#ButtonColor}, {#ButtonColor});
// Русский
  RussianButton:=BtnCreate(WizardForm.Handle, ScaleX(53), ScaleY(320), ScaleX(105), ScaleY(44), ExpandConstant('{tmp}\button.png'),1,False);
  BtnSetEvent(RussianButton,BtnClickEventID,WrapBtnCallback(@RussianButtonOnClick,1));
  BtnSetText(RussianButton, ExpandConstant('{cm:RussianButton}'));
  BtnSetFont(RussianButton, ButtonFont.Handle);
  BtnSetVisibility(RussianButton, False);
  BtnSetFontColor(RussianButton, {#ButtonColor}, {#ButtonColor}, {#ButtonColor}, {#ButtonColor});
#endif
  ImgApplyChanges(WizardForm.Handle);

#ifdef English
#ifdef Autorun
  if Language='english' then begin
    EnglishLanguage;
    WizardFormChangeLanguage;
  end;
#endif
#endif
end;

procedure CreateControls;
begin
 ISDoneProgressBar1:=ImgPBCreate(WizardForm.Handle, ExpandConstant('{tmp}\ProgressBackground.png'), ExpandConstant('{tmp}\ProgressImg.png'), ScaleX(100), ScaleY(150), ScaleX(466), ScaleY(23));
  
 LabelPct1 := TLabel.Create(WizardForm);
  with LabelPct1 do begin
    AutoSize:=False;
    Alignment:=taCenter;
    SetBounds(ScaleX(0), ScaleY(120), ScaleX(666), ScaleY(20));
    Font.Color:={#FontColor};
    Font.Name:='{#FontName}';
    Font.Size:=15;
    Font.Style:=[fsBold];
    Transparent:=True;
    Parent:=WizardForm;
    OnMouseDown:=@WizardFormOnMouseDown;
  end;
  
 LabelTime1 := TLabel.Create(WizardForm);
  with LabelTime1 do begin
    AutoSize:=False;
    SetBounds(ScaleX(100), ScaleY(180), ScaleX(280), ScaleY(18));
    Font.Color:={#FontColor};
    Font.Name:='{#FontName}';
    Font.Size:=10;
    Transparent:=True;
    Parent:=WizardForm;
    OnMouseDown:=@WizardFormOnMouseDown;
  end;
  
 LabelTime2 := TLabel.Create(WizardForm);
  with LabelTime2 do begin
    AutoSize:=False;
    SetBounds(ScaleX(100), ScaleY(200), ScaleX(280), ScaleY(18));
    Font.Color:={#FontColor};
    Font.Name:='{#FontName}';
    Font.Size:=10;
    Transparent:=True;
    Parent:=WizardForm;
    OnMouseDown:=@WizardFormOnMouseDown;
  end;
end;

procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
  Confirm := False;
end;

//-------- Проверка, есть ли русские буквы в пути установки
#ifdef RusLetters
function NextButtonClick(CurPageID: Integer): Boolean;
var
 S1: string;
 S2: string;
begin
  Result:= False;
  S1 := AnsiUppercase(WizardForm.DirEdit.Text);
  S2 := Uppercase(WizardForm.DirEdit.Text);
  if CompareStr(S1, S2) = 0 then begin
    S1 := Lowercase(WizardForm.DirEdit.Text);
    S2 := AnsiLowercase(WizardForm.DirEdit.Text);
    if CompareStr(S1, S2) = 0 then begin
      Result:= True;
      Exit;
    end;
  end;
 #ifdef English
  if BtnGetVisibility(RussianButton) then begin
    MessageBox(WizardForm.Handle, ExpandConstant('{cm:RusLettersEn}'), ExpandConstant('{cm:RusLetters_headerEn}'), MB_OK or $30);
  end else begin
 #endif
   MessageBox(WizardForm.Handle, ExpandConstant('{cm:RusLetters}'), ExpandConstant('{cm:RusLetters_header}'), MB_OK or $30);
 #ifdef English
  end
 #endif
end;                                                    
#endif

//-------- Пропуск страниц
function ShouldSkipPage(PageID: Integer): Boolean;
begin
  if (PageID = wpSelectDir) or (PageID = wpSelectComponents) or (PageID = wpSelectProgramGroup) or (PageID = wpReady) then
  Result:= True;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
  if CurPageID = wpWelcome then begin
    WelcomeLabel1.Visible:=True;
    WelcomeLabel2.Visible:=True;
    BtnSetEnabled(NextButton, True);
    BtnSetVisibility(BackButton, False);
    BtnSetText(NextButton, ExpandConstant('{cm:NextButton}'));
  end else begin
    WelcomeLabel1.Visible:=False;
    WelcomeLabel2.Visible:=False;
    BtnSetVisibility(BackButton, True);
  end;
  if CurPageID = wpSelectTasks then begin            
    GetFreeSpaceCaption(nil);
    WizardForm.ComponentsList.Visible:=True;
    WizardForm.TasksList.Visible:=True;
    DirEditLabel.Visible:=True;
    SelectDirLabel1.Visible:=True;
    SelectDirLabel2.Visible:=True;
    ImgSetVisibility(DirEditImg, True);
    BtnSetVisibility(BrowseButton, True);
    BtnSetText(NextButton, ExpandConstant('{cm:InstallButton}'));
  end else begin
    WizardForm.ComponentsList.Visible:=False;
    WizardForm.TasksList.Visible:=False;
    DirEditLabel.Visible:=False;
    SelectDirLabel1.Visible:=False;
    SelectDirLabel2.Visible:=False;
    ImgSetVisibility(DirEditImg, False);
    BtnSetVisibility(BrowseButton, False);
  end;
  if CurPageID = wpInstalling then begin
    StatusLabel.Visible:=True;
    CloseLabel.Enabled:=False;
    BtnSetVisibility(PauseButton, True);
    BtnSetVisibility(NextButton, False);
    BtnSetVisibility(BackButton, False);
    ImgPBVisibility(ISDoneProgressBar1, true);
    BtnSetEvent(CancelButton,BtnClickEventID,WrapBtnCallback(@ISDoneCancelButtonOnClick,1));
  end else begin
    StatusLabel.Visible:=False;
    BtnSetVisibility(PauseButton, False);
  end;
  if CurPageID = wpFinished then begin
    CloseLabel.Enabled:=False;
    FinishedLabel1.Visible:=True;
    FinishedLabel2.Visible:=True;
    BtnSetVisibility(CancelButton, False);
    BtnSetVisibility(BackButton, False);
    BtnSetVisibility(NextButton, True);
    BtnSetText(NextButton, ExpandConstant('{cm:FinishButton}'));
   #ifdef SocialNetwork
    BtnSetEnabled(SocialNetworkButton, True);
   #endif
  end else begin
    FinishedLabel1.Visible:=False;
    FinishedLabel2.Visible:=False;
  end;
  if (CurPageID = wpFinished) and ISDoneError then begin
    FinishedLabel2.Font.Color:=clRed;                        
    FinishedLabel2.Caption:=ExpandConstant('{cm:FinishedLabel2_error} ') + '«{#GameName}»';
  end;
 #ifdef English
  WizardFormChangeLanguage();
 #endif
  ImgApplyChanges(WizardForm.Handle);
end;

procedure DeinitializeSetup;
begin
  ButtonFont.Free;
  gdipShutDown;
end;

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

procedure CurStepChanged(CurStep: TSetupStep);
var Comps1,Comps2,Comps3, TmpValue:cardinal;
    FindHandle1,ColFiles1,CurIndex1,tmp:integer;
    ExecError:boolean;
    InFilePath,OutFilePath,OutFileName:PAnsiChar;
begin
  if CurStep = ssInstall then begin  //Если необходимо, можно поменять на ssPostInstall
    WizardForm.ProgressGauge.Hide;
    WizardForm.CancelButton.Hide;
    CreateControls;
    ISDoneCancel:=0;

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

ExtractTemporaryFile('unarc.dll');

#ifdef PrecompInside

ExtractTemporaryFile('CLS-precomp.dll');
ExtractTemporaryFile('packjpg_dll.dll');
ExtractTemporaryFile('packjpg_dll1.dll');
ExtractTemporaryFile('precomp.exe');
ExtractTemporaryFile('zlib1.dll');
#endif
#ifdef SrepInside
ExtractTemporaryFile('CLS-srep.dll');
#endif
#ifdef MSCInside
ExtractTemporaryFile('CLS-MSC.dll');
#endif
#ifdef facompress
    ExtractTemporaryFile('facompress.dll'); //ускоряет распаковку .arc архивов.
#endif
#ifdef records
    ExtractTemporaryFile('records.inf');
#endif
#ifdef precomp
  #if precomp == "0.38"
    ExtractTemporaryFile('precomp038.exe');
  #else
    #if precomp == "0.4"
      ExtractTemporaryFile('precomp040.exe');
    #else
      #if precomp == "0.41"
        ExtractTemporaryFile('precomp041.exe');
      #else
        #if precomp == "0.42"
          ExtractTemporaryFile('precomp042.exe');
        #else
          ExtractTemporaryFile('precomp038.exe');
          ExtractTemporaryFile('precomp040.exe');
          ExtractTemporaryFile('precomp041.exe');
          ExtractTemporaryFile('precomp042.exe');
        #endif
      #endif
    #endif
  #endif
#endif
#ifdef unrar
    ExtractTemporaryFile('Unrar.dll');
#endif
#ifdef XDelta
    ExtractTemporaryFile('XDelta3.dll');
#endif
#ifdef PackZIP
    ExtractTemporaryFile('7z.dll');
    ExtractTemporaryFile('PackZIP.exe');
#endif

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

#ifdef precomp
  PCFVer:={#precomp};
#else
  PCFVer:=0;
#endif
    ISDoneError:=true;
    if ISDoneInit(ExpandConstant('{src}\records.inf'), $F777, Comps1,Comps2,Comps3, MainForm.Handle, 0, @ProgressCallback) then begin
      repeat
      
       #ifdef English
        if BtnGetVisibility(RussianButton) then begin
          ChangeLanguage('English');
        end;
       #endif
      
        if not SrepInit('',512,0) then break;
        if not PrecompInit('',128,PCFVer) then break;
        if not FileSearchInit(true) then break;
        if not ISArcExtract    ( 0, 0, ExpandConstant('{src}\Data.bin'), ExpandConstant('{app}\'), '', false, 'thieugiangoc', '', ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
       
//    далее находятся закомментированые примеры различных функций распаковки (чтобы каждый раз не лазить в справку за примерами)
(*
        if not ISArcExtract    ( 0, 0, ExpandConstant('{src}\arc.arc'), ExpandConstant('{app}\'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
        if not IS7ZipExtract   ( 0, 0, ExpandConstant('{src}\CODMW2.7z'), ExpandConstant('{app}\data1'), false, '') then break;
        if not ISRarExtract    ( 0, 0, ExpandConstant('{src}\data_*.rar'), ExpandConstant('{app}'), false, '') then break;
        if not ISSRepExtract   ( 0, 0, ExpandConstant('{app}\data1024_1024.srep'),ExpandConstant('{app}\data1024.arc'), true) then break;
        if not ISPrecompExtract( 0, 0, ExpandConstant('{app}\data.pcf'),    ExpandConstant('{app}\data.7z'), true) then break;
        if not ISxDeltaExtract ( 0, 0, 0, 640, ExpandConstant('{app}\in.pcf'), ExpandConstant('{app}\*.diff'),   ExpandConstant('{app}\out.dat'), false, false) then break;
        if not ISPackZIP       ( 0, 0, ExpandConstant('{app}\1a1\*'), ExpandConstant('{app}\1a1.pak'), 2, false ) then break;
        if not ISExec          ( 0, 0, 0, ExpandConstant('{tmp}\Arc.exe'), ExpandConstant('x -o+ "{src}\001.arc" "{app}\"'), ExpandConstant('{tmp}'), '...',false) then break;
        if not ShowChangeDiskWindow ('Пожалуйста, вставьте второй диск и дождитесь его инициализации.', ExpandConstant('{src}'),'CODMW_2.arc') then break;

//    распаковка группы файлов посредством внешнего приложения

        FindHandle1:=ISFindFiles(0,ExpandConstant('{app}\*.ogg'),ColFiles1);
        ExecError:=false;
        while not ExecError and ISPickFilename(FindHandle1,ExpandConstant('{app}\'),CurIndex1,true) do begin
          InFilePath:=ISGetName(0);
          OutFilePath:=ISGetName(1);
          OutFileName:=ISGetName(2);
          ExecError:=not ISExec(0, 0, 0, ExpandConstant('{tmp}\oggdec.exe'), '"'+InFilePath+'" -w "'+OutFilePath+'"',ExpandConstant('{tmp}'),OutFileName,false);
        end;
        ISFindFree(FindHandle1);
        if ExecError then break;
*)

        ISDoneError:=false;
      until true;
      ISDoneStop;
    end;
    HideControls;
    WizardForm.CancelButton.Visible:=true;
    WizardForm.CancelButton.Enabled:=false;
    ImgApplyChanges(WizardForm.Handle);
  end;
  if (CurStep=ssPostInstall) and ISDoneError then begin
    Exec2(ExpandConstant('{uninstallexe}'), '/VERYSILENT', false);
  end;
end;

[ISFormDesigner]
WizardForm=FF0A005457495A415244464F524D0030109D01000054504630F10B5457697A617264466F726D0A57697A617264466F726D0C436C69656E744865696768740368010B436C69656E74576964746803F1010C4578706C696369744C65667402000B4578706C69636974546F7002000D4578706C6963697457696474680301020E4578706C69636974486569676874038E010D506978656C73506572496E636802600A54657874486569676874020D00F10C544E65774E6F7465626F6F6B0D4F757465724E6F7465626F6F6B00F110544E65774E6F7465626F6F6B506167650B57656C636F6D65506167650D4578706C69636974576964746803F1010E4578706C696369744865696768740339010000F110544E65774E6F7465626F6F6B5061676509496E6E6572506167650D4578706C69636974576964746803F1010E4578706C6963697448656967687403390100F10C544E65774E6F7465626F6F6B0D496E6E65724E6F7465626F6F6B00F110544E65774E6F7465626F6F6B506167650B4C6963656E7365506167650D4578706C69636974576964746803A1010E4578706C6963697448656967687403ED00000000000000

Last edited by GloverK1911; 23-02-2014 at 04:32.
Reply With Quote
  #971  
Old 24-02-2014, 08:52
reiji777's Avatar
reiji777 reiji777 is offline
Registered User
 
Join Date: May 2011
Location: Tokyo
Posts: 53
Thanks: 50
Thanked 3 Times in 3 Posts
reiji777 is on a distinguished road
how to make sure the game compatible with future updates?
is it randomly different on each game or is there a certain pattern to make it?
can someone gave me an example of 2 combined game registry lines for making a trilogy?
the last thing, for saved games like in the sims 3 all dlc how to create other directory in document?
sorry if too much to ask
thanks in advance

Last edited by reiji777; 24-02-2014 at 09:02.
Reply With Quote
  #972  
Old 24-02-2014, 17:55
pakrat2k2's Avatar
pakrat2k2 pakrat2k2 is offline
Moderator
 
Join Date: Apr 2005
Location: Canada
Posts: 7,209
Thanks: 3,040
Thanked 9,043 Times in 3,086 Posts
pakrat2k2 is on a distinguished road
open up inno & goto help there's detailed information on my documents etc already included with program.
Reply With Quote
  #973  
Old 26-02-2014, 18:52
danswano danswano is offline
Registered User
 
Join Date: Feb 2013
Location: Luxm
Posts: 314
Thanks: 218
Thanked 27 Times in 22 Posts
danswano is on a distinguished road
Hello everyone,
How do i create a file hash checking wizard (integrity check) before first installer page?
Reply With Quote
  #974  
Old 01-03-2014, 01:25
Razor12911's Avatar
Razor12911 Razor12911 is offline
Noob
 
Join Date: Jul 2012
Location: South Africa
Posts: 3,749
Thanks: 2,170
Thanked 11,206 Times in 2,307 Posts
Razor12911 is on a distinguished road
http://www.jrsoftware.org/ispphelp/i...funicodestring
Reply With Quote
The Following User Says Thank You to Razor12911 For This Useful Post:
danswano (01-03-2014)
  #975  
Old 01-03-2014, 04:44
danswano danswano is offline
Registered User
 
Join Date: Feb 2013
Location: Luxm
Posts: 314
Thanks: 218
Thanked 27 Times in 22 Posts
danswano is on a distinguished road
Thanks razor, how do i apply the code for ISDone and i need to create it as a small progress window with a progress bar with a skip button.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
INNO TROUBLESHOOT - Tutorials and Answers about INNO Setup REV0 Conversion Tutorials 129 21-05-2021 05:51
INNO TUTORIAL - Using Unicode and ANSI Versions of INNO Setup REV0 Conversion Tutorials 51 26-03-2015 06:57
Frequently Asked Questions Joe Forster/STA PC Games - Frequently Asked Questions 0 29-11-2005 09:48



All times are GMT -7. The time now is 00:45.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com