Inno Setup. Сделайте за меня

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

Mailchik

Старожил
Проверенный
kassane,
Код:
[Setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={pf}\My Application

[B][[/B]Code]
procedure InitializeWizard;
 begin
  with WizardForm do begin
   WizardBitmapImage.Width := ClientWidth;
   WizardSmallBitmapImage.Left := MainPanel.Left;
   WizardSmallBitmapImage.Width := MainPanel.Width;
   WelcomeLabel1.Hide;
   WelcomeLabel2.Hide;
   PageNameLabel.Hide;
   PageDescriptionLabel.Hide;
  end;
end;
 

kassane

Новичок
Someone has the [custom messages] HWREQv1.11 in the ENGLISH language?


Код:
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "My Program"
#define MyAppVersion "1.5"
#define MyAppPublisher "My Company, Inc."
#define MyAppURL "http://www.example.com/"
#define MyAppExeName "MyProg.exe"

;ADVANCED SCRIPT ZONE (ISDONE FINAL VERSION)

#define NeedSize "500000"
#define NeedMem 512
;#define SecondProgressBar
;#define records
#define facompress
;#define PrecompInside
;#define SrepInside
;#define MSCInside
;#define precomp "0.42"
;#define unrar
;#define XDelta
;#define PackZIP

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{31A1FF1C-91C4-489E-92CC-E778A21EB771}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
#ifdef NeedSize
ExtraDiskSpaceRequired={#NeedSize}
#endif
DefaultGroupName={#MyAppName}
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
OutputDir=.
WizardImageFile=C:\Users\Catarino\Desktop\Nova pasta\Resources\Wizard\BIG.bmp
WizardSmallImageFile=C:\Users\Catarino\Desktop\Nova pasta\Resources\Wizard\SMALL.bmp

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: VCCheck; Description: Install Microsoft Visual C++ 2005 Redist
Name: PhysXCheck; Description: Install Nvidia PhysX

[Files]
Source: "C:\Program Files (x86)\Inno Setup 5\Examples\MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion
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
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
; Add the ISSkin DLL used for skinning Inno Setup installations.
Source: Include\ISSkin.dll; DestDir: {app}; Flags: dontcopy

; Add the Visual Style resource contains resources used for skinning,
; you can also use Microsoft Visual Styles (*.msstyles) resources.
Source: Include\Theme.cjstyles; DestDir: {tmp}; Flags: dontcopy

[CustomMessages]
english.ExtractedFile=Current File:
english.Extracted=Installing...
english.CancelButton=Cancel
english.Error=Error
english.ElapsedTime=Elapsed: 
english.RemainingTime=Remaining:
english.EstimatedTime=Estimated:
english.AllElapsedTime=Total:

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

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

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
Filename: {src}\Redist\vcredist_x86.exe; Parameters: /q; StatusMsg: Óñòàíàâëèâàåì Microsoft Visual C++ 2005 Redist...; Flags: skipifdoesntexist; Tasks: VCCheck; Check: CheckError
Filename: {src}\Redist\PhysX.exe; Parameters: /qn; StatusMsg: Óñòàíàâëèâàåì Nvidia PhysX...; Flags: skipifdoesntexist; Tasks: PhysXCheck; Check: CheckError

[ Code]
procedure InitializeWizard;
 begin
  with WizardForm do begin
   WizardBitmapImage.Width := ClientWidth;
   WizardSmallBitmapImage.Left := MainPanel.Left;
   WizardSmallBitmapImage.Width := MainPanel.Width;
   WelcomeLabel1.Hide;
   WelcomeLabel2.Hide;
   PageNameLabel.Hide;
   PageDescriptionLabel.Hide;
  end;
end;
// Importing LoadSkin API from ISSkin.DLL
procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
external 'LoadSkin@files:isskin.dll stdcall';

// Importing UnloadSkin API from ISSkin.DLL
procedure UnloadSkin();
external 'UnloadSkin@files:isskin.dll stdcall';

// Importing ShowWindow Windows API from User32.DLL
function ShowWindow(hWnd: Integer; uType: Integer): Integer;
external 'ShowWindow@user32.dll stdcall';
function InitializeSetup(): Boolean;
begin
  ExtractTemporaryFile('Theme.cjstyles');
  LoadSkin(ExpandConstant('{tmp}\Theme.cjstyles'), '');
  Result := True;
end; 
procedure DeinitializeSetup();
begin
  // Hide Window before unloading skin so user does not get
  // a glimpse of an unskinned window before it is closed.
  ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);
  UnloadSkin();
end; 
const
  PCFonFLY=true;
  notPCFonFLY=false;
var
  LabelPct1,LabelCurrFileName,LabelTime1,LabelTime2,LabelTime3: TLabel;
  ISDoneProgressBar1: TNewProgressBar;
#ifdef SecondProgressBar
  LabelPct2: TLabel;
  ISDoneProgressBar2:TNewProgressBar;
#endif
  MyCancelButton: TButton;
  ISDoneCancel:integer;
  ISDoneError: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)+'%';
#ifdef SecondProgressBar
  if CurrentPct<=1000 then ISDoneProgressBar2.Position := CurrentPct;
  LabelPct2.Caption := IntToStr(CurrentPct div 10)+'.'+chr(48 + CurrentPct mod 10)+'%';
#endif
  LabelCurrFileName.Caption:=ExpandConstant('{cm:ExtractedFile} ')+MinimizePathName(CurrentFile, LabelCurrFileName.Font, LabelCurrFileName.Width-ScaleX(100));
  LabelTime1.Caption:=ExpandConstant('{cm:ElapsedTime} ')+TimeStr2;
  LabelTime2.Caption:=ExpandConstant('{cm:RemainingTime} ')+TimeStr1;
  LabelTime3.Caption:=ExpandConstant('{cm:AllElapsedTime}')+TimeStr3;
  Result := ISDoneCancel;
end;

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

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

procedure CreateControls;
var PBTop:integer;
begin
  PBTop:=ScaleY(50);
  ISDoneProgressBar1 := TNewProgressBar.Create(WizardForm);
  with ISDoneProgressBar1 do begin
    Parent   := WizardForm.InstallingPage;
    Height   := WizardForm.ProgressGauge.Height;
    Left     := ScaleX(0);
    Top      := PBTop;
    Width    := ScaleX(365);
    Max      := 1000;
  end;
  LabelPct1 := TLabel.Create(WizardForm);
  with LabelPct1 do begin
    Parent    := WizardForm.InstallingPage;
    AutoSize  := False;
    Left      := ISDoneProgressBar1.Width+ScaleX(5);
    Top       := ISDoneProgressBar1.Top + ScaleY(2);
    Width     := ScaleX(80);
  end;
  LabelCurrFileName := TLabel.Create(WizardForm);
  with LabelCurrFileName do begin
    Parent   := WizardForm.InstallingPage;
    AutoSize := False;
    Width    := ISDoneProgressBar1.Width+ScaleX(30);
    Left     := ScaleX(0);
    Top      := ScaleY(30);
  end;
#ifdef SecondProgressBar
  PBTop:=PBTop+ScaleY(25);
  ISDoneProgressBar2 := TNewProgressBar.Create(WizardForm);
  with ISDoneProgressBar2 do begin
    Parent   := WizardForm.InstallingPage;
    Left     := ScaleX(0);
    Top      := PBTop+ScaleY(8);
    Width    := ISDoneProgressBar1.Width;
    Max      := 1000;
    Height   := WizardForm.ProgressGauge.Height;
  end;
  LabelPct2 := TLabel.Create(WizardForm);
  with LabelPct2 do begin
    Parent    := WizardForm.InstallingPage;
    AutoSize  := False;
    Left      := ISDoneProgressBar2.Width+ScaleX(5);
    Top       := ISDoneProgressBar2.Top + ScaleY(2);
    Width     := ScaleX(80);
  end;
#endif
  LabelTime1 := TLabel.Create(WizardForm);
  with LabelTime1 do begin
    Parent   := WizardForm.InstallingPage;
    AutoSize := False;
    Width    := ISDoneProgressBar1.Width div 2;
    Left     := ScaleX(0);
    Top      := PBTop + ScaleY(35);
  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(360);
    Top:=WizardForm.cancelbutton.top;
    OnClick:=@CancelButtonOnClick;
  end;
end;

Procedure CurPageChanged(CurPageID: Integer);
Begin
  if (CurPageID = wpFinished) and ISDoneError then
  begin
    LabelTime3.Hide;
    WizardForm.Caption:= ExpandConstant('{cm:Error}');
    WizardForm.FinishedLabel.Font.Color:= clRed;
    WizardForm.FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
  end;
end;

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

procedure CurStepChanged(CurStep: TSetupStep);
var Comps1,Comps2,Comps3, TmpValue:cardinal;
    FindHandle1,ColFiles1,CurIndex1,tmp:integer;
    ExecError:boolean;
    InFilePath,OutFilePath,OutFileName:PAnsiChar;
begin
  if CurStep = ssInstall then begin  //Åñëè íåîáõîäèìî, ìîæíî ïîìåíÿòü íà ssPostInstall
    WizardForm.ProgressGauge.Hide;
    WizardForm.CancelButton.Hide;
    CreateControls;
    WizardForm.StatusLabel.Caption:=ExpandConstant('{cm:Extracted}');
    ISDoneCancel:=0;

// Ðàñïàêîâêà âñåõ íåîáõîäèìûõ ôàéëîâ â ïàïêó {tmp}.

ExtractTemporaryFile('unarc.dll');

#ifdef PrecompInside
ExtractTemporaryFile('CLS-precomp.dll');
ExtractTemporaryFile('packjpg_dll.dll');
ExtractTemporaryFile('packjpg_dll1.dll');
ExtractTemporaryFile('precomp.exe');
ExtractTemporaryFile('zlib1.dll');
#endif
#ifdef SrepInside
ExtractTemporaryFile('CLS-srep.dll');
#endif
#ifdef MSCInside
ExtractTemporaryFile('CLS-MSC.dll');
#endif
#ifdef facompress
    ExtractTemporaryFile('facompress.dll'); //óñêîðÿåò ðàñïàêîâêó .arc àðõèâîâ.
#endif
#ifdef records
    ExtractTemporaryFile('records.inf');
#endif
#ifdef precomp
  #if precomp == "0.38"
    ExtractTemporaryFile('precomp038.exe');
  #else
    #if precomp == "0.4"
      ExtractTemporaryFile('precomp040.exe');
    #else
      #if precomp == "0.41"
        ExtractTemporaryFile('precomp041.exe');
      #else
        #if precomp == "0.42"
          ExtractTemporaryFile('precomp042.exe');
        #else
          ExtractTemporaryFile('precomp038.exe');
          ExtractTemporaryFile('precomp040.exe');
          ExtractTemporaryFile('precomp041.exe');
          ExtractTemporaryFile('precomp042.exe');
        #endif
      #endif
    #endif
  #endif
#endif
#ifdef unrar
    ExtractTemporaryFile('Unrar.dll');
#endif
#ifdef XDelta
    ExtractTemporaryFile('XDelta3.dll');
#endif
#ifdef PackZIP
    ExtractTemporaryFile('7z.dll');
    ExtractTemporaryFile('PackZIP.exe');
#endif

    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
    ISDoneError:=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}\*.cab'), 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;
