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
  #1  
Old 23-02-2014, 01:10
Razor12911's Avatar
Razor12911 Razor12911 is offline
Noob
 
Join Date: Jul 2012
Location: South Africa
Posts: 3,754
Thanks: 2,191
Thanked 11,222 Times in 2,312 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
Sponsored Links
  #2  
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
  #3  
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
  #4  
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
  #5  
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
  #6  
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
  #7  
Old 01-03-2014, 01:25
Razor12911's Avatar
Razor12911 Razor12911 is offline
Noob
 
Join Date: Jul 2012
Location: South Africa
Posts: 3,754
Thanks: 2,191
Thanked 11,222 Times in 2,312 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)
  #8  
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
  #9  
Old 02-03-2014, 08:12
Razor12911's Avatar
Razor12911 Razor12911 is offline
Noob
 
Join Date: Jul 2012
Location: South Africa
Posts: 3,754
Thanks: 2,191
Thanked 11,222 Times in 2,312 Posts
Razor12911 is on a distinguished road
oh, you mean something like the new R.G.Catalyst Script?
Reply With Quote
  #10  
Old 02-03-2014, 08:55
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
Yes and GOG.com as well.
Reply With Quote
  #11  
Old 02-03-2014, 09:10
Razor12911's Avatar
Razor12911 Razor12911 is offline
Noob
 
Join Date: Jul 2012
Location: South Africa
Posts: 3,754
Thanks: 2,191
Thanked 11,222 Times in 2,312 Posts
Razor12911 is on a distinguished road
hmm, no problem, will upload example.
Reply With Quote
  #12  
Old 02-03-2014, 09:11
Razor12911's Avatar
Razor12911 Razor12911 is offline
Noob
 
Join Date: Jul 2012
Location: South Africa
Posts: 3,754
Thanks: 2,191
Thanked 11,222 Times in 2,312 Posts
Razor12911 is on a distinguished road
ISMD5 Hash checker for Inno Setup
Attached Files
File Type: rar ISMD5_Example.rar (25.2 KB, 60 views)
Reply With Quote
The Following User Says Thank You to Razor12911 For This Useful Post:
danswano (02-03-2014)
  #13  
Old 02-03-2014, 09:16
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
Is it possible to use a single md5 hash to check multiple files?
In the example i see that i must set the hash for each archive.
Reply With Quote
  #14  
Old 02-03-2014, 09:31
Razor12911's Avatar
Razor12911 Razor12911 is offline
Noob
 
Join Date: Jul 2012
Location: South Africa
Posts: 3,754
Thanks: 2,191
Thanked 11,222 Times in 2,312 Posts
Razor12911 is on a distinguished road
not possible. you need to set md5 for each file.
Reply With Quote
  #15  
Old 02-03-2014, 09:36
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 make this checker part of the main exe itself, it's creating an another exe and when check finish it execute the setup.exe.
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 08:22.


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