Перейти из форума на сайт.

НовостиФайловые архивы
ПоискАктивные темыТоп лист
ПравилаКто в on-line?
Вход Забыли пароль? Первый раз на этом сайте? Регистрация
Компьютерный форум Ru.Board » Компьютеры » Программы » Inno Setup плюс внешние упаковщики

Модерирует : gyra, Maz

 Версия для печати • ПодписатьсяДобавить в закладки
На первую страницук этому сообщениюк последнему сообщению

Открыть новую тему     Написать ответ в эту тему

RKW



Newbie
Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору


Код:
 
#define AppRunningFile "{app}\HMM2PL.exe"
#define AppName "Герои меча и Магии 3"
#define AppVerName "Герои меча и Магии 3"
 
[Setup]
SourceDir=.
OutputDir=Setup
AppName={#AppName}
AppVerName={#AppVerName}
AllowNoIcons=yes
CreateUninstallRegKey=yes
Compression=none
FlatComponentsList=no
DefaultDirName={pf}\Герои меча и Магии 3
DefaultGroupName=Packers\Герои меча и Магии 3
DisableProgramGroupPage=yes
DiskSpanning=yes
DiskSliceSize=300000000
OutputBaseFilename=setup
WindowVisible=no
WindowShowCaption=no
WindowResizable=no
SolidCompression=yes
SlicesPerDisk=1
Uninstallable=yes
 
[Languages]
Name: "rus"; MessagesFile: "compiler:Languages\Russian.isl"
 
 
[Files]
Source: button.bmp; DestDir: {tmp}; Flags: dontcopy nocompression
Source: 1.bmp; DestDir: {tmp}; Flags: dontcopy nocompression
Source: 2.bmp; DestDir: {tmp}; Flags: dontcopy nocompression
Source: 3.bmp; DestDir: {tmp}; Flags: dontcopy nocompression
Source: 4.bmp; DestDir: {tmp}; Flags: dontcopy nocompression
Source: 5.bmp; DestDir: {tmp}; Flags: dontcopy nocompression
;Source: *.arc; DestDir: {app}; Flags:nocompression
Source: compiler:unarc.dll; DestDir: {tmp}; Flags: dontcopy deleteafterinstall
Source: compiler:InnoCallback.dll; DestDir: {tmp}; Flags: dontcopy
Source: compiler:Tiger.cjstyles; DestDir: {tmp}; Flags: dontcopy
Source: compiler:ISSkin.dll; DestDir: {app}; Flags: dontcopy
; ОТМЕТЬТЕ: Не используйте "Флажки: Проигнорировать версию" на любых общедоступных системных файлах
 
[UninstallDelete]
Type: filesandordirs; Name: "{app}"
 
[Icons]
Name: {group}\{#AppName}; Filename: "{app}\Heroes3.exe"; WorkingDir: "{app}"; Check: GroupIcons
Name: {commondesktop}\{#AppName}; Filename: "{app}\Heroes3.exe"; WorkingDir: "{app}"; Check: CreateIcons
Name: {group}\Удалить '{#AppName}'; Filename: {uninstallexe}; WorkingDir: {app}\Setup; Check: GroupIcons
 
[Run]
Filename: {app}\Data\precomp.exe; Parameters: "-o""h3ab_bmp.lod"" -r ""h3ab_bmp.pcf"""; WorkingDir: {app}\Data; StatusMsg: Восстанавливаются игровые архивы...; Flags: runhidden runasoriginaluser
Filename: {sys}\cmd.exe; WorkingDir: {app}\Data; Parameters: /C del /F /Q h3ab_bmp.pcf; Flags: runhidden runasoriginaluser
 
Filename: {app}\Data\precomp.exe; Parameters: "-o""H3ab_spr.lod"" -r ""H3ab_spr.pcf"""; WorkingDir: {app}\Data; StatusMsg: Восстанавливаются игровые архивы...; Flags: runhidden runasoriginaluser
Filename: {sys}\cmd.exe; WorkingDir: {app}\Data; Parameters: /C del /F /Q H3ab_spr.pcf; Flags: runhidden runasoriginaluser
 
Filename: {app}\Data\precomp.exe; Parameters: "-o""h3bitmap.lod"" -r ""h3bitmap.pcf"""; WorkingDir: {app}\Data; StatusMsg: Восстанавливаются игровые архивы...; Flags: runhidden runasoriginaluser
Filename: {sys}\cmd.exe; WorkingDir: {app}\Data; Parameters: /C del /F /Q h3bitmap.pcf; Flags: runhidden runasoriginaluser
 
Filename: {app}\Data\precomp.exe; Parameters: "-o""h3sprite.lod"" -r ""h3sprite.pcf"""; WorkingDir: {app}\Data; StatusMsg: Восстанавливаются игровые архивы...; Flags: runhidden runasoriginaluser
Filename: {sys}\cmd.exe; WorkingDir: {app}\Data; Parameters: /C del /F /Q h3sprite.pcf; Flags: runhidden runasoriginaluser
 
Filename: {sys}\cmd.exe; WorkingDir: {app}; Parameters: /C del /F /Q packjpg_dll.dll precomp.exe; Flags: runhidden runasoriginaluser
 
 
[CustomMessages]
rus.BUT=Установить
rus.SPACE=Доступно места на диске:
rus.SPACE1=Требуется места на диске:
rus.ArcBreak=Установка прервана!
rus.ExtractedInfo=Распаковано %1 Мб из %2 Мб
rus.StatusInfo=Файлов: %1%2, %3%% выполнено, осталось ждать %4
rus.ArcInfo=Архив %1 из %2, объём %3 из %5, %4%% обработано
rus.ArcFinish=Распаковано архивов: %1, получено файлов: %2 [%3]
rus.ArcTitle=Установка...
rus.ArcError=Распаковщик FreeArc вернул код ошибки: %1
rus.ArcFail=Установка не завершена!
rus.AllProgress=Общий прогресс установки: %1%%
rus.ArcBroken=Возможно, архив %1 повреждён%nили недостаточно места на диске назначения.
rus.Extracting=Распаковывается: %1
rus.taskbar=%1%%, подождите %2
rus.remains=Осталось ждать %1
rus.ending=завершение
rus.hour= часов
rus.min= мин
rus.sec= сек
 
 
[Registry]
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum; Flags: uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: string; ValueName: AppPath; ValueData: {app}\; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Show Intro; ValueData: $00000001; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Music Volume; ValueData: $00000005; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Sound Volume; ValueData: $00000005; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Last Music Volume; ValueData: $00000005; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Last Sound Volume; ValueData: $00000005; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Walk Speed; ValueData: $00000002; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Computer Walk Speed; ValueData: $00000003; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Show Route; ValueData: $00000001; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Move Reminder; ValueData: $00000001; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Quick Combat; ValueData: $00000000; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Video Subtitles; ValueData: $00000001; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Town Outlines; ValueData: $00000001; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Animate SpellBook; ValueData: $00000001; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Window Scroll Speed; ValueData: $00000001; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Bink Video; ValueData: $00000000; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Blackout Computer; ValueData: $00000000; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: First Time; ValueData: $00000000; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Test Decomp; ValueData: $00000000; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Test Read; ValueData: $00000000; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Test Blit; ValueData: $00000000; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: string; ValueName: Unique System ID; ValueData: VSM; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: string; ValueName: Network Default Name; ValueData: Игрок; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Autosave; ValueData: $00000001; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Show Combat Grid; ValueData: $00000000; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Show Combat Mouse Hex; ValueData: $00000000; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Combat Shade Level; ValueData: $00000000; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Combat Army Info Level; ValueData: $00000000; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Combat Auto Creatures; ValueData: $00000001; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Combat Auto Spells; ValueData: $00000001; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Combat Catapult; ValueData: $00000001; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Combat Ballista; ValueData: $00000001; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Combat First Aid Tent; ValueData: $00000001; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Combat Speed; ValueData: $00000000; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Main Game Show Menu; ValueData: $00000001; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Main Game X; ValueData: $0000000a; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Main Game Y; ValueData: $0000000a; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKLM; SubKey: SOFTWARE\Buka\3DO\Heroes of Might and Magic III Complete Platinum\1.0; ValueType: dword; ValueName: Main Game Full Screen; ValueData: $00000001; Flags: uninsdeletevalue uninsdeletekeyifempty
 
 
[Code]
const
    Archives = '{src}\*.arc';    // укажите расположение архивов FreeArc; для внешних файлов строку в [Files] добавлять необязательно
 
    PM_REMOVE = 1;
    CP_ACP = 0; CP_UTF8 = 65001;
    oneMb = 1048576;
 
  ButtonWidth = 80;
  ButtonHeight = 23;
 
  bidBack = 0;
  bidNext = 1;
  bidCancel = 2;
  bidDirBrowse = 3;
  bidGroupBrowse = 4;
 
type
#ifdef UNICODE  ; если у вас ошибка на этой строке, то установите препроцессор или исправьте скрипт для вашей версии Inno Setup
    #define A "W"
#else
    #define A "A"  ; точка входа в SetWindowText, {#A} меняется на A или W в зависимости от версии
    PAnsiChar = PChar;  // Required for Inno Setup 5.3.0 and higher. (требуется для Inno Setup версии 5.3.0 и ниже)
#endif
#if Ver < 84018176
    AnsiString = String; // There is no need for this line in Inno Setup 5.2.4 and above (для Inno Setup версий 5.2.4 и выше эта строка не нужна)
#endif
 
    TMyMsg = record
        hwnd: HWND;
        message: UINT;
        wParam: Longint;
        lParam: Longint;
        time: DWORD;
        pt: TPoint;
    end;
 
    TFreeArcCallback = function (what: PAnsiChar; int1, int2: Integer; str: PAnsiChar): Integer;
    TArc = record Path: string; OrigSize: Integer; Size: Extended; end;
 
var
  ButtonPanel: array [0..4] of TPanel;
  ButtonImage: array [0..4] of TBitmapImage;
  ButtonLabel: array [0..4] of TLabel;
  Icons, Group: TCheckBox;
  SelectDirLabel, SelectDirLabelBrowse, MyReady: TLabel;
  IconsLabel, GroupLabel: TLabel;
  PageNameLabel, PageNameLabel1, PageNameLabel2, PageNameLabel3, PageNameLabel4: TLabel;
  PageDescriptionLabel, PageDescriptionLabel1, PageDescriptionLabel2, PageDescriptionLabel3, PageDescriptionLabel4: TLabel;
  StatusLabel, FilenameLabel: TLabel;
  WelcomeLabel1, WelcomeLabel2,FinishedLabel, FinishedHeadingLabel: TLabel;
  NeedSize:Integer;
  FreeMB, TotalMB: Cardinal;
  NeedSpaceLabel,FreeSpaceLabel: TLabel;
  BmpFile: TBitmapImage;
  SelectStartMenuFolderLabel, SelectStartMenuFolderBrowseLabel, ReadyLabel, NoIconsLabel: TLabel;
  PageID,ResultCode: Integer;
  RunProgram: TCheckBox;
  RunProgramLabel: Tlabel;
  LicenseLabel1, LicenseAcceptedLabel, LicenseNotAcceptedLabel: Tlabel;
  ExtractFile: TLabel;
    lblExtractFileName: TLabel;
    btnCancelUnpacking: TButton;
    CancelCode, n, UnPackError, StartInstall: Integer;
    Arcs: array of TArc;
    msgError: string;
    lastMb: Integer;
    baseMb: Integer;
    totalUncompressedSize: Integer;             // total uncompressed size of archive data in mb
    LastTimerEvent: DWORD;
 
Function MultiByteToWideChar(CodePage: UINT; dwFlags: DWORD; lpMultiByteStr: string; cbMultiByte: integer; lpWideCharStr: string; cchWideChar: integer): longint; external 'MultiByteToWideChar@kernel32.dll stdcall';
Function WideCharToMultiByte(CodePage: UINT; dwFlags: DWORD; lpWideCharStr: string; cchWideChar: integer; lpMultiByteStr: string; cbMultiByte: integer; lpDefaultChar: integer; lpUsedDefaultChar: integer): longint; external 'WideCharToMultiByte@kernel32.dll stdcall';
 
function PeekMessage(var lpMsg: TMyMsg; hWnd: HWND; wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): BOOL; external 'PeekMessageA@user32.dll stdcall';
function TranslateMessage(const lpMsg: TMyMsg): BOOL; external 'TranslateMessage@user32.dll stdcall';
function DispatchMessage(const lpMsg: TMyMsg): Longint; external 'DispatchMessageA@user32.dll stdcall';
 
Function OemToChar(lpszSrc, lpszDst: AnsiString): longint; external 'OemToCharA@user32.dll stdcall';
function GetWindowLong(hWnd, nIndex: Integer): Longint; external 'GetWindowLongA@user32 stdcall delayload';
function SetWindowText(hWnd: Longint; lpString: String): Longint; external 'SetWindowText{#A}@user32 stdcall delayload';
 
function GetTickCount: DWord; external 'GetTickCount@kernel32';
function WrapFreeArcCallback (callback: TFreeArcCallback; paramcount: integer):longword; external 'wrapcallback@files:innocallback.dll stdcall';
function FreeArcExtract (callback: longword; cmd1,cmd2,cmd3,cmd4,cmd5,cmd6,cmd7,cmd8,cmd9,cmd10: PAnsiChar): integer; external 'FreeArcExtract@files:unarc.dll cdecl';
 
procedure AppProcessMessage;
var
    Msg: TMyMsg;
begin
    while PeekMessage(Msg, 0, 0, 0, PM_REMOVE) do begin
        TranslateMessage(Msg);
        DispatchMessage(Msg);
    end;
end;
 
// Перевод числа в строку с точностью 3 знака (%.3n) с округлением дробной части, если она есть
Function NumToStr(Float: Extended): String;
Begin
    Result:= Format('%.3n', [Float]); StringChange(Result, ',', '.');
    while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = '.')) and (Length(Result) > 1) do
        SetLength(Result, Length(Result)-1);
End;
 
function cm(Message: String): String; Begin Result:= ExpandConstant('{cm:'+ Message +'}') End;
 
Function Size64(Hi, Lo: Integer): Extended;
Begin
    Result:= Lo;
    if Lo<0 then Result:= Result + $7FFFFFFF + $7FFFFFFF + 2;
    for Hi:= Hi-1 Downto 0 do
        Result:= Result + $7FFFFFFF + $7FFFFFFF + 2;
End;
 
// Converts OEM encoded string into ANSI
// Преобразует OEM строку в ANSI кодировку
function OemToAnsiStr( strSource: AnsiString): AnsiString;
var
    nRet : longint;
begin
    SetLength( Result, Length( strSource ) );
    nRet:= OemToChar( strSource, Result );
end;
 
// Converts ANSI encoded string into UTF-8
// Преобразует строку из ANSI в UTF-8 кодировку
function AnsiToUtf8( strSource: string ): string;
var
    nRet : integer;
    WideCharBuf: string;
    MultiByteBuf: string;
begin
    strSource:= strSource + chr(0);
    SetLength( WideCharBuf, Length( strSource ) * 2 );
    SetLength( MultiByteBuf, Length( strSource ) * 2 );
 
    nRet:= MultiByteToWideChar( CP_ACP, 0, strSource, -1, WideCharBuf, Length(WideCharBuf) );
    nRet:= WideCharToMultiByte( CP_UTF8, 0, WideCharBuf, -1, MultiByteBuf, Length(MultiByteBuf), 0, 0);
 
    Result:= MultiByteBuf;
end;
 
// OnClick event function for btnCancel
procedure btnCancelUnpackingOnClick(Sender: TObject);
begin
    if MsgBox( SetupMessage( msgExitSetupMessage ), mbInformation, MB_YESNO ) = IDYES then
        CancelCode:= -127;
end;
 
var origsize: Integer;
// The callback function for getting info about FreeArc archive
function FreeArcInfoCallback (what: PAnsiChar; Mb, sizeArc: Integer; str: PAnsiChar): Integer;
begin
    if string(what)='origsize'    then origsize := Mb else
    if string(what)='compsize'    then                else
    if string(what)='total_files' then                else
    Result:= CancelCode;
end;
 
// Returns decompressed size of files in archive
function ArchiveOrigSize(arcname: string): Integer;
var
    callback: longword;
Begin
    callback:= WrapFreeArcCallback(@FreeArcInfoCallback,4);   //FreeArcInfoCallback has 4 arguments
    CancelCode:= 0;
    AppProcessMessage;
    try
        // Pass the specified arguments to 'unarc.dll'
        Result:= FreeArcExtract (callback, 'l', '--', AnsiToUtf8(arcname), '', '', '', '', '', '', '');
        if CancelCode < 0 then Result:= CancelCode;
        if Result >= 0 then Result:= origsize;
    except
        Result:= -63;  //    ArcFail
    end;
end;
 
// Scans the specified folders for archives and add them to list
function FindArcs(dir: string): Extended;
var
    FSR: TFindRec;
Begin
    Result:= 0;
    if FindFirst(ExpandConstant(dir), FSR) then begin
        try
            repeat
                // Skip everything but the folders
                if FSR.Attributes and FILE_ATTRIBUTE_DIRECTORY > 0 then CONTINUE;
                n:= GetArrayLength(Arcs);
                // Expand the folder list
                SetArrayLength(Arcs, n +1);
                Arcs[n].Path:= ExtractFilePath(ExpandConstant(dir)) + FSR.Name;
                Arcs[n].Size:= Size64(FSR.SizeHigh, FSR.SizeLow);
                Result:= Result + Arcs[n].Size;
                Arcs[n].OrigSize := ArchiveOrigSize(Arcs[n].Path)
                totalUncompressedSize := totalUncompressedSize + Arcs[n].OrigSize
            until not FindNext(FSR);
        finally
            FindClose(FSR);
        end;
    end;
End;
 
// Sets the TaskBar title
Procedure SetTaskBarTitle(Title: String); var h: Integer;
Begin
    h:= GetWindowLong(MainForm.Handle, -8); if h <> 0 then SetWindowText(h, Title);
End;
 
// Converts milliseconds to human-readable time
// Конвертирует милисекунды в человеко-читаемое изображение времени
Function TicksToTime(Ticks: DWord; h,m,s: String; detail: Boolean): String;
Begin
    if detail                               {hh:mm:ss format} then
        Result:= PADZ(IntToStr(Ticks/3600000), 2) +':'+ PADZ(IntToStr((Ticks/1000 - Ticks/1000/3600*3600)/60), 2) +':'+ PADZ(IntToStr(Ticks/1000 - Ticks/1000/60*60), 2)
    else if Ticks/3600 >= 1000              {more than hour}  then
        Result:= IntToStr(Ticks/3600000) +h+' '+ PADZ(IntToStr((Ticks/1000 - Ticks/1000/3600*3600)/60), 2) +m
    else if Ticks/60 >= 1000                {1..60 minutes}   then
        Result:= IntToStr(Ticks/60000) +m+' '+ PADZ(IntToStr(Ticks/1000 - Ticks/1000/60*60), 2) +s
   else Result:= IntToStr(Ticks/1000) +s    {less than one minute}
End;
 
// The main callback function for unpacking FreeArc archives
function FreeArcCallback (what: PAnsiChar; Mb, sizeArc: Integer; str: PAnsiChar): Integer;
var
    percents, Remaining: Integer;
    s: String;
begin
    if GetTickCount - LastTimerEvent > 1000 then begin
        // This code will be executed once each 1000 ms (этот код будет выполняться раз в 1000 миллисекунд)
        //  ....
        // End of code executed by timer
        LastTimerEvent := LastTimerEvent+1000;
    end;
 
    if string(what)='filename' then begin
        // Update FileName label
        lblExtractFileName.Caption:= FmtMessage( cm( 'Extracting' ), [OemToAnsiStr( str )] )
    end else if (string(what)='write') and (totalUncompressedSize>0) and (Mb>lastMb) then begin
        // Assign to Mb *total* amount of data extracted to the moment from all archives
        lastMb := Mb;
        Mb := baseMb+Mb;
 
        // Update progress bar
        WizardForm.ProgressGauge.Position:= Mb;
 
        // Show how much megabytes/archives were processed up to the moment
        percents:= (Mb*1000) div totalUncompressedSize;
        s := FmtMessage(cm('ExtractedInfo'), [IntToStr(Mb), IntToStr(totalUncompressedSize)]);
        if GetArrayLength(Arcs)>1 then
            s := s + '. '+FmtMessage(cm('ArcInfo'), [IntToStr(n+1), IntToStr(GetArrayLength(Arcs))])
        ExtractFile.Caption := s
 
        // Calculate and show current percents
        percents:= (Mb*1000) div totalUncompressedSize;
        s:= FmtMessage(cm('AllProgress'), [Format('%.1n', [Abs(percents/10)])]);
        if Mb > 0 then Remaining:= trunc((GetTickCount - StartInstall) * Abs((totalUncompressedSize - Mb)/Mb)) else Remaining:= 0;
        if Remaining = 0 then SetTaskBarTitle(cm('ending')) else begin
            s:= s + '.  '+FmtMessage(cm('remains'), [TicksToTime(Remaining, cm('hour'), cm('min'), cm('sec'), false)])
            SetTaskBarTitle(FmtMessage(cm('taskbar'), [IntToStr(percents/10), TicksToTime(Remaining, 'h', 'm', 's', false)]))
        end;
        WizardForm.FileNameLabel.Caption := s
    end;
    AppProcessMessage;
    Result:= CancelCode;
end;
 
// Extracts all found archives
function UnPack(Archives: string): Integer;
var
    totalCompressedSize: Extended;
    callback: longword;
    FreeMB, TotalMB: Cardinal;
begin
    // Display 'Extracting FreeArc archive'
    lblExtractFileName.Caption:= '';
    lblExtractFileName.Show;
    ExtractFile.caption:= cm('ArcTitle');
    ExtractFile.Show;
    // Show the 'Cancel unpacking' button and set it as default button
    btnCancelUnpacking.Caption:= WizardForm.CancelButton.Caption;
    btnCancelUnpacking.Show;
    WizardForm.ActiveControl:= btnCancelUnpacking;
    WizardForm.ProgressGauge.Position:= 0;
    // Get the size of all archives
    totalUncompressedSize := 0;
    totalCompressedSize := FindArcs(Archives);
    WizardForm.ProgressGauge.Max:= totalUncompressedSize;
    // Other initializations
    callback:= WrapFreeArcCallback(@FreeArcCallback,4);   //FreeArcCallback has 4 arguments
    StartInstall:= GetTickCount;    {время начала распаковки}
    LastTimerEvent:= GetTickCount;
    baseMb:= 0
 
    for n:= 0 to GetArrayLength(Arcs) -1 do
    begin
        lastMb := 0
        CancelCode:= 0;
        AppProcessMessage;
        try
            // Pass the specified arguments to 'unarc.dll'
            Result:= FreeArcExtract (callback, 'x', '-o+', '-dp' + AnsiToUtf8( ExpandConstant('{app}') ), '--', AnsiToUtf8(Arcs[n].Path), '', '', '', '', '');
            if CancelCode < 0 then Result:= CancelCode;
        except
            Result:= -63;  //    ArcFail
        end;
        baseMb:= baseMb+lastMb
 
        // Error occured
        if Result <> 0 then
        begin
            msgError:= FmtMessage(cm('ArcError'), [IntToStr(Result)]);
            GetSpaceOnDisk(ExtractFileDrive(ExpandConstant('{app}')), True, FreeMB, TotalMB);
            case Result of
                -1: if FreeMB < 32 {Мб на диске} then msgError:= SetupMessage(msgDiskSpaceWarningTitle)
                    else msgError:= msgError + #13#10 + FmtMessage(cm('ArcBroken'), [ExtractFileName(Arcs[n].Path)]);
                -127:   msgError:= cm('ArcBreak');    //Cancel button
                -63:    msgError:= cm('ArcFail');
            end;
//          MsgBox(msgError, mbInformation, MB_OK);    //сообщение показывается на странице завершения
            Log(msgError);
            Break;    //прервать цикл распаковки
        end;
    end;
    // Hide labels and button
    WizardForm.FileNameLabel.Caption:= '';
    lblExtractFileName.Hide;
    ExtractFile.Hide;
    btnCancelUnpacking.Hide;
end;
 
function CreateIcons: Boolean;
begin
  Result:=Icons.Checked;
end;
 
function GroupIcons: Boolean;
begin
  Result:=Group.Checked;
end;
 
function Run: Boolean;
begin
  Result:=RunProgram.Checked;
end;
 
// задал процедуру, чтоб отмечался чекбокс еси кликнуть по надписи lblCheckBox
procedure IconsOnClick(Sender: TObject);
begin
  if Icons.Checked = False then
    Icons.Checked:= True else
  Icons.Checked:= False;
end;
 
procedure GroupOnClick(Sender: TObject);
begin
  if Group.Checked = False then
    Group.Checked:= True else
  Group.Checked:= False;
end;
 
procedure RunProgramClick(Sender: TObject);
begin
  if RunProgram.Checked = False then
    RunProgram.Checked:= True else
  RunProgram.Checked:= False;
end;
 
Procedure NoIconsLabelOnClick (Sender: TObject);
begin
WizardForm.NoIconsCheck.Checked:=Not(WizardForm.NoIconsCheck.Checked)
end;
// задал процедуру, чтоб отмечался чебокс еси кликнуть по надписи lblCheckBox
//Свободное место
procedure GetFreeSpaceCaption(Sender: TObject);
var
  Path: String;
begin
  Path := ExtractFileDrive(WizardForm.DirEdit.Text);
  GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
  if FreeMB > 1024 then
  FreeSpaceLabel.Caption := ExpandConstant('{cm:SPACE}')+' '+FloatToStr(round(FreeMB/1024*100)/100) + ' GB' else
  FreeSpaceLabel.Caption := ExpandConstant('{cm:SPACE}')+' '+IntToStr(FreeMB) + ' MB';
  if FreeMB < NeedSize then
  begin
    ButtonLabel[bidNext].Enabled := False;
         end else
  begin
    ButtonLabel[bidNext].Enabled := True;
               end;
end;
 
procedure GetNeedSpaceCaption;
begin
  if NeedSize > 1024 then
     NeedSpaceLabel.Caption := ExpandConstant('{cm:SPACE1}')+' '+FloatToStr(round(NeedSize/1024*100)/100) + ' GB'
  else
  NeedSpaceLabel.Caption := ExpandConstant('{cm:SPACE1}')+' '+IntToStr(NeedSize) + ' MB';
end;
 
procedure ButtonLabelClick(Sender: TObject);
var
  Button: TButton;
begin
  ButtonImage[TLabel(Sender).Tag].Left:=0
  case TLabel(Sender).Tag of
    bidBack: Button:=WizardForm.BackButton
    bidNext: Button:=WizardForm.NextButton
    bidCancel: Button:=WizardForm.CancelButton
    bidDirBrowse: Button:=WizardForm.DirBrowseButton
    bidGroupBrowse: Button:=WizardForm.GroupBrowseButton
  else
    Exit
  end
  Button.OnClick(Button)
end;
 
procedure ButtonLabelMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  if ButtonLabel[TLabel(Sender).Tag].Enabled then
     ButtonImage[TLabel(Sender).Tag].Left:=-ButtonWidth
end;
 
procedure ButtonLabelMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  ButtonImage[TLabel(Sender).Tag].Left:=0
end;
 
procedure LoadButtonImage(AButton: TButton; AButtonIndex: integer);
var
  Image: TBitmapImage;
  Panel: TPanel;
  Labl: TLabel;
 
begin
  Panel:=TPanel.Create(WizardForm)
  Panel.Left:=AButton.Left
  Panel.Top:=AButton.Top
  Panel.Width:=AButton.Width
  Panel.Height:=AButton.Height
  Panel.Tag:=AButtonIndex
  Panel.Parent:=AButton.Parent
  ButtonPanel[AButtonIndex]:=Panel
 
  Image:=TBitmapImage.Create(WizardForm)
  Image.Width:=160
  Image.Height:=23
  Image.Enabled:=False
  Image.Bitmap.LoadFromFile(ExpandConstant('{tmp}\button.bmp'))
  Image.Parent:=Panel
  ButtonImage[AButtonIndex]:=Image
 
  with TLabel.Create(WizardForm) do begin
    Tag:=AButtonIndex
    Parent:=Panel
    Width:=Panel.Width
    Height:=Panel.Height
    Transparent:=True
    OnClick:=@ButtonLabelClick
    OnDblClick:=@ButtonLabelClick
    OnMouseDown:=@ButtonLabelMouseDown
    OnMouseUp:=@ButtonLabelMouseUp
  end
 
  Labl:=TLabel.Create(WizardForm)
  Labl.Left:=12
  Labl.Top:=5
  Labl.Width:=Panel.Width
  Labl.Autosize:=True
  Labl.Alignment:=taCenter
  Labl.Tag:=AButtonIndex
  Labl.Transparent:=True
  Labl.Font.Color:=clWhite
  Labl.Caption:=AButton.Caption
  Labl.OnClick:=@ButtonLabelClick
  Labl.OnDblClick:=@ButtonLabelClick
  Labl.OnMouseDown:=@ButtonLabelMouseDown
  Labl.OnMouseUp:=@ButtonLabelMouseUp
  Labl.Parent:=Panel
  ButtonLabel[AButtonIndex]:=Labl
end;
 
procedure UpdateButton(AButton: TButton;AButtonIndex: integer);
begin
  ButtonLabel[AButtonIndex].Caption:=AButton.Caption
  ButtonPanel[AButtonIndex].Visible:=AButton.Visible
  ButtonLabel[AButtonIndex].Enabled:=Abutton.Enabled
end;
 
procedure LicenceAcceptedRadioOnClick(Sender: TObject);
begin
  ButtonLabel[bidNext].Enabled:=True
end;
 
procedure LicenceNotAcceptedRadioOnClick(Sender: TObject);
begin
    ButtonLabel[bidNext].Enabled:=False
end;
//Загрузка скина
procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
external 'LoadSkin@files:isskin.dll stdcall';
 
 
procedure UnloadSkin();
external 'UnloadSkin@files:isskin.dll stdcall';
 
 
function ShowWindow(hWnd: Integer; uType: Integer): Integer;
external 'ShowWindow@user32.dll stdcall';
 
function InitializeSetup(): Boolean;
begin
    ExtractTemporaryFile('Tiger.cjstyles');
    LoadSkin(ExpandConstant('{tmp}\Tiger.cjstyles'), '');
    Result := True;
end;
 
procedure DeinitializeSetup();
begin
 ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);
    UnloadSkin();
if (PageID = wpFinished) and (RunProgram.Checked)
    then Exec(ExpandConstant('{#AppRunningFile}'), '', '', SW_SHOWNORMAL, ewNoWait, ResultCode); //Запускает файл если на финишной странице выбран чекбокс
end;
//Загрузка скина
 
procedure InitializeWizard();
begin
  ExtractTemporaryFile('1.bmp');
  ExtractTemporaryFile('2.bmp');
  ExtractTemporaryFile('3.bmp');
  ExtractTemporaryFile('4.bmp');
  ExtractTemporaryFile('5.bmp');
 
  NeedSize:= 530;
 
  WizardForm.DiskSpaceLabel.Hide;
 
  NeedSpaceLabel := TLabel.Create(WizardForm);
  NeedSpaceLabel.Left := ScaleX(0);
  NeedSpaceLabel.Top := ScaleY(202);
  NeedSpaceLabel.Width := ScaleX(209);
  NeedSpaceLabel.Height := ScaleY(13);
  NeedSpaceLabel.Parent := WizardForm.SelectDirPage;
 
  FreeSpaceLabel := TLabel.Create(WizardForm);
  FreeSpaceLabel.Left := ScaleX(0);
  FreeSpaceLabel.Top := ScaleY(220);
  FreeSpaceLabel.Width := ScaleX(209);
  FreeSpaceLabel.Height := ScaleY(13);
  FreeSpaceLabel.Parent := WizardForm.SelectDirPage;
 
  WizardForm.BackButton.Width:=ButtonWidth
  WizardForm.BackButton.Height:=ButtonHeight
 
  WizardForm.NextButton.Width:=ButtonWidth
  WizardForm.NextButton.Height:=ButtonHeight
 
  WizardForm.CancelButton.Width:=ButtonWidth
  WizardForm.CancelButton.Height:=ButtonHeight
 
  WizardForm.DirBrowseButton.Left:=390
  WizardForm.DirBrowseButton.Top:=153
  WizardForm.DirBrowseButton.Width:=ButtonWidth
  WizardForm.DirBrowseButton.Height:=ButtonHeight
 
  WizardForm.GroupBrowseButton.Left:=390
  WizardForm.GroupBrowseButton.Top:=153
  WizardForm.GroupBrowseButton.Width:=ButtonWidth
  WizardForm.GroupBrowseButton.Height:=ButtonHeight
 
  WizardForm.LicenseAcceptedRadio.OnClick:=@LicenceAcceptedRadioOnClick
 
  WizardForm.LicenseNotAcceptedRadio.OnClick:=@LicenceNotAcceptedRadioOnClick
 
  ExtractTemporaryFile('button.bmp')
  LoadButtonImage(WizardForm.BackButton,bidBack)
  LoadButtonImage(WizardForm.NextButton,bidNext)
  LoadButtonImage(WizardForm.CancelButton,bidCancel)
  LoadButtonImage(WizardForm.DirBrowseButton,bidDirBrowse)
  LoadButtonImage(WizardForm.GroupBrowseButton,bidGroupBrowse)
 
  BmpFile:= TBitmapImage.Create(WizardForm);
  BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));
  BmpFile.SetBounds(0, 0, 497, 360);
  BmpFile.Stretch:= true
  BmpFile.Parent:= WizardForm.WelcomePage;
 
  BmpFile:= TBitmapImage.Create(WizardForm);
  BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\2.bmp'));
  BmpFile.SetBounds(0, 0, 497, 360);
  BmpFile.Stretch:= true
  BmpFile.Parent:= WizardForm.SelectDirPage;
 
  BmpFile:= TBitmapImage.Create(WizardForm);
  BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\3.bmp'));
  BmpFile.SetBounds(0, 0, 497, 360);
  BmpFile.Stretch:= true
  BmpFile.Parent:= WizardForm.ReadyPage;
 
  BmpFile:= TBitmapImage.Create(WizardForm);
  BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\4.bmp'));
  BmpFile.SetBounds(0, 0, 497, 360);
  BmpFile.Stretch:= true
  BmpFile.Parent:= WizardForm.InstallingPage;
 
  BmpFile:= TBitmapImage.Create(WizardForm);
  BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\5.bmp'));
  BmpFile.SetBounds(0, 0, 497, 360);
  BmpFile.Stretch:= true
  BmpFile.Parent:= WizardForm.FinishedPage;
 
  with WizardForm do
  begin
    PageNameLabel.Hide;
    PageDescriptionLabel.Hide;
    WelcomeLabel1.Hide;
    WelcomeLabel2.Hide;
    DiskSpaceLabel.Hide;
    SelectDirBitmapImage.Hide;
    SelectDirBrowseLabel.Hide;
    SelectDirLabel.Hide;
    FinishedHeadingLabel.Hide;
    FinishedLabel.Hide;
    MainPanel.Hide
    FilenameLabel.Hide;
    StatusLabel.Hide;
    SelectStartMenuFolderLabel.Hide;
    SelectStartMenuFolderBrowseLabel.Hide;
    ReadyLabel.Hide;
    LicenseLabel1.Hide;
  end;
 
  with WizardForm do
   begin
    DirEdit.Left:= DirEdit.Left + ScaleX(40);
    DirEdit.Top:= DirEdit.Top + ScaleY(72);
    GroupEdit.Left:= GroupEdit.Left + ScaleX(40);
    GroupEdit.Top:= GroupEdit.Top + ScaleX(72);
    GroupEdit.Color:= Clwhite
    Font.Style:=[];
    Font.Name:= 'Tahoma';
    DirEdit.Color:=clblack;
    Font.Color:=clwhite;
    ProgressGauge.Top:=ScaleY(120);
    ProgressGauge.Left:=ScaleX(20);
    ProgressGauge.Width:=ScaleX(457);
    ReadyMemo.Left:=ScaleX(40);
    ReadyMemo.Top:= WizardForm.ReadyMemo.Top + ScaleY(72);
    ReadyMemo.Font.Color:= clwhite;
    ReadyMemo.ScrollBars:= ssVertical;
   end;
 
  with WizardForm do
   begin
    InnerNotebook.Left := ScaleX(0);
    InnerNotebook.Top := ScaleY(0);
    InnerNotebook.Width := ScaleX(497);
    InnerNotebook.Height := ScaleY(360);
    OuterNotebook.Left := ScaleX(0);
    OuterNotebook.Top := ScaleY(0);
    OuterNotebook.Width := ScaleX(497);
    OuterNotebook.Height := ScaleY(360);
   end;
 
  WelcomeLabel1:= TLabel.Create(WizardForm);
  with WelcomeLabel1 do
  begin
    Left:= ScaleX(50);
    Top:= ScaleY(30);
    Width:= ScaleX(350);
    Height:= ScaleY(100);
    AutoSize:= false;
    Transparent:= true;
    WordWrap:= true;
    Font.Size:= 13;
    Font.Color:=clwhite;
    Font.Style := [];
    Font.Name:= 'Deutsch Gothic';
    Parent:= WizardForm.WelcomePage;
    Caption:= WizardForm.WelcomeLabel1.Caption;
 end;
  //WelcomePage
  WelcomeLabel2:=TLabel.Create(WizardForm);
  with WelcomeLabel2 do
  begin
    Top:= ScaleY(233);
    Left:= ScaleX(50);
    Width:= ScaleX(450);
    Height:= ScaleY(350);
    AutoSize:= false;
    WordWrap:= true;
    Transparent:= true;
    Font.Size:= 8;
    Font.Color:=clwhite;
    Font.Style := [fsBold];
    Font.Name:= 'Tahoma';
    Parent:= WizardForm.WelcomePage;
    Caption:= WizardForm.WelcomeLabel2.Caption;
