Inno Setup (создание инсталяционных пакетов). Часть 2

Статус
В этой теме нельзя размещать новые ответы.

YURSHAT

Тех. админ
Администратор
sergey3695
Пример
[SOURCE="iss"][Setup]
AppName=My Program
AppVersion=1.5
AppVerName=My Program 1.5
DefaultDirName={pf}\My Program
DefaultGroupName=My Program

[Languages]
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"

[Files]
Source: "uninst.ico"; Flags: dontcopy

Код:
var
  UninstIcon: TNewIconImage;

procedure RedesignWizardForm;
begin
  UninstIcon := TNewIconImage.Create(WizardForm);
  with UninstIcon do
  begin
    Parent := WizardForm;
    SetBounds(ScaleX(10), ScaleY(320), ScaleX(32), ScaleY(32));
    ExtractTemporaryFile('uninst.ico');
    Icon.LoadFromFile(ExpandConstant('{tmp}\uninst.ico'));
  end;
end;

procedure InitializeWizard();
begin
  RedesignWizardForm;
end;
[/SOURCE]
 

Suhov

Новичок
Если на архиве freearc'a стоит пароль его нужно прописывать в скрипте?
 

Mailchik

Старожил
Проверенный
Suhov,
if not ISArcExtract ( 0, 0, ExpandConstant('{src}\data.arc'), ExpandConstant('{app}'), '', false, 'krinkels123', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
krinkels123 - ваш пароль.
 

AntonOVS

Новичок
Всем привет! Нуждаюсь в помощи. Хотел бы в область на картинке:
добавить кнопку "Дополнительно" и чтобы при нажатии на нее, из-под инсталлятора выезжала панель, в которой бы было окно компонентов и "Tasks". То есть, чтобы на ней было вот это:

[SOURCE="iss"]#define appname "Metro 2033"
#define appver "1.2"
#define publisher "THQ"
#define AppExe "{app}\Game.exe"
#define NeedMem 512
#define Physx

;#define Components

;#define records

#define facompress

;#define PrecompInside
;#define SrepInside
;#define MSCInside
;#define precomp "0.42"
;#define unrar
;#define XDelta
;#define PackZIP

[Setup]
AppId={{93F35207-4044-4982-BB31-932ECBA5F6F6}
AppName={#appname}
AppVerName={#appname} v.{#appver}
AppPublisher={#publisher}
DefaultDirName={sd}\Games\{#appname}
DefaultGroupName={#publisher}\{#appname}
InternalCompressLevel=ultra64
SolidCompression=yes
Compression=lzma/ultra64
OutputDir=.
OutputBaseFilename=setup
SetupIconFile=files\icon.ico
AppCopyright=alteR
VersionInfoProductName={#appname}
VersionInfoProductVersion=1.0
VersionInfoVersion=1.0
VersionInfoCopyright=alteR
VersionInfoDescription={#appname} v.{#appver} RePack by alteR
ChangesAssociations=true

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

[Components]
Name: text; Description: Язык субтитров; Types: full; Flags: fixed
Name: text\rus; Description: Русский; Flags: exclusive; ExtraDiskSpaceRequired: 100000000
Name: text\eng; Description: Английский; Flags: exclusive; ExtraDiskSpaceRequired: 200000000
Name: voice; Description: Язык озвучки; Types: full; Flags: fixed
Name: voice\rus; Description: Русский; Flags: exclusive; ExtraDiskSpaceRequired: 500000000
Name: voice\eng; Description: Английский; Flags: exclusive; ExtraDiskSpaceRequired: 600000000
#endif

[Registry]
Root: HKLM; Subkey: Software\ProFrager; ValueName: path; ValueType: String; ValueData: {app}; Flags: uninsdeletekey; Check: CheckError
Root: HKLM; Subkey: Software\ProFrager; ValueName: name; ValueType: String; ValueData: Data; Flags: uninsdeletekey; Check: CheckError

[Icons]
Name: "{group}\{#appname} v.{#appver}"; Filename: "{app}\{#AppExe}"; Tasks: "groupicon"; WorkingDir: "{app}\"; Check: "CheckError"
Name: "{group}\{cm:UninstallProgram,{#appname}}"; Filename: "{uninstallexe}"; Tasks: "groupicon"; WorkingDir: "{app}\"; Check: "CheckError"
Name: "{commondesktop}\{#appname}"; Filename: "{app}\{#AppExe}"; Tasks: "desktopicon"; WorkingDir: "{app}\"; Check: "CheckError"

[Tasks]
Name: desktopicon; Description: "Добавить ярлык на рабочий стол"; GroupDescription: Создание ярлыков:
Name: groupicon; Description: "Добавить ярлык в меню Пуск"; GroupDescription: Создание ярлыков:
Name: Redist; Description: "Дополнительное программное обеспечение:"
Name: Redist\DirectXCheck; Description: "Установить DirectX (Июнь 2010)"; Flags: unchecked
Name: Redist\VCCheck; Description: "Установить Microsoft Visual C++ 2005 SP1"; Flags: unchecked
#ifdef Physx
Name: Redist\PhysXCheck; Description: "Установить Nvidia PhysX"; Flags: unchecked
#endif

[Run]
Filename: "{src}\Soft\vcredist_x86.exe"; Parameters: "/q"; StatusMsg: "Установка Microsoft Visual C++ Redist x86..."; Flags: "skipifdoesntexist"; Tasks: "Redist\VCCheck"; Check: "CheckError and not IsWin64";
Filename: "{src}\Soft\vcredist_x64.exe"; Parameters: "/q"; StatusMsg: "Установка Microsoft Visual C++ Redist x64..."; Flags: "skipifdoesntexist"; Tasks: "Redist\VCCheck"; Check: "CheckError and IsWin64";
Filename: "{src}\Soft\DirectX.exe"; StatusMsg: "Установка DirectX ..."; Flags: "waituntilterminated"; Tasks: "Redist\DirectXCheck"; Check: "CheckError";
#ifdef Physx
Filename: "msiexec.exe"; Parameters: "-i ""{src}\Soft\PhysX.msi"" -qn"; WorkingDir: "{src}\Soft"; StatusMsg: "Установка NVIDIA PhysX..."; Tasks: "Redist\PhysXCheck"; Check: "CheckError"; Flags: "runminimized waituntilterminated";
#endif

[Files]
Source: files\*; DestDir: {tmp}; Flags: dontcopy solidbreak
DestName: "WizardForm.BitmapImage.bmp"; Source: "files\1.bmp"; Flags: dontcopy solidbreak
DestName: "WizardForm.BitmapImage.bmp"; Source: "files\1.bmp"; DestDir: {app}; Attribs: hidden system
Source: Include\English.ini; DestDir: {tmp}; Flags: dontcopy
Source: Include\unarc.dll; DestDir: {tmp}; Flags: dontcopy
Source: ISDone.dll; DestDir: {tmp}; Flags: dontcopy
#ifdef records
Source: records.inf; DestDir: {tmp}; Flags: dontcopy
#endif

#ifdef PrecompInside
Source: Include\CLS-precomp.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\packjpg_dll1.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\precomp.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\zlib1.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef SrepInside
Source: Include\CLS-srep.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef MSCInside
Source: Include\CLS-MSC.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef facompress
Source: Include\facompress.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef precomp
#if precomp == "0.38"
Source: Include\precomp038.exe; DestDir: {tmp}; Flags: dontcopy
#else
#if precomp == "0.4"
Source: Include\precomp040.exe; DestDir: {tmp}; Flags: dontcopy
#else
#if precomp == "0.41"
Source: Include\precomp041.exe; DestDir: {tmp}; Flags: dontcopy
#else
#if precomp == "0.42"
Source: Include\precomp042.exe; DestDir: {tmp}; Flags: dontcopy
#else
Source: Include\precomp038.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\precomp040.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\precomp041.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\precomp042.exe; DestDir: {tmp}; Flags: dontcopy
#endif
#endif
#endif
#endif
#endif
#ifdef unrar
Source: Include\Unrar.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef XDelta
Source: Include\XDelta3.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef PackZIP
Source: Include\7z.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\packZIP.exe; DestDir: {tmp}; Flags: dontcopy
#endif

[CustomMessages]
russian.Extracted=Распаковка архивов...
russian.CancelButton=Отменить установку
russian.Error=Ошибка распаковки!
russian.ElapsedTime=Прошло:
russian.RemainingTime=Осталось времени:
russian.EstimatedTime=Всего:
russian.AllElapsedTime=Время установки:

[Languages]
Name: russian; MessagesFile: compiler:Languages\Russian.isl

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

Код:
const
  PCFonFLY=true;
  notPCFonFLY=false;
var
BitmapImage, BitmapImage1, BitmapImage2: TBitmapImage;

  LabelPct1,LabelTime1,LabelTime2,LabelTime3: TLabel;
  ISDoneProgressBar1: TNewProgressBar;
  MyCancelButton: TButton;
  Cancel:integer;
  MyError:boolean;
  PCFVer:double;

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 ISDoneProgressBar1.Position := OveralPct;
  LabelPct1.Caption := IntToStr(OveralPct div 10)+'.'+chr(48 + OveralPct mod 10)+'%';
  LabelTime1.Caption:=ExpandConstant('{cm:ElapsedTime} ')+TimeStr2;
  LabelTime2.Caption:=ExpandConstant('{cm:RemainingTime} ')+TimeStr1;
  LabelTime3.Caption:=ExpandConstant('{cm:AllElapsedTime}')+TimeStr3;
  Result := Cancel;
end;

procedure InitializeUninstallProgressForm;
var
BitmapImage: TBitmapImage;

  h:HWND;
begin
    UninstallProgressForm.AutoScroll := False;
    UninstallProgressForm.ClientWidth := ScaleX(533);
    UninstallProgressForm.ClientHeight := ScaleY(218);
    UninstallProgressForm.InnerNotebook.Left := ScaleX(0);
    UninstallProgressForm.InnerNotebook.Top := ScaleY(0);
    UninstallProgressForm.InnerNotebook.Width := ScaleX(533);
    UninstallProgressForm.InnerNotebook.Height := ScaleY(218);
    UninstallProgressForm.OuterNotebook.Width := ScaleX(533);
    UninstallProgressForm.OuterNotebook.Height := ScaleY(218);
    UninstallProgressForm.ProgressBar.Left := ScaleX(1);
    UninstallProgressForm.ProgressBar.Top := ScaleY(178);
    UninstallProgressForm.ProgressBar.Width := ScaleX(531);
    UninstallProgressForm.Font.Color:=clBlack;
    UninstallProgressForm.CancelButton.Hide;
    UninstallProgressForm.Bevel.Hide;
    UninstallProgressForm.StatusLabel.Hide;
    UninstallProgressForm.MainPanel.Hide;
    UninstallProgressForm.WizardSmallBitmapImage.Hide;

  BitmapImage := TBitmapImage.Create(UninstallProgressForm.InstallingPage);
  with BitmapImage do
  begin
    Name := 'BitmapImage';
    Parent := UninstallProgressForm.InstallingPage;
    Left := ScaleX(0);
    Top := ScaleY(0);
    Width := ScaleX(533);
    Height := ScaleY(180);
    AutoSize := false;
    FileCopy(ExpandConstant('{app}\WizardForm.BitmapImage.bmp'), ExpandConstant('{tmp}\WizardForm.BitmapImage.bmp'), False);
    Bitmap.LoadFromFile(ExpandConstant('{tmp}\WizardForm.BitmapImage.bmp'));
  end;
    h:=UninstallProgressForm.Handle;

    UninstallProgressForm.CancelButton.Visible:=False;
end;

procedure InitializeWizard();
begin
  BitmapImage1 := TBitmapImage.Create(WizardForm);
  with BitmapImage1 do
  begin
    Name := 'BitmapImage1';
    Parent := WizardForm.InstallingPage;
    Left := ScaleX(0);
    Top := ScaleY(0);
    Width := ScaleX(533);
    Height := ScaleY(180);
    AutoSize := false;
    ExtractTemporaryFile('WizardForm.BitmapImage.bmp');
    Bitmap.LoadFromFile(ExpandConstant('{tmp}\WizardForm.BitmapImage.bmp'));
  end;

  BitmapImage2 := TBitmapImage.Create(WizardForm);
  with BitmapImage2 do
  begin
    Name := 'BitmapImage2';
    Parent := WizardForm.SelectDirPage;
    Left := ScaleX(0);
    Top := ScaleY(0);
    Width := ScaleX(533);
    Height := ScaleY(180);
    AutoSize := false;
    ExtractTemporaryFile('WizardForm.BitmapImage.bmp');
    Bitmap.LoadFromFile(ExpandConstant('{tmp}\WizardForm.BitmapImage.bmp'));
  end;

    WizardForm.AutoScroll := False;
    WizardForm.ClientWidth := ScaleX(533);
    WizardForm.ClientHeight := ScaleY(248);
    WizardForm.InnerNotebook.Left := ScaleX(0);
    WizardForm.InnerNotebook.Top := ScaleY(0);
    WizardForm.InnerNotebook.Width := ScaleX(533);
    WizardForm.InnerNotebook.Height := ScaleY(248);
    WizardForm.OuterNotebook.Width := ScaleX(533);
    WizardForm.OuterNotebook.Height := ScaleY(248);
    WizardForm.DirBrowseButton.Left := ScaleX(4);
    WizardForm.DirBrowseButton.Top := ScaleY(191);
    WizardForm.NextButton.Left := ScaleX(452);
    WizardForm.NextButton.Top := ScaleY(191);
    WizardForm.NextButton.Parent := WizardForm.SelectDirPage;
    WizardForm.DirEdit.AutoSelect := False;
    WizardForm.DirEdit.Left := ScaleX(85);
    WizardForm.DirEdit.Top := ScaleY(192);
    WizardForm.DirEdit.Width := ScaleX(360);
    WizardForm.ProgressGauge.Left := ScaleX(1);
    WizardForm.ProgressGauge.Top := ScaleY(178);
    WizardForm.ProgressGauge.Width := ScaleX(531);
    WizardForm.Font.Color:=clBlack;

    WizardForm.CancelButton.Width:=ScaleX(80);
    WizardForm.CancelButton.Left:=ScaleX(452);
    WizardForm.CancelButton.Top:=216;
    WizardForm.CancelButton.Parent:=WizardForm.SelectDirPage;

    WizardForm.BackButton.Hide;
    WizardForm.Bevel.Hide;
    WizardForm.SelectDirBitmapImage.Hide;
    WizardForm.DiskSpaceLabel.Hide;
    WizardForm.SelectDirBrowseLabel.Hide;
    WizardForm.SelectDirLabel.Hide;
    WizardForm.FilenameLabel.Hide;
    WizardForm.StatusLabel.Hide;
    WizardForm.MainPanel.Hide;
    WizardForm.WizardSmallBitmapImage.Hide;
    WizardForm.PageDescriptionLabel.Hide;
    WizardForm.PageNameLabel.Hide;
    WizardForm.CancelButton.TabOrder := 3;
    WizardForm.NextButton.TabOrder := 4;
    WizardForm.Position:=poScreenCenter;
end;

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

procedure HideComponents;
begin
  WizardForm.FileNamelabel.Hide;
  ISDoneProgressBar1.Hide;
  LabelPct1.Hide;
  LabelTime1.Hide;
  LabelTime2.Hide;
  MyCancelButton.Hide;
end;

procedure ShowComponents;
var PBTop:integer;
begin
  PBTop:=ScaleY(50);
  ISDoneProgressBar1 := TNewProgressBar.Create(WizardForm);
  with ISDoneProgressBar1 do begin
    Parent   := WizardForm.InstallingPage;
    Height   := WizardForm.ProgressGauge.Height;
    Top := ScaleY(178);
    Left := ScaleX(1);
    Width := ScaleX(531);
    Max      := 1000;
  end;
  LabelPct1 := TLabel.Create(WizardForm);
  with LabelPct1 do begin
    Parent    := WizardForm.InstallingPage;
    AutoSize  := False;
    Left      := ScaleX(483);
    Top       := ScaleY(158);
    Width     := ScaleX(80);
  end;
  LabelTime1 := TLabel.Create(WizardForm);
  with LabelTime1 do begin
    Parent   := WizardForm.InstallingPage;
    AutoSize := False;
    Width    := ISDoneProgressBar1.Width div 2;
    Left     := ScaleX(5);
    Top      := ScaleY(200);
  end;
  LabelTime2 := TLabel.Create(WizardForm);
  with LabelTime2 do begin
    Parent   := WizardForm.InstallingPage;
    AutoSize := False;
    Width    := LabelTime1.Width+ScaleX(40);
    Left     := ISDoneProgressBar1.Width div 2;
    Top      := LabelTime1.Top;
  end;
  LabelTime3 := TLabel.Create(WizardForm);
  with LabelTime3 do begin
    Parent   := WizardForm.FinishedPage;
    AutoSize := False;
    Width    := 300;
    Left     := 180;
    Top      := 200;
  end;
  MyCancelButton:=TButton.Create(WizardForm);
  with MyCancelButton do begin
    Parent:=WizardForm;
    Width:=ScaleX(135);
    Caption:=ExpandConstant('{cm:CancelButton}');
    Left:=ScaleX(2);
    Top:=148;
    OnClick:=@CancelButtonOnClick;
  end;
end;

Procedure CurPageChanged(CurPageID: Integer);
Begin
  if (CurPageID = wpFinished) and MyError then
  begin
    LabelTime3.Hide;
    WizardForm.Caption:= ExpandConstant('{cm:Error}');
    WizardForm.FinishedLabel.Font.Color:= clRed;
    WizardForm.FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
  end;
begin
 If CurPageID=wpWelcome then
    begin
     SendMessage(WizardForm.NEXTBUTTON.Handle, 513, 0, 0);
     SendMessage(WizardForm.NEXTBUTTON.Handle, 514, 0, 0);
    end;
 If CurPageID=wpSelectDir  then
    begin
    WizardForm.NextButton.Caption := '&Установить';
  end;
 end;
end;

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

function ShouldSkipPage(PageID: Integer): Boolean;
begin
  if (PageID = wpWelcome)or(PageID =wpSelectProgramGroup  )or(PageID = wpReady )or(PageID =wpSelectTasks)or(PageID = wpFinished)then
  Result:= True;
end;

procedure CurStepChanged(CurStep: TSetupStep);
var Comps1,Comps2,Comps3, TmpValue:longword;
    ResultCode, tmp:integer;
begin
    if CurStep = ssDone then
    if FileExists('{#AppExe}') then
    if MsgBox('{#SetupSetting("AppName")}' +' успешно ' +  ' установлена!' + #10#10#13 + 'Запустить ' + '{#SetupSetting("AppName")}' + '?' , mbInformation, MB_OKCANCEL) = IDOK then
    Exec(ExpandConstant('{#AppExe}'), '', '', SW_SHOW, ewNoWait, ResultCode);
    if CurStep = ssInstall then begin  //Если необходимо, можно поменять на ssPostInstall
    WizardForm.ProgressGauge.Hide;
    WizardForm.CancelButton.Hide;
    ShowComponents;
    WizardForm.StatusLabel.Caption:=ExpandConstant('{cm:Extracted}');
    Cancel:=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

    ExtractTemporaryFile('English.ini');

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

#ifdef precomp
  PCFVer:={#precomp};
#else
  PCFVer:=0;
#endif
    MyError:=true;
    if ISDoneInit(ExpandConstant('{src}\records.inf'), $F777, Comps1,Comps2,Comps3, MainForm.Handle, {#NeedMem}, @ProgressCallback) then begin
      repeat
//        ChangeLanguage('English');
        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}\*.arc'), ExpandConstant('{app}'), '', false, '', '', 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;
*)

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

///////////////////////////////////////запустить MSI инсталлятор///////////////////////////////////////////////
#ifdef Physx
function InitializeSetup(): Boolean;
var ErrorCode : Integer;
begin
ShellExec('', ExpandConstant('{src}\Soft\PhysX.msi'),'/qn', '', SW_SHOW, ewWaitUntilTerminated, ErrorCode);
Result:= True;
end;
#endif
///////////////////////////////////////запустить MSI инсталлятор (Конец)///////////////////////////////////////////////[/SOURCE][/SPOILER]

Скрипт (для компиляции):
[url]http://rghost.ru/private/37844856/76bfe06140ada22a404efe57a439fee8[/url] 
Возможно ли такое реализовать? Заранее спасибо.
 
Последнее редактирование:

Nasgul

Новичок
Скажите пожалуйста как прикрутить сюда таймер (innocallback)
чтобы по прошествии например 5 секунд форма и видео закрывались, (то же самое что и в procedure CancelAuroraB_Form)

http://rghost.ru/37843631

выезжала панель,
скрипт с минимальным количеством файлов выложи. Чтоб можно было скомпилировать и запустить. Так проще будет сразу добавить, проверить и ошибки выловить
 
Последнее редактирование:

ProZorg

Новичок
Есть ли у кого нибудь код для компактного режима установки (сворачивается в правый нижний угол)
Очень нужно, заранее огромное спасибо[MOD="Gnom"]Есть. В справке.[/MOD]

Добавлено:
Gnom какая именно справка (Русская справка к версии 5.4.3) она? если она то я перерыл ее и ненашел
 
Последнее редактирование модератором:

David.D.Rocco

Участник
Проверенный
sergey3695,
Код:
[_code]
procedure mfPaint(Sender: TObject); var r: trect;
begin
  r.Right:=MainForm.ClientWidth;
  r.Bottom:=MainForm.ClientHeight;

  with MainForm do begin
    Canvas.Brush.Color:=clRed;
    Canvas.FillRect(r);
  end;
end;

procedure InitializeWizard(); 
begin
  MainForm.Show;

  MainForm.OnPaint:=@mfPaint;

  MainForm.Repaint;
end;
 

AntonOVS

Новичок
Всем привет! Нуждаюсь в помощи. Хотел бы в область на картинке:
добавить кнопку "Дополнительно" и чтобы при нажатии на нее, из-под инсталлятора выезжала панель, в которой бы было окно компонентов и "Tasks". То есть, чтобы на ней было вот это:

[SOURCE="iss"]#define appname "Metro 2033"
#define appver "1.2"
#define publisher "THQ"
#define AppExe "{app}\Game.exe"
#define NeedMem 512
#define Physx

;#define Components

;#define records

#define facompress

;#define PrecompInside
;#define SrepInside
;#define MSCInside
;#define precomp "0.42"
;#define unrar
;#define XDelta
;#define PackZIP

[Setup]
AppId={{93F35207-4044-4982-BB31-932ECBA5F6F6}
AppName={#appname}
AppVerName={#appname} v.{#appver}
AppPublisher={#publisher}
DefaultDirName={sd}\Games\{#appname}
DefaultGroupName={#publisher}\{#appname}
InternalCompressLevel=ultra64
SolidCompression=yes
Compression=lzma/ultra64
OutputDir=.
OutputBaseFilename=setup
SetupIconFile=files\icon.ico
AppCopyright=alteR
VersionInfoProductName={#appname}
VersionInfoProductVersion=1.0
VersionInfoVersion=1.0
VersionInfoCopyright=alteR
VersionInfoDescription={#appname} v.{#appver} RePack by alteR
ChangesAssociations=true

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

[Components]
Name: text; Description: Язык субтитров; Types: full; Flags: fixed
Name: text\rus; Description: Русский; Flags: exclusive; ExtraDiskSpaceRequired: 100000000
Name: text\eng; Description: Английский; Flags: exclusive; ExtraDiskSpaceRequired: 200000000
Name: voice; Description: Язык озвучки; Types: full; Flags: fixed
Name: voice\rus; Description: Русский; Flags: exclusive; ExtraDiskSpaceRequired: 500000000
Name: voice\eng; Description: Английский; Flags: exclusive; ExtraDiskSpaceRequired: 600000000
#endif

[Registry]
Root: HKLM; Subkey: Software\ProFrager; ValueName: path; ValueType: String; ValueData: {app}; Flags: uninsdeletekey; Check: CheckError
Root: HKLM; Subkey: Software\ProFrager; ValueName: name; ValueType: String; ValueData: Data; Flags: uninsdeletekey; Check: CheckError

[Icons]
Name: "{group}\{#appname} v.{#appver}"; Filename: "{app}\{#AppExe}"; Tasks: "groupicon"; WorkingDir: "{app}\"; Check: "CheckError"
Name: "{group}\{cm:UninstallProgram,{#appname}}"; Filename: "{uninstallexe}"; Tasks: "groupicon"; WorkingDir: "{app}\"; Check: "CheckError"
Name: "{commondesktop}\{#appname}"; Filename: "{app}\{#AppExe}"; Tasks: "desktopicon"; WorkingDir: "{app}\"; Check: "CheckError"

[Tasks]
Name: desktopicon; Description: "Добавить ярлык на рабочий стол"; GroupDescription: Создание ярлыков:
Name: groupicon; Description: "Добавить ярлык в меню Пуск"; GroupDescription: Создание ярлыков:
Name: Redist; Description: "Дополнительное программное обеспечение:"
Name: Redist\DirectXCheck; Description: "Установить DirectX (Июнь 2010)"; Flags: unchecked
Name: Redist\VCCheck; Description: "Установить Microsoft Visual C++ 2005 SP1"; Flags: unchecked
#ifdef Physx
Name: Redist\PhysXCheck; Description: "Установить Nvidia PhysX"; Flags: unchecked
#endif

[Run]
Filename: "{src}\Soft\vcredist_x86.exe"; Parameters: "/q"; StatusMsg: "Установка Microsoft Visual C++ Redist x86..."; Flags: "skipifdoesntexist"; Tasks: "Redist\VCCheck"; Check: "CheckError and not IsWin64";
Filename: "{src}\Soft\vcredist_x64.exe"; Parameters: "/q"; StatusMsg: "Установка Microsoft Visual C++ Redist x64..."; Flags: "skipifdoesntexist"; Tasks: "Redist\VCCheck"; Check: "CheckError and IsWin64";
Filename: "{src}\Soft\DirectX.exe"; StatusMsg: "Установка DirectX ..."; Flags: "waituntilterminated"; Tasks: "Redist\DirectXCheck"; Check: "CheckError";
#ifdef Physx
Filename: "msiexec.exe"; Parameters: "-i ""{src}\Soft\PhysX.msi"" -qn"; WorkingDir: "{src}\Soft"; StatusMsg: "Установка NVIDIA PhysX..."; Tasks: "Redist\PhysXCheck"; Check: "CheckError"; Flags: "runminimized waituntilterminated";
#endif

[Files]
Source: files\*; DestDir: {tmp}; Flags: dontcopy solidbreak
DestName: "WizardForm.BitmapImage.bmp"; Source: "files\1.bmp"; Flags: dontcopy solidbreak
DestName: "WizardForm.BitmapImage.bmp"; Source: "files\1.bmp"; DestDir: {app}; Attribs: hidden system
Source: Include\English.ini; DestDir: {tmp}; Flags: dontcopy
Source: Include\unarc.dll; DestDir: {tmp}; Flags: dontcopy
Source: ISDone.dll; DestDir: {tmp}; Flags: dontcopy
#ifdef records
Source: records.inf; DestDir: {tmp}; Flags: dontcopy
#endif

#ifdef PrecompInside
Source: Include\CLS-precomp.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\packjpg_dll1.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\precomp.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\zlib1.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef SrepInside
Source: Include\CLS-srep.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef MSCInside
Source: Include\CLS-MSC.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef facompress
Source: Include\facompress.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef precomp
#if precomp == "0.38"
Source: Include\precomp038.exe; DestDir: {tmp}; Flags: dontcopy
#else
#if precomp == "0.4"
Source: Include\precomp040.exe; DestDir: {tmp}; Flags: dontcopy
#else
#if precomp == "0.41"
Source: Include\precomp041.exe; DestDir: {tmp}; Flags: dontcopy
#else
#if precomp == "0.42"
Source: Include\precomp042.exe; DestDir: {tmp}; Flags: dontcopy
#else
Source: Include\precomp038.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\precomp040.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\precomp041.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\precomp042.exe; DestDir: {tmp}; Flags: dontcopy
#endif
#endif
#endif
#endif
#endif
#ifdef unrar
Source: Include\Unrar.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef XDelta
Source: Include\XDelta3.dll; DestDir: {tmp}; Flags: dontcopy
#endif
#ifdef PackZIP
Source: Include\7z.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\packZIP.exe; DestDir: {tmp}; Flags: dontcopy
#endif

[CustomMessages]
russian.Extracted=Распаковка архивов...
russian.CancelButton=Отменить установку
russian.Error=Ошибка распаковки!
russian.ElapsedTime=Прошло:
russian.RemainingTime=Осталось времени:
russian.EstimatedTime=Всего:
russian.AllElapsedTime=Время установки:

[Languages]
Name: russian; MessagesFile: compiler:Languages\Russian.isl

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

Код:
const
  PCFonFLY=true;
  notPCFonFLY=false;
var
BitmapImage, BitmapImage1, BitmapImage2: TBitmapImage;

  LabelPct1,LabelTime1,LabelTime2,LabelTime3: TLabel;
  ISDoneProgressBar1: TNewProgressBar;
  MyCancelButton: TButton;
  Cancel:integer;
  MyError:boolean;
  PCFVer:double;

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 ISDoneProgressBar1.Position := OveralPct;
  LabelPct1.Caption := IntToStr(OveralPct div 10)+'.'+chr(48 + OveralPct mod 10)+'%';
  LabelTime1.Caption:=ExpandConstant('{cm:ElapsedTime} ')+TimeStr2;
  LabelTime2.Caption:=ExpandConstant('{cm:RemainingTime} ')+TimeStr1;
  LabelTime3.Caption:=ExpandConstant('{cm:AllElapsedTime}')+TimeStr3;
  Result := Cancel;
end;

procedure InitializeUninstallProgressForm;
var
BitmapImage: TBitmapImage;

  h:HWND;
begin
    UninstallProgressForm.AutoScroll := False;
    UninstallProgressForm.ClientWidth := ScaleX(533);
    UninstallProgressForm.ClientHeight := ScaleY(218);
    UninstallProgressForm.InnerNotebook.Left := ScaleX(0);
    UninstallProgressForm.InnerNotebook.Top := ScaleY(0);
    UninstallProgressForm.InnerNotebook.Width := ScaleX(533);
    UninstallProgressForm.InnerNotebook.Height := ScaleY(218);
    UninstallProgressForm.OuterNotebook.Width := ScaleX(533);
    UninstallProgressForm.OuterNotebook.Height := ScaleY(218);
    UninstallProgressForm.ProgressBar.Left := ScaleX(1);
    UninstallProgressForm.ProgressBar.Top := ScaleY(178);
    UninstallProgressForm.ProgressBar.Width := ScaleX(531);
    UninstallProgressForm.Font.Color:=clBlack;
    UninstallProgressForm.CancelButton.Hide;
    UninstallProgressForm.Bevel.Hide;
    UninstallProgressForm.StatusLabel.Hide;
    UninstallProgressForm.MainPanel.Hide;
    UninstallProgressForm.WizardSmallBitmapImage.Hide;

  BitmapImage := TBitmapImage.Create(UninstallProgressForm.InstallingPage);
  with BitmapImage do
  begin
    Name := 'BitmapImage';
    Parent := UninstallProgressForm.InstallingPage;
    Left := ScaleX(0);
    Top := ScaleY(0);
    Width := ScaleX(533);
    Height := ScaleY(180);
    AutoSize := false;
    FileCopy(ExpandConstant('{app}\WizardForm.BitmapImage.bmp'), ExpandConstant('{tmp}\WizardForm.BitmapImage.bmp'), False);
    Bitmap.LoadFromFile(ExpandConstant('{tmp}\WizardForm.BitmapImage.bmp'));
  end;
    h:=UninstallProgressForm.Handle;

    UninstallProgressForm.CancelButton.Visible:=False;
end;

procedure InitializeWizard();
begin
  BitmapImage1 := TBitmapImage.Create(WizardForm);
  with BitmapImage1 do
  begin
    Name := 'BitmapImage1';
    Parent := WizardForm.InstallingPage;
    Left := ScaleX(0);
    Top := ScaleY(0);
    Width := ScaleX(533);
    Height := ScaleY(180);
    AutoSize := false;
    ExtractTemporaryFile('WizardForm.BitmapImage.bmp');
    Bitmap.LoadFromFile(ExpandConstant('{tmp}\WizardForm.BitmapImage.bmp'));
  end;

  BitmapImage2 := TBitmapImage.Create(WizardForm);
  with BitmapImage2 do
  begin
    Name := 'BitmapImage2';
    Parent := WizardForm.SelectDirPage;
    Left := ScaleX(0);
    Top := ScaleY(0);
    Width := ScaleX(533);
    Height := ScaleY(180);
    AutoSize := false;
    ExtractTemporaryFile('WizardForm.BitmapImage.bmp');
    Bitmap.LoadFromFile(ExpandConstant('{tmp}\WizardForm.BitmapImage.bmp'));
  end;

    WizardForm.AutoScroll := False;
    WizardForm.ClientWidth := ScaleX(533);
    WizardForm.ClientHeight := ScaleY(248);
    WizardForm.InnerNotebook.Left := ScaleX(0);
    WizardForm.InnerNotebook.Top := ScaleY(0);
    WizardForm.InnerNotebook.Width := ScaleX(533);
    WizardForm.InnerNotebook.Height := ScaleY(248);
    WizardForm.OuterNotebook.Width := ScaleX(533);
    WizardForm.OuterNotebook.Height := ScaleY(248);
    WizardForm.DirBrowseButton.Left := ScaleX(4);
    WizardForm.DirBrowseButton.Top := ScaleY(191);
    WizardForm.NextButton.Left := ScaleX(452);
    WizardForm.NextButton.Top := ScaleY(191);
    WizardForm.NextButton.Parent := WizardForm.SelectDirPage;
    WizardForm.DirEdit.AutoSelect := False;
    WizardForm.DirEdit.Left := ScaleX(85);
    WizardForm.DirEdit.Top := ScaleY(192);
    WizardForm.DirEdit.Width := ScaleX(360);
    WizardForm.ProgressGauge.Left := ScaleX(1);
    WizardForm.ProgressGauge.Top := ScaleY(178);
    WizardForm.ProgressGauge.Width := ScaleX(531);
    WizardForm.Font.Color:=clBlack;

    WizardForm.CancelButton.Width:=ScaleX(80);
    WizardForm.CancelButton.Left:=ScaleX(452);
    WizardForm.CancelButton.Top:=216;
    WizardForm.CancelButton.Parent:=WizardForm.SelectDirPage;

    WizardForm.BackButton.Hide;
    WizardForm.Bevel.Hide;
    WizardForm.SelectDirBitmapImage.Hide;
    WizardForm.DiskSpaceLabel.Hide;
    WizardForm.SelectDirBrowseLabel.Hide;
    WizardForm.SelectDirLabel.Hide;
    WizardForm.FilenameLabel.Hide;
    WizardForm.StatusLabel.Hide;
    WizardForm.MainPanel.Hide;
    WizardForm.WizardSmallBitmapImage.Hide;
    WizardForm.PageDescriptionLabel.Hide;
    WizardForm.PageNameLabel.Hide;
    WizardForm.CancelButton.TabOrder := 3;
    WizardForm.NextButton.TabOrder := 4;
    WizardForm.Position:=poScreenCenter;
end;

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

procedure HideComponents;
begin
  WizardForm.FileNamelabel.Hide;
  ISDoneProgressBar1.Hide;
  LabelPct1.Hide;
  LabelTime1.Hide;
  LabelTime2.Hide;
  MyCancelButton.Hide;
end;

procedure ShowComponents;
var PBTop:integer;
begin
  PBTop:=ScaleY(50);
  ISDoneProgressBar1 := TNewProgressBar.Create(WizardForm);
  with ISDoneProgressBar1 do begin
    Parent   := WizardForm.InstallingPage;
    Height   := WizardForm.ProgressGauge.Height;
    Top := ScaleY(178);
    Left := ScaleX(1);
    Width := ScaleX(531);
    Max      := 1000;
  end;
  LabelPct1 := TLabel.Create(WizardForm);
  with LabelPct1 do begin
    Parent    := WizardForm.InstallingPage;
    AutoSize  := False;
    Left      := ScaleX(483);
    Top       := ScaleY(158);
    Width     := ScaleX(80);
  end;
  LabelTime1 := TLabel.Create(WizardForm);
  with LabelTime1 do begin
    Parent   := WizardForm.InstallingPage;
    AutoSize := False;
    Width    := ISDoneProgressBar1.Width div 2;
    Left     := ScaleX(5);
    Top      := ScaleY(200);
  end;
  LabelTime2 := TLabel.Create(WizardForm);
  with LabelTime2 do begin
    Parent   := WizardForm.InstallingPage;
    AutoSize := False;
    Width    := LabelTime1.Width+ScaleX(40);
    Left     := ISDoneProgressBar1.Width div 2;
    Top      := LabelTime1.Top;
  end;
  LabelTime3 := TLabel.Create(WizardForm);
  with LabelTime3 do begin
    Parent   := WizardForm.FinishedPage;
    AutoSize := False;
    Width    := 300;
    Left     := 180;
    Top      := 200;
  end;
  MyCancelButton:=TButton.Create(WizardForm);
  with MyCancelButton do begin
    Parent:=WizardForm;
    Width:=ScaleX(135);
    Caption:=ExpandConstant('{cm:CancelButton}');
    Left:=ScaleX(2);
    Top:=148;
    OnClick:=@CancelButtonOnClick;
  end;
end;

Procedure CurPageChanged(CurPageID: Integer);
Begin
  if (CurPageID = wpFinished) and MyError then
  begin
    LabelTime3.Hide;
    WizardForm.Caption:= ExpandConstant('{cm:Error}');
    WizardForm.FinishedLabel.Font.Color:= clRed;
    WizardForm.FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
  end;
begin
 If CurPageID=wpWelcome then
    begin
     SendMessage(WizardForm.NEXTBUTTON.Handle, 513, 0, 0);
     SendMessage(WizardForm.NEXTBUTTON.Handle, 514, 0, 0);
    end;
 If CurPageID=wpSelectDir  then
    begin
    WizardForm.NextButton.Caption := '&Установить';
  end;
 end;
end;

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

function ShouldSkipPage(PageID: Integer): Boolean;
begin
  if (PageID = wpWelcome)or(PageID =wpSelectProgramGroup  )or(PageID = wpReady )or(PageID =wpSelectTasks)or(PageID = wpFinished)then
  Result:= True;
end;

procedure CurStepChanged(CurStep: TSetupStep);
var Comps1,Comps2,Comps3, TmpValue:longword;
    ResultCode, tmp:integer;
begin
    if CurStep = ssDone then
    if FileExists('{#AppExe}') then
    if MsgBox('{#SetupSetting("AppName")}' +' успешно ' +  ' установлена!' + #10#10#13 + 'Запустить ' + '{#SetupSetting("AppName")}' + '?' , mbInformation, MB_OKCANCEL) = IDOK then
    Exec(ExpandConstant('{#AppExe}'), '', '', SW_SHOW, ewNoWait, ResultCode);
    if CurStep = ssInstall then begin  //Если необходимо, можно поменять на ssPostInstall
    WizardForm.ProgressGauge.Hide;
    WizardForm.CancelButton.Hide;
    ShowComponents;
    WizardForm.StatusLabel.Caption:=ExpandConstant('{cm:Extracted}');
    Cancel:=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

    ExtractTemporaryFile('English.ini');

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

#ifdef precomp
  PCFVer:={#precomp};
#else
  PCFVer:=0;
#endif
    MyError:=true;
    if ISDoneInit(ExpandConstant('{src}\records.inf'), $F777, Comps1,Comps2,Comps3, MainForm.Handle, {#NeedMem}, @ProgressCallback) then begin
      repeat
//        ChangeLanguage('English');
        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}\*.arc'), ExpandConstant('{app}'), '', false, '', '', 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;
*)

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

///////////////////////////////////////запустить MSI инсталлятор///////////////////////////////////////////////
#ifdef Physx
function InitializeSetup(): Boolean;
var ErrorCode : Integer;
begin
ShellExec('', ExpandConstant('{src}\Soft\PhysX.msi'),'/qn', '', SW_SHOW, ewWaitUntilTerminated, ErrorCode);
Result:= True;
end;
#endif
///////////////////////////////////////запустить MSI инсталлятор (Конец)///////////////////////////////////////////////[/SOURCE][/SPOILER]

Скрипт (для компиляции):
[url]http://rghost.ru/private/37844856/76bfe06140ada22a404efe57a439fee8[/url] 
Возможно ли такое реализовать? Заранее спасибо.[/QUOTE][/SPOILER]
Ну или можно хотя-бы сделать как у каталистов. Добавить кнопку, но чтобы меню открывалось в активном окне?
[SPOILER="Скриншоты"][IMG]http://i35.fastpic.ru/big/2012/0502/63/896e7b3541bf1cbbb8f8b3b1d3b02a63.jpg[/IMG]
[IMG]http://i37.fastpic.ru/big/2012/0502/6f/70ed0a2a3d0d272ecab2208b59ca1a6f.jpg[/IMG][/SPOILER]
 

LexBell

Борода
Супер модератор
AntonOVS, Это скрипт я писал, изначально не предполагая добавления в него каких-либо настроек. Но если уж очень нужно - можно и переписать. заодно и сам скрипт давно пора перелопатить - последняя версия, которую я не выкладывал - раз в 10 короче :)
 

AntonOVS

Новичок
Gnom, за скрипт спасибо.
Но если уж очень нужно - можно и переписать.
Если не сложно конечно, сильно оно мне конечно не нужно, но если есть возможность то перепишите пожалуйста и, если можно, с реализацией того, что я напридумывал:
http://krinkels.org/showthread.php?p=10103#post10103.
Если что, я совместил ваш скрипт вместе с ISDone 0.6:
http://rghost.ru/private/37844856/76bfe06140ada22a404efe57a439fee8
Буду благодарен за вашу помощь.
 

Devils Night

Ветеран
В справке не нашёл, решил спросить здесь.
Мужики, какие горячие клавиши есть у инно?
Нашёл только это:
Переводим раскладку клавиатуры на английский язык.
Горячие клавиши const: a b c d e f g h i l n o p r s u v w

Горячие клавиши комментирования: Далее, для закомментирования нужно выделить как минимум 2 строки (для одной строки не подойдёт), эта возможность позволяет комментировать как несколько строк, так и весь код, для закомментирования нужно выделить необходимую часть кода и нажать на клавиатуре
либо
.
 
Последнее редактирование:

Suhov

Новичок
Код:
#ifdef Components
[Types]
Name: full; Description: Full installation; Flags: iscustom

[Components]
//Name: Text; Description: {cm:version4}; Types: full;  Flags: fixed;
// Name: Text\rus; Description: {cm:version3}; Flags: exclusive;
// Name: Text\eng; Description:{cm:version2}; Flags: exclusive;
Name: Sound; Description: "{cm:version5}"; Flags: fixed;  Types: full;
Name: Sound\rus; Description: {cm:version3}; Flags: exclusive;
Name: Sound\eng; Description: {cm:version2}; Flags: exclusive;
#endif
________________________________________________

Comps1:=0; Comps2:=0; Comps3:=0;
#ifdef Components
    TmpValue:=1;
    if IsComponentSelected('text\rus') then Comps1:=Comps1+TmpValue;     //компонент 1
    TmpValue:=TmpValue*2;
    if IsComponentSelected('text\eng') then Comps1:=Comps1+TmpValue;     //компонент 2
    TmpValue:=TmpValue*2;
    if IsComponentSelected('voice\rus') then Comps1:=Comps1+TmpValue;    //компонент 3
    TmpValue:=TmpValue*2;
    if IsComponentSelected('voice\eng') then Comps1:=Comps1+TmpValue;    //компонент 4

______________________

 if not ISArcExtract ( 0, 0, ExpandConstant('{src}\data1.bin'), ExpandConstant('{app}'),  false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
           if not ISArcExtract ( 0, 0, ExpandConstant('{src}\data4.bin'), ExpandConstant('{app}'),  false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
         if not ISArcExtract ( 0, 0, ExpandConstant('{src}\data5.bin'), ExpandConstant('{app}'),  false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;

       
        //if not ISArcExtract ( 1, 0, ExpandConstant('{src}\data\data6.bin'), ExpandConstant('{app}'),  false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
       // if not ISArcExtract ( 2, 0, ExpandConstant('{src}\data\data5.bin'), ExpandConstant('{app}'),  false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
        if not ISArcExtract ( 3, 0, ExpandConstant('{src}\data2.bin'), ExpandConstant('{app}'),  false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
        if not ISArcExtract ( 4, 0, ExpandConstant('{src}\data3.bin'), ExpandConstant('{app}'),  false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
что нужно закомментировать чтобы работало только выбор озвучки?
 

ProZorg

Новичок
Suhov если без выбора и только русская озвучка, то зачем вообще нужны компоненты?
 

DineX

Новичок
Код:
;Name: Text; Description: {cm:version4}; Types: full;  Flags: fixed;
;Name: Text\rus; Description: {cm:version3}; Flags: exclusive;
;Name: Text\eng; Description:{cm:version2}; Flags: exclusive;
Код:
    TmpValue:=1;
    //if IsComponentSelected('text\rus') then Comps1:=Comps1+TmpValue;     //компонент 1
    //TmpValue:=TmpValue*2;
    //if IsComponentSelected('text\eng') then Comps1:=Comps1+TmpValue;     //компонент 2
    //TmpValue:=TmpValue*2;
    if IsComponentSelected('voice\rus') then Comps1:=Comps1+TmpValue;    //компонент 3
    TmpValue:=TmpValue*2;
    if IsComponentSelected('voice\eng') then Comps1:=Comps1+TmpValue;    //компонент
PS: И ещё почитай справку там есть все ответы на все вопросы. ;)
 

TERRAN

Новичок
Проверенный
Suhov
Код:
#ifdef Components
[Types]
Name: full; Description: Full installation; Flags: iscustom

[Components]
Name: Sound; Description: "{cm:version5}"; Flags: fixed;  Types: full;
Name: Sound\rus; Description: {cm:version3}; Flags: exclusive;
Name: Sound\eng; Description: {cm:version2}; Flags: exclusive;
#endif
________________________________________________

Comps1:=0; Comps2:=0; Comps3:=0;
#ifdef Components
    TmpValue:=1;
    if IsComponentSelected('Sound\rus') then Comps1:=Comps1+TmpValue;     //компонент 1
    TmpValue:=TmpValue*2;
    if IsComponentSelected('Sound\eng') then Comps1:=Comps1+TmpValue;     //компонент 2
 #endif   
______________________

        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\data1.bin'), ExpandConstant('{app}'),  false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\data4.bin'), ExpandConstant('{app}'),  false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
        if not ISArcExtract ( 0, 0, ExpandConstant('{src}\data5.bin'), ExpandConstant('{app}'),  false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
       
        
        if not ISArcExtract ( 1, 0, ExpandConstant('{src}\data2.bin'), ExpandConstant('{app}'),  false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
        if not ISArcExtract ( 2, 0, ExpandConstant('{src}\data3.bin'), ExpandConstant('{app}'),  false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
 
Последнее редактирование:

sergey3695

Ветеран
Модератор
как изменить надпись на скрине SetupAppTitle на странице завершения не срабатывает с исдоном. :unknown:
 
Статус
В этой теме нельзя размещать новые ответы.
Сверху