*)

        ISDoneError:=false;
      until true;
      ISDoneStop;
    end;
    HideControls;
    WizardForm.CancelButton.Visible:=true;
    WizardForm.CancelButton.Enabled:=false;
  end;
  if (CurStep=ssPostInstall) and ISDoneError then begin
    Exec2(ExpandConstant('{uninstallexe}'), '/VERYSILENT', false);
  end;
end;
English:
What is wrong with my script?

русский:
Что не так с моим сценарием?
 
Последнее редактирование:

LexBell

Борода
Супер модератор
kassane, прямо в модуле, секция [CustomMessages], там сообщения которые есть - вешаешь на русския язык, а на английский делаешь эти-же сообщения но со свои текстом.
 

petruxa

Новичок
Ребят помогите привязать к этому скрипту ( http://rghost.ru/41700956 ) splash лого,Чтоб при запуске инстала появлялось лого.
Буду очень благодарен!)
 

petruxa

Новичок
Mailchik Огромное тебе спасибо!) Жил бы в моем городе Угостил бы Пивом))
 

kassane

Новичок
Код:
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "My Program"
#define MyAppVersion "1.5"
#define MyAppPublisher "My Company, Inc."
#define MyAppURL "http://www.example.com/"
#define MyAppExeName "MyProg.exe"

;ADVANCED SCRIPT ZONE (ISDONE FINAL VERSION)

#define NeedSize "500000"
#define NeedMem 512
;#define SecondProgressBar
;#define records
#define facompress
;#define PrecompInside
;#define SrepInside
;#define MSCInside
;#define precomp "0.42"
;#define unrar
;#define XDelta
;#define PackZIP

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{31A1FF1C-91C4-489E-92CC-E778A21EB771}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
#ifdef NeedSize
ExtraDiskSpaceRequired={#NeedSize}
#endif
DefaultGroupName={#MyAppName}
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
OutputDir=.
WizardImageFile=C:\Users\Catarino\Desktop\Nova pasta\Resources\Wizard\BIG.bmp
WizardSmallImageFile=C:\Users\Catarino\Desktop\Nova pasta\Resources\Wizard\SMALL.bmp

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: VCCheck; Description: Install Microsoft Visual C++ 2005 Redist
Name: PhysXCheck; Description: Install Nvidia PhysX

[Files]
Source: "C:\Program Files (x86)\Inno Setup 5\Examples\MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion
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
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
; Add the ISSkin DLL used for skinning Inno Setup installations.
Source: Include\ISSkin.dll; DestDir: {app}; Flags: dontcopy

; Add the Visual Style resource contains resources used for skinning,
; you can also use Microsoft Visual Styles (*.msstyles) resources.
Source: Include\Theme.cjstyles; DestDir: {tmp}; Flags: dontcopy

[CustomMessages]
english.ExtractedFile=Current File:
english.Extracted=Installing...
english.CancelButton=Cancel
english.Error=Error
english.ElapsedTime=Elapsed: 
english.RemainingTime=Remaining:
english.EstimatedTime=Estimated:
english.AllElapsedTime=Total:

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

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

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
Filename: {src}\Redist\vcredist_x86.exe; Parameters: /q; StatusMsg: Óñòàíàâëèâàåì Microsoft Visual C++ 2005 Redist...; Flags: skipifdoesntexist; Tasks: VCCheck; Check: CheckError
Filename: {src}\Redist\PhysX.exe; Parameters: /qn; StatusMsg: Óñòàíàâëèâàåì Nvidia PhysX...; Flags: skipifdoesntexist; Tasks: PhysXCheck; Check: CheckError

[ Code]
procedure InitializeWizard;
 begin
  with WizardForm do begin
   WizardBitmapImage.Width := ClientWidth;
   WizardSmallBitmapImage.Left := MainPanel.Left;
   WizardSmallBitmapImage.Width := MainPanel.Width;
   WelcomeLabel1.Hide;
   WelcomeLabel2.Hide;
   PageNameLabel.Hide;
   PageDescriptionLabel.Hide;
  end;
end;
// Importing LoadSkin API from ISSkin.DLL
procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
external 'LoadSkin@files:isskin.dll stdcall';

// Importing UnloadSkin API from ISSkin.DLL
procedure UnloadSkin();
external 'UnloadSkin@files:isskin.dll stdcall';

// Importing ShowWindow Windows API from User32.DLL
function ShowWindow(hWnd: Integer; uType: Integer): Integer;
external 'ShowWindow@user32.dll stdcall';
function InitializeSetup(): Boolean;
begin
  ExtractTemporaryFile('Theme.cjstyles');
  LoadSkin(ExpandConstant('{tmp}\Theme.cjstyles'), '');
  Result := True;
end; 
procedure DeinitializeSetup();
begin
  // Hide Window before unloading skin so user does not get
  // a glimpse of an unskinned window before it is closed.
  ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);
  UnloadSkin();
end; 
const
  PCFonFLY=true;
  notPCFonFLY=false;
var
  LabelPct1,LabelCurrFileName,LabelTime1,LabelTime2,LabelTime3: TLabel;
  ISDoneProgressBar1: TNewProgressBar;
#ifdef SecondProgressBar
  LabelPct2: TLabel;
  ISDoneProgressBar2:TNewProgressBar;
#endif
  MyCancelButton: TButton;
  ISDoneCancel:integer;
  ISDoneError: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)+'%';
#ifdef SecondProgressBar
  if CurrentPct<=1000 then ISDoneProgressBar2.Position := CurrentPct;
  LabelPct2.Caption := IntToStr(CurrentPct div 10)+'.'+chr(48 + CurrentPct mod 10)+'%';
#endif
  LabelCurrFileName.Caption:=ExpandConstant('{cm:ExtractedFile} ')+MinimizePathName(CurrentFile, LabelCurrFileName.Font, LabelCurrFileName.Width-ScaleX(100));
  LabelTime1.Caption:=ExpandConstant('{cm:ElapsedTime} ')+TimeStr2;
  LabelTime2.Caption:=ExpandConstant('{cm:RemainingTime} ')+TimeStr1;
  LabelTime3.Caption:=ExpandConstant('{cm:AllElapsedTime}')+TimeStr3;
  Result := ISDoneCancel;
end;

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

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

procedure CreateControls;
var PBTop:integer;
begin
  PBTop:=ScaleY(50);
  ISDoneProgressBar1 := TNewProgressBar.Create(WizardForm);
  with ISDoneProgressBar1 do begin
    Parent   := WizardForm.InstallingPage;
    Height   := WizardForm.ProgressGauge.Height;
    Left     := ScaleX(0);
    Top      := PBTop;
    Width    := ScaleX(365);
    Max      := 1000;
  end;
  LabelPct1 := TLabel.Create(WizardForm);
  with LabelPct1 do begin
    Parent    := WizardForm.InstallingPage;
    AutoSize  := False;
    Left      := ISDoneProgressBar1.Width+ScaleX(5);
    Top       := ISDoneProgressBar1.Top + ScaleY(2);
    Width     := ScaleX(80);
  end;
  LabelCurrFileName := TLabel.Create(WizardForm);
  with LabelCurrFileName do begin
    Parent   := WizardForm.InstallingPage;
    AutoSize := False;
    Width    := ISDoneProgressBar1.Width+ScaleX(30);
    Left     := ScaleX(0);
    Top      := ScaleY(30);
  end;
#ifdef SecondProgressBar
  PBTop:=PBTop+ScaleY(25);
  ISDoneProgressBar2 := TNewProgressBar.Create(WizardForm);
  with ISDoneProgressBar2 do begin
    Parent   := WizardForm.InstallingPage;
    Left     := ScaleX(0);
    Top      := PBTop+ScaleY(8);
    Width    := ISDoneProgressBar1.Width;
    Max      := 1000;
    Height   := WizardForm.ProgressGauge.Height;
  end;
  LabelPct2 := TLabel.Create(WizardForm);
  with LabelPct2 do begin
    Parent    := WizardForm.InstallingPage;
    AutoSize  := False;
    Left      := ISDoneProgressBar2.Width+ScaleX(5);
    Top       := ISDoneProgressBar2.Top + ScaleY(2);
    Width     := ScaleX(80);
  end;
#endif
  LabelTime1 := TLabel.Create(WizardForm);
  with LabelTime1 do begin
    Parent   := WizardForm.InstallingPage;
    AutoSize := False;
    Width    := ISDoneProgressBar1.Width div 2;
    Left     := ScaleX(0);
    Top      := PBTop + ScaleY(35);
  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(360);
    Top:=WizardForm.cancelbutton.top;
    OnClick:=@CancelButtonOnClick;
  end;
end;

Procedure CurPageChanged(CurPageID: Integer);
Begin
  if (CurPageID = wpFinished) and ISDoneError then
  begin
    LabelTime3.Hide;
    WizardForm.Caption:= ExpandConstant('{cm:Error}');
    WizardForm.FinishedLabel.Font.Color:= clRed;
    WizardForm.FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
  end;
end;

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

procedure CurStepChanged(CurStep: TSetupStep);
var Comps1,Comps2,Comps3, TmpValue:cardinal;
    FindHandle1,ColFiles1,CurIndex1,tmp:integer;
    ExecError:boolean;
    InFilePath,OutFilePath,OutFileName:PAnsiChar;
begin
  if CurStep = ssInstall then begin  //Åñëè íåîáõîäèìî, ìîæíî ïîìåíÿòü íà ssPostInstall
    WizardForm.ProgressGauge.Hide;
    WizardForm.CancelButton.Hide;
    CreateControls;
    WizardForm.StatusLabel.Caption:=ExpandConstant('{cm:Extracted}');
    ISDoneCancel:=0;

// Ðàñïàêîâêà âñåõ íåîáõîäèìûõ ôàéëîâ â ïàïêó {tmp}.

ExtractTemporaryFile('unarc.dll');

#ifdef PrecompInside
ExtractTemporaryFile('CLS-precomp.dll');
ExtractTemporaryFile('packjpg_dll.dll');
ExtractTemporaryFile('packjpg_dll1.dll');
ExtractTemporaryFile('precomp.exe');
ExtractTemporaryFile('zlib1.dll');
#endif
#ifdef SrepInside
ExtractTemporaryFile('CLS-srep.dll');
#endif
#ifdef MSCInside
ExtractTemporaryFile('CLS-MSC.dll');
#endif
#ifdef facompress
    ExtractTemporaryFile('facompress.dll'); //óñêîðÿåò ðàñïàêîâêó .arc àðõèâîâ.
#endif
#ifdef records
    ExtractTemporaryFile('records.inf');
#endif
#ifdef precomp
  #if precomp == "0.38"
    ExtractTemporaryFile('precomp038.exe');
  #else
    #if precomp == "0.4"
      ExtractTemporaryFile('precomp040.exe');
    #else
      #if precomp == "0.41"
        ExtractTemporaryFile('precomp041.exe');
      #else
        #if precomp == "0.42"
          ExtractTemporaryFile('precomp042.exe');
        #else
          ExtractTemporaryFile('precomp038.exe');
          ExtractTemporaryFile('precomp040.exe');
          ExtractTemporaryFile('precomp041.exe');
          ExtractTemporaryFile('precomp042.exe');
        #endif
      #endif
    #endif
  #endif
#endif
#ifdef unrar
    ExtractTemporaryFile('Unrar.dll');
#endif
#ifdef XDelta
    ExtractTemporaryFile('XDelta3.dll');
#endif
#ifdef PackZIP
    ExtractTemporaryFile('7z.dll');
    ExtractTemporaryFile('PackZIP.exe');
#endif

    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
    ISDoneError:=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}\*.cab'), 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;
*)

        ISDoneError:=false;
      until true;
      ISDoneStop;
    end;
    HideControls;
    WizardForm.CancelButton.Visible:=true;
    WizardForm.CancelButton.Enabled:=false;
  end;
  if (CurStep=ssPostInstall) and ISDoneError then begin
    Exec2(ExpandConstant('{uninstallexe}'), '/VERYSILENT', false);
  end;
end;
English:
What is wrong with my script?

русский:
Что не так с моим сценарием?
My Script

Please check script has something wrong, and if someone could add music and HQREW ...
Пожалуйста, проверьте скрипт что-то не так, и если кто-то может добавить музыку и HQREW ...
 

audiofeel

Старожил
Всем доброй ночи! Никак не выходит прикрутить msi инсталлятор "Физикса". Кнопку вроде получилось повторить (активная). Скрипт не мой = "Закос под Black Box". нашел на этом сайте пару примеров - не получается, или проходит всё "молча" или установшик останавливается (кнопка отмена не активна). вот пример на что хватило "знаний"
if CurStep=ssInstall then begin
if DirectXCB.Checked then begin
Status.Caption:='Установка DirectX...';
Exec2(ExpandConstant('{src}\DirectX\DXSETUP.exe'),'/silent',false);
end;
if VisualCCB.Checked then begin
Status.Caption:='Установка Visual C++...';
Exec2(ExpandConstant('{src}\Redist\vcredist_x86.exe'),'/q:a',false);
end;
if PhysXCB.Checked then begin
Status.Caption:='Установка PhysX...';
Exec2(ExpandConstant('{src}\PhysX\PhysX_9.12.1031_SystemSoftware.msi'),'/',false);
end;
как "прятать" код не разобрался
 

Mailchik

Старожил
Проверенный
audiofeel,
Код:
if CurStep=ssInstall then begin
if DirectXCB.Checked then begin
Status.Caption:='Установка DirectX...';
Exec2(ExpandConstant('{src}\DirectX\DXSETUP.exe'), '/silent',false);
end;
if VisualCCB.Checked then begin
Status.Caption:='Установка Visual C++...';
Exec2(ExpandConstant('{src}\Redist\vcredist_x86.ex e'),'/q:a',false);
end;
if PhysXCB.Checked then begin
Status.Caption:='Установка PhysX...';
Exec2(ExpandConstant('{src}\PhysX\PhysX_9.12.1031_ SystemSoftware.msi'),'[B]/qn[/B]',false);
end;
Evilboy,
Код:
[Setup]
AppName=My Program
AppVerName=My Program
DefaultDirName={pf}\My Program
OutputDir=.

[Files]
Source: {sys}\*.dll; DestDir: {app}; Flags: external deleteafterinstall;

[B][[/B]code]
var
  MyCheck: TCheckBox;

procedure StandartForm();
begin
  with WizardForm do
  begin
    ClientWidth := ScaleX(497);
    ClientHeight := ScaleY(360);
    Center;
    Bevel.Show;
    Bevel1.Show;
    MainPanel.Show;
    with InnerNotebook do
    begin
      Left := ScaleX(40);
      Top := ScaleY(72);
      Width := ScaleX(417);
    end;
    with StatusLabel do
      Width := ScaleX(417);

    with FileNameLabel do
    begin
      ScaleY(16);
      Width := ScaleX(417);
    end;
    with ProgressGauge do
    begin
      Top := ScaleY(42);
      Width := ScaleX(417);
    end;
    with CancelButton do
    begin
      Left := ScaleX(412);
      Top := ScaleY(327);
    end;
  end;
  with MyCheck do
    Top := ScaleY(330);
end;

procedure MyNewForm();
begin
  with WizardForm do
  begin
    ClientWidth := ScaleX(395);
    ClientHeight := ScaleY(120);
    Center;
    Bevel.Hide;
    Bevel1.Hide;
    MainPanel.Hide;
    with InnerNotebook do
    begin
      Left := ScaleX(10);
      Top := ScaleY(10);
      Width := WizardForm.ClientWidth - ScaleX(20);
    end;
    with StatusLabel do
      Width := InnerNotebook.Width;

    with FileNameLabel do
    begin
      Top := ScaleY(20);
      Width := InnerNotebook.Width;
    end;
    with ProgressGauge do
    begin
      Top := ScaleY(40);
      Width := InnerNotebook.Width;
    end;
    with CancelButton do
    begin
      Left := WizardForm.ClientWidth div 2 - CancelButton.Width div 2;
      Top := WizardForm.ClientHeight - CancelButton.Height - ScaleY(10);
      BringToFront;
    end;
  end;
  with MyCheck do
    Top := WizardForm.CancelButton.Top;
end;

procedure GetWizardForm(Sender: TObject);
begin
  if MyCheck.Checked then
    MyNewForm()
  else
  StandartForm();
end;

procedure InitializeWizard();
begin
  MyCheck := TCheckBox.Create(WizardForm);
  with MyCheck do
  begin
    Left := ScaleX(10);
    Top := ScaleY(330);
    Width := ScaleX(150);
    Caption := 'Компактный размер';
    OnClick := @GetWizardForm;
    Parent := WizardForm;
  end;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
  MyCheck.Hide;
  if CurPageID = wpInstalling then
    MyCheck.Show;
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
  if CurStep = ssPostInstall then
   MyCheck.Checked := False;
end;
 

audiofeel

Старожил
Mailchik, не получается. не запускается PhysX. установка продолжается бес ошибок. (физикс удалил специально до этого)
 

Snoopak96

Старожил
audiofeel,
Накидал на быструю руку, в инно не компилил, проверяй:
Код:
[Run]
Filename: {src}\redist\dxwebsetup.exe; Parameters: /q; Check: CheckError and CheckDirectX;
Filename: {src}\redist\vcredist_x86.exe; Parameters: /q; Check: CheckError and CheckVisual;
Filename: msiexec.exe; Parameters: "-i ""{src}\redist\PhysX_9.10.0513_SystemSoftware.msi"" /qn"; Check: CheckError and CheckPhysX;

[______code]
.....
.....
.....
function CheckError:boolean;
begin
  result:= not ISDoneError;
end;

function CheckDirectX:boolean;
begin
  Status.Caption:='Установка DirectX...';
  result:= DirectXCB.Checked;
end;

function CheckVisual:boolean;
begin
  Status.Caption:='Установка Visual C++...';
  result:= VisualCCB.Checked;
end;

function CheckPhysX:boolean;
begin
  Status.Caption:='Установка PhysX...';
  result:= PhysXCB.Checked;
end;
 
Последнее редактирование:

petruxa

Новичок
Ребят! в чем может быть проблема? Установка доп софта происходит даже если убрать с него галочки в инстале,все равно устанавлюет.
Как сделать,чтоб пользователь мог сам выбирать,что надо,что не надо.Даже если убрать все галочки в инстале все равно весь доп Софт устанавлюется.,
Заранее спасибо!
Скрипт ( http://rghost.ru/41744587 )
 

Avalon

Мимокрокодил
Помогите пожалуйста, всё время после установки игры вылетает ошибка "не удаётся найти указанный файл" хотя всё правильно указываю! :unknown:


[Run]
Filename: {src}\support\steam\SteamInstall.exe; WorkingDir: {src}\support\steam\; Flags: runascurrentuser; Tasks: steam; StatusMsg: "Installing Steam..."

[ADMIN="Krinkels"]Картинки под спойлер![/ADMIN]
 

manstopper

Мимокрокодил
Использую скрипт из FAQ для проверки свободного места. А как помимо проверки места для установки по выбранному пути еще и проверить место на системном диске? Ну, чтобы было 3 проверки - "Для установки требуется...", "После установки игра займет...", "На системном диске требуется...". Иногда, например, нужно для модов, которые ставятся в Мои документы.
 

Mailchik

Старожил
Проверенный
manstopper,
Код:
#define NeedSize 4380
#define NeedInstallSize 7890
#define NeedSysSize 25000    ;Требуется на системном диске места

[Setup]
AppName=MyApp
AppVerName=MyApp
DefaultDirname={pf}\MyApp

[B][[/B]code]
var
  TotalSpaceLabel, FreeSpaceLabel, NeedSpacelabel, InstallSpaceLabel, SysSpaceLabel, NeedSysSpaceLabel: TLabel;
  FreeMB, TotalMB, SysFreeMB, SysTotalMB : Cardinal;

function NumToStr(Float: Extended): String;
begin
  Result:= format('%.2n', [Float]); StringChange(Result, ',', '.');
  while (Result[Length(Result)] = '0')or((Result[Length(Result)] = '.')and(Pos('.', Result) > 0)) do
    SetLength(Result, Length(Result)-1);
end;

function MbOrTb(Float: Extended): String;
begin
  if Float < 1024 then Result:= NumToStr(Float)+' Мб' else
    if Float/1024 < 1024 then Result:= NumToStr(Float/1024)+' Гб' else
      Result:= NumToStr(Float/(1024*1024))+' Тб';
end;

procedure DirEditOnChange(Sender: TObject);
var Drive: String;
begin
  Drive:= ExtractFileDrive(WizardForm.DirEdit.Text);
  GetSpaceOnDisk(Drive, True, FreeMB, TotalMB);
  GetSpaceOnDisk(ExpandConstant('{sd}'), True, SysFreeMB, SysTotalMB);
  SysSpaceLabel.Caption:= 'Доступно места на системном диске: '+MbOrTb(SysFreeMB); //доступно места на системном диске
  NeedSysSpaceLabel.Caption:= 'Требуется места на системном диске: '+MbOrTb({#NeedSysSize}); //требуется места на системном диске
  TotalSpaceLabel.Caption:= 'Всего места на диске: '+MbOrTb(TotalMB);
  FreeSpaceLabel.Caption:= 'Доступно места на диске: '+MbOrTb(FreeMB)+' ('+IntToStr(round(FreeMB*100/TotalMB))+'%)';
  InstallSpacelabel.Caption:= 'Требуется места для установки: '+MbOrTb({#NeedInstallSize});
  NeedSpaceLabel.Caption:= 'Требуется места на диске: '+MbOrTb({#NeedSize});
  WizardForm.NextButton.Enabled:= (FreeMB>{#NeedInstallSize})and(FreeMB>{#NeedSize})and(SysFreeMB>{#NeedSysSize});
end;

procedure InitializeWizard();
begin
  TotalSpaceLabel:= TLabel.Create(WizardForm);
  TotalSpaceLabel.AutoSize:= False;
  TotalSpaceLabel.SetBounds(0, 120, 300, 20);
  TotalSpaceLabel.Parent:= WizardForm.SelectDirpage;

  FreeSpaceLabel:= TLabel.Create(WizardForm);
  FreeSpaceLabel.AutoSize:= False;
  FreeSpaceLabel.SetBounds(0, 140, 300, 20);
  FreeSpaceLabel.Parent:= WizardForm.SelectDirpage;

  InstallSpacelabel:= TLabel.Create(WizardForm);
  InstallSpacelabel.AutoSize:= False;
  InstallSpacelabel.SetBounds(0, 160, 300, 20);
  InstallSpacelabel.Parent:= WizardForm.SelectDirpage;

  NeedSpaceLabel:= TLabel.Create(WizardForm);
  NeedSpaceLabel.AutoSize:= False;
  NeedSpaceLabel.SetBounds(0, 180, 300, 20);
  NeedSpaceLabel.Parent:= WizardForm.SelectDirpage;

  SysSpaceLabel:= TLabel.Create(WizardForm);
  SysSpaceLabel.AutoSize:= False;
  SysSpaceLabel.SetBounds(0, 100, 300, 20);
  SysSpaceLabel.Parent:= WizardForm.SelectDirpage;

  NeedSysSpaceLabel:= TLabel.Create(WizardForm);
  NeedSysSpaceLabel.AutoSize:= False;
  NeedSysSpaceLabel.SetBounds(0, 200, 300, 20);
  NeedSysSpaceLabel.Parent:= WizardForm.SelectDirpage;

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

procedure CurPageChanged(CurPageID: Integer);
begin
  if CurPageID=wpSelectDir then begin
    DirEditOnChange(nil)
  end;
end;
 

Avalon

Мимокрокодил
Блин подскажите как скрипт до isdone 0.6 final обновить? Уже часа 2 сижу и смотрю на ошибки при компиляции! :not-me:
 

kassane

Новичок
English:
Anyone know a code that can put video on the ANSI version installer? There's some code to change the color of progress bar?
How to change the color of the progress bar ISSkin?

русский:
Кто знает код, который может поставить видео на ANSI установки версии? Он имеет некоторый код, чтобы изменить цвет индикатора?
Как изменить цвет ISSkin прогресс бар?
 
Последнее редактирование:
Статус
В этой теме нельзя размещать новые ответы.
Сверху