end;
//WelcomePage
//SelectDirPage
  SelectDirLabel:= TLabel.Create(WizardForm);
  with SelectDirLabel do
  begin
    Caption:= WizardForm.SelectDirLabel.Caption;
    Left:= ScaleX(40);
    Top:= WizardForm.SelectDirLabel.Top + ScaleY(62);
    Width:= WizardForm.SelectDirLabel.Width;
    Height:= WizardForm.SelectDirLabel.Height;
    Transparent := True;
    Parent:= WizardForm.SelectDirPage;
  end;
 
  SelectDirLabelBrowse:= TLabel.Create(WizardForm);
  with SelectDirLabelBrowse do
  begin
    Caption:= WizardForm.SelectDirBrowseLabel.Caption;
    Left:= ScaleX(40);
    Top:= WizardForm.SelectDirBrowseLabel.Top + ScaleY(62);
    Width:= WizardForm.SelectDirBrowseLabel.Width;
    Height:= WizardForm.SelectDirBrowseLabel.Height;
    WordWrap:= True;
    Transparent:= True;
    Parent:= WizardForm.SelectDirPage;
  end;
 
  PageNameLabel1:= TLabel.Create(WizardForm);
  with PageNameLabel1 do
  begin
    Left:= WizardForm.PageNameLabel.Left;
    Top:= WizardForm.PageNameLabel.Top;
    Width:= ScaleX(300);
    Height:= ScaleY(13);
    AutoSize:= False;
    Font.Style:= [fsBold];
    Font.Color:= clwhite;
    Transparent := True;
    Parent:= WizardForm.SelectDirPage;
 end;
 
  PageDescriptionLabel1:= TLabel.Create(WizardForm);
  with PageDescriptionLabel1 do
  begin
    Left:= WizardForm.PageDescriptionLabel.Left;
    Top:= WizardForm.PageDescriptionLabel.top;
    Width:= ScaleX(400);
    Height:= WizardForm.PageDescriptionLabel.Height;
    AutoSize:= False;
    Wordwrap:= True;
    Transparent := True;
    Parent:= WizardForm.SelectDirPage;
  end;
 
Icons:= TCheckBox.Create(WizardForm);
  with Icons do
  begin
    Parent:= WizardForm.SelectDirPage;
    Left:= WizardForm.DirEdit.Left;
    Top:= WizardForm.DirEdit.Top + 35;
    Width:= ScaleX(13);
    Height:= ScaleY(13);
    TabOrder:= 2;
    Checked:= False;
  end;
 
IconsLabel:= TLabel.Create(WizardForm);
  with IconsLabel do
  begin
    Caption:='Создать ярлык на рабочем столе';
    Left:= WizardForm.DirEdit.Left + 20;
    Top:= WizardForm.DirEdit.Top + 35;
    Width:= ScaleX(150);
    Height:= ScaleY(13);
    Transparent := True;
    Parent:= WizardForm.SelectDirPage;
    OnClick:= @IconsOnClick;
  end;
 
Group:= TCheckBox.Create(WizardForm);
  with Group do
  begin
    Parent:= WizardForm.SelectDirPage;
    Left:= WizardForm.DirEdit.Left;
    Top:= WizardForm.DirEdit.Top + 70;
    Width:= ScaleX(13);
    Height:= ScaleY(13);
    TabOrder:= 3;
    Checked:= False;
  end;
 
GroupLabel:= TLabel.Create(WizardForm);
  with GroupLabel do
  begin
    Caption:='Создать ярлыки в папке меню "Пуск"';
    Left:= WizardForm.DirEdit.Left + 20;
    Top:= WizardForm.DirEdit.Top + 70;
    Width:= ScaleX(150);
    Height:= ScaleY(13);
    Transparent := True;
    Parent:= WizardForm.SelectDirPage;
    OnClick:= @GroupOnClick;
  end;
 
  NeedSpaceLabel:= TLabel.Create(WizardForm);
  with NeedSpaceLabel do
  begin
    Parent:= WizardForm.SelectDirPage;
    Left:= WizardForm.DirEdit.Left;
    Top:= ScaleY(262);
    Width:= ScaleX(209);
    Height:= ScaleY(13);
    Transparent:= True;
  end;
 
  FreeSpaceLabel:= TLabel.Create(WizardForm);
  with FreeSpaceLabel do
  begin
    Parent:= WizardForm.SelectDirPage;
    Left:= WizardForm.DirEdit.Left;
    Top:= ScaleY(280);
    Width:= ScaleX(209);
    Height:= ScaleY(13);
    Transparent:= True;
  end;
 
  WizardForm.DirEdit.OnChange:= @GetFreeSpaceCaption;
  WizardForm.DirEdit.Text:= WizardForm.DirEdit.Text + #0;
  //SelectDirPage
  //ProgrammGroupPage
  SelectStartMenuFolderLabel:=TLabel.Create(WizardForm)
  with SelectStartMenuFolderLabel do
  begin
    Left:= ScaleX(40);
    Top:= WizardForm.SelectDirLabel.Top + ScaleY(62);
    Width:= WizardForm.SelectDirBrowseLabel.Width;
    Height:= WizardForm.SelectDirBrowseLabel.Height;
    AutoSize:=False
    WordWrap:=True
    Transparent:=True
    Caption:=WizardForm.SelectStartMenuFolderLabel.Caption
    Parent:=WizardForm.SelectProgramGroupPage
  end;
 
  SelectStartMenuFolderBrowseLabel:=TLabel.Create(WizardForm)
  with SelectStartMenuFolderBrowseLabel do
  begin
    Left:= ScaleX(40);
    Top:= WizardForm.SelectDirBrowseLabel.Top + ScaleY(62);
    Width:= WizardForm.SelectDirBrowseLabel.Width
    Height:= WizardForm.SelectDirBrowseLabel.Height
    AutoSize:=False
    WordWrap:=True
    Transparent:=True
    Caption:=WizardForm.SelectStartMenuFolderBrowseLabel.Caption
    Parent:=WizardForm.SelectProgramGroupPage
  end;
 
  WizardForm.NoIconsCheck.Left:=ScaleX(40);
  WizardForm.NoIconsCheck.Top:= WizardForm.DirEdit.Top + ScaleY(140)
  WizardForm.NoIconsCheck.Width:=13
  WizardForm.NoIconsCheck.Height:=13
  WizardForm.NoIconsCheck.Visible:=True
  WizardForm.NoIconsCheck.Parent:= WizardForm.SelectProgramGroupPage
 
  NoIconsLabel:=TLabel.Create(WizardForm)
  with NoIconsLabel do
  begin
    Left:=ScaleX(56);
    Top:= WizardForm.DirEdit.Top + ScaleY(140)
    Transparent:=True
    OnClick:= @NoIconsLabelOnClick
    Caption:=WizardForm.NoIconsCheck.Caption
    Parent:=WizardForm.SelectProgramGroupPage
  end;
 
  PageNameLabel2:= TLabel.Create(WizardForm);
  with PageNameLabel2 do
  begin
    Left:= WizardForm.PageNameLabel.Left;
    Top:= WizardForm.PageNameLabel.Top;
    Width:= ScaleX(300);
    Height:= ScaleY(14);
    AutoSize:= False;
    Font.Style:= [fsBold];
    Font.Color:= clwhite;
    Transparent := True;
    Parent:= WizardForm.SelectProgramGroupPage;
 end;
 
  PageDescriptionLabel2:= TLabel.Create(WizardForm);
  with PageDescriptionLabel2 do
  begin
    Left:= WizardForm.PageDescriptionLabel.Left;
    Top:= WizardForm.PageDescriptionLabel.top;
    Width:= ScaleX(400);
    Height:= WizardForm.PageDescriptionLabel.Height;
    AutoSize:= False;
    Wordwrap:= True;
    Transparent := True;
    Parent:= WizardForm.SelectProgramGroupPage;
  end;
  //ProgrammGroupPage
  //ReadyPage
  ReadyLabel:= TLabel.Create(WizardForm);
  with ReadyLabel do
  begin
    Left:= ScaleX(40);
    Top:= ScaleY(80);
    Width:= ScaleX(325);
    Height:= WizardForm.ReadyLabel.Height;
    //AutoSize:= False;
    Transparent:= true;
    Caption:= 'Нажмите «Установить», чтобы продолжить, или «Вернуться»' + #10 + 'если Вы хотите просмотреть или изменить опции установки.'
    Parent:= WizardForm.ReadyPage;
  end;
 
  MyReady := TLabel.Create(WizardForm);
  MyReady.Left := WizardForm.ReadyMemo.Left;
  MyReady.Top := WizardForm.ReadyMemo.Top + ScaleY(30);
  MyReady.Width := WizardForm.ReadyMemo.Width;
  MyReady.Height := WizardForm.ReadyMemo.Height - ScaleY(10);
  MyReady.Transparent := True;
  MyReady.Parent := WizardForm.ReadyPage;
 
  PageNameLabel3:= TLabel.Create(WizardForm);
  with PageNameLabel3 do
  begin
    Left:= WizardForm.PageNameLabel.Left;
    Top:= WizardForm.PageNameLabel.Top;
    Width:= ScaleX(300);
    Height:= ScaleY(20);
    AutoSize:= False;
    Font.Style:= [fsBold];
    Font.Color:= clgreen;
    Font.Name:='Tahoma'
    Font.Size:=13
    Transparent:= True;
    Parent:= WizardForm.ReadyPage;
 end;
 
  PageDescriptionLabel3:= TLabel.Create(WizardForm);
  with PageDescriptionLabel3 do
  begin
    Left:= WizardForm.PageDescriptionLabel.Left;
    Top:= ScaleY(50)
    Width:= ScaleX(400);
    Height:= WizardForm.PageDescriptionLabel.Height;
    AutoSize:= False;
    Wordwrap:= True;
    Transparent := True;
    Parent:= WizardForm.ReadyPage;
  end;
  //ReadyPage
  //InstallingPage
    StatusLabel:= TLabel.Create(WizardForm);
  with StatusLabel do
  begin
    Left:= ScaleX(20);
    Top:= ScaleY(80);
    Width:= WizardForm.StatusLabel.Width;
    Height:= WizardForm.StatusLabel.Height;
    AutoSize:= False;
    Transparent := True;
    Parent:= WizardForm.InstallingPage;
    Caption:= 'Распаковка и восстановление игровых файлов...'
   end;
 
    FilenameLabel:= TLabel.Create(WizardForm);
  with FilenameLabel do
  begin
    Left:= ScaleX(20);
    Top:= ScaleY(100);
    Width:= WizardForm.StatusLabel.Width;
    Height:= WizardForm.StatusLabel.Height;
    AutoSize:= False;
    Transparent := True;
    Parent:= WizardForm.InstallingPage;
   end;
 
  PageNameLabel4:= TLabel.Create(WizardForm);
  with PageNameLabel4 do
  begin
    Left:= WizardForm.PageNameLabel.Left;
    Top:= WizardForm.PageNameLabel.Top;
    Width:= ScaleX(300);
    Height:= ScaleY(14);
    AutoSize:= False;
    Font.Style:= [fsBold];
    Font.Color:= clwhite;
    Transparent := True;
    Parent:= WizardForm.InstallingPage;
 end;
with WizardForm.ProgressGauge do
    begin
        // Create a label to show current FileName being extracted
        lblExtractFileName:= TLabel.Create(WizardForm);
        lblExtractFileName.parent:=WizardForm.InstallingPage;
        //lblExtractFileName.autosize:=false;
        lblExtractFileName.Width:= Width;
        lblExtractFileName.Left:= ScaleX(20)
        lblExtractFileName.top:=Top + ScaleY(35);
        lblExtractFileName.Transparent:=true;
        lblExtractFileName.Caption:= '';
        lblExtractFileName.Hide;
 
        // Create a label to show percentage
        ExtractFile:= TLabel.Create(WizardForm);
        ExtractFile.parent:=WizardForm.InstallingPage;
        //ExtractFile.autosize:=false;
        ExtractFile.Width:= Width;
        ExtractFile.Left:=ScaleX(20)
        ExtractFile.Transparent:=true;
        ExtractFile.top:=lblExtractFileName.Top + ScaleY(16);
        ExtractFile.caption:= '';
        ExtractFile.Hide;
    end;
 
    // Create a 'Cancel unpacking' button and hide it for now.
    btnCancelUnpacking:=TButton.create(WizardForm);
    btnCancelUnpacking.Parent:= WizardForm;
    btnCancelUnpacking.SetBounds(WizardForm.CancelButton.Left, WizardForm.CancelButton.top, WizardForm.CancelButton.Width, WizardForm.CancelButton.Height);
    btnCancelUnpacking.OnClick:= @btnCancelUnpackingOnClick;
    btnCancelUnpacking.Hide;
 
 
  PageDescriptionLabel4:= TLabel.Create(WizardForm);
  with PageDescriptionLabel4 do
  begin
    Left:= WizardForm.PageDescriptionLabel.Left;
    Top:= WizardForm.PageDescriptionLabel.top;
    Width:= ScaleX(400);
    Height:= WizardForm.PageDescriptionLabel.Height;
    AutoSize:= False;
    Wordwrap:= True;
    Transparent := True;
    Parent:= WizardForm.InstallingPage;
  end;
   //InstallingPage
   //FinishedPage
  FinishedHeadingLabel:=TLabel.Create(WizardForm);
  with FinishedHeadingLabel do
  begin
    Top:= ScaleY(30);
    Left:= ScaleX(98);
    Width:= ScaleX(301);
    Height:= ScaleY(100);
    AutoSize:= false;
    WordWrap:= true;
    Font.Size:= 14;
    Font.Color:=clred;
    Font.Style := [];
    Font.Name:='Deutsch Gothic'
    Transparent:= true;
    Parent:= WizardForm.FinishedPage;
    Caption:= WizardForm.FinishedHeadingLabel.Caption;
 end;
 
  FinishedLabel:= TLabel.Create(WizardForm);
  with FinishedLabel do
  begin
    Left:= ScaleX(98);
    Top:= ScaleY(136);
    Width:= ScaleX(301);
    Height:= ScaleY(64);
    AutoSize:= false;
    WordWrap:= true;
    Transparent:= true;
    Font.Color:=clred;
    Font.Size:= 8;
    Font.Style := [fsBold];
    Font.Name:= 'Tahoma';
    Parent:= WizardForm.FinishedPage;
    Caption:= 'Игра "{#AppName}" установлена на Ваш компьютер.' + #10#13#10 + 'Нажмите «Завершить», чтобы выйти из программы установки.'
  end;
 
  RunProgram:= TCheckBox.Create(WizardForm);
  with RunProgram do
  begin
    Parent:= WizardForm.FinishedPage;
    Left:= ScaleX(98);
    Top:= WizardForm.FinishedLabel.Top + 160;
    Width:= ScaleX(13);
    Height:= ScaleY(13);
    TabOrder:= 5;
    Checked:= False;
  end;
 
  RunProgramLabel:= TLabel.Create(WizardForm);
  with RunProgramLabel do
  begin
    Caption:='Запустить {#AppName}'; // Имя вашей программы
    Left:= ScaleX(118);
    Top:= WizardForm.FinishedLabel.Top + 160;
    Width:= ScaleX(150);
    Height:= ScaleY(13);
    Transparent := True;
    Parent:=  WizardForm.FinishedPage;
    OnClick:= @RunProgramClick;
  end;
   //FinishedPage
  end;
 
procedure CurStepChanged(CurStep: TSetupStep);
begin
    if CurStep = ssPostInstall then
    begin
        UnPackError:= UnPack(Archives)
        if UnPackError = 0 then
            SetTaskBarTitle(SetupMessage(msgSetupAppTitle))
        else
        begin
            // Error occured, uninstall it then
            Exec(ExpandConstant('{uninstallexe}'), '/SILENT','', sw_Hide, ewWaitUntilTerminated, n);    //откат установки из-за ошибки unarc.dll
            SetTaskBarTitle(SetupMessage(msgErrorTitle))
            WizardForm.Caption:= SetupMessage(msgErrorTitle) +' - '+ cm('ArcBreak')
        end;
    end;
end;
 
procedure CurPageChanged(CurPageID: Integer);
begin
  UpdateButton(WizardForm.BackButton,bidBack);
  UpdateButton(WizardForm.NextButton,bidNext);
  UpdateButton(WizardForm.CancelButton,bidCancel);
  PageNameLabel1.Caption:= WizardForm.PageNameLabel.Caption;
  PageDescriptionLabel1.Caption:= WizardForm.PageDescriptionLabel.Caption;
  PageNameLabel2.Caption:= WizardForm.PageNameLabel.Caption;
  PageDescriptionLabel2.Caption:= WizardForm.PageDescriptionLabel.Caption;
  PageNameLabel3.Caption:= WizardForm.PageNameLabel.Caption;
  PageDescriptionLabel3.Caption:= WizardForm.PageDescriptionLabel.Caption;
  PageNameLabel4.Caption:= WizardForm.PageNameLabel.Caption;
  PageDescriptionLabel4.Caption:= WizardForm.PageDescriptionLabel.Caption;
  PageID:=CurPageID;
  if CurPageID = wpSelectDir then
  begin
    GetNeedSpaceCaption;
    WizardForm.DirEdit.OnChange := @GetFreeSpaceCaption;
    WizardForm.DirEdit.Text := WizardForm.DirEdit.Text + #0;
    if FreeMB < NeedSize then
        ButtonLabel[bidNext].Enabled := False;
                   end;
    if CurPageID = wpReady then
  begin
    WizardForm.ReadyMemo.Visible := False;
    MyReady.Caption := WizardForm.ReadyMemo.Text;
  end;
    if (CurPageID = wpFinished) and (UnPackError <> 0) then
    begin // Extraction was unsuccessful (распаковщик вернул ошибку)
        // Show error message
        FinishedLabel.Font.Color:= $0000C0;    // red (красный)
        FinishedLabel.Height:= WizardForm.FinishedLabel.Height * 2;
        FinishedLabel.Caption:= SetupMessage(msgSetupAborted) + #13#10#13#10 + msgError;
        RunProgram.Hide;
        RunProgramLabel.Hide;
    end;
end;
end.
 

Всего записей: 26 | Зарегистр. 19-10-2009 | Отправлено: 17:27 18-03-2010 | Исправлено: RKW, 17:28 18-03-2010
Открыть новую тему     Написать ответ в эту тему

На первую страницук этому сообщениюк последнему сообщению

Компьютерный форум Ru.Board » Компьютеры » Программы » Inno Setup плюс внешние упаковщики


Реклама на форуме Ru.Board.

Powered by Ikonboard "v2.1.7b" © 2000 Ikonboard.com
Modified by Ru.B0ard
© Ru.B0ard 2000-2024

BitCoin: 1NGG1chHtUvrtEqjeerQCKDMUi6S6CG4iC

Рейтинг.ru