View Single Post
  #4  
Old 21-11-2014, 05:25
Dante1995 Dante1995 is offline
Banned
 
Join Date: Feb 2014
Location: Black Hole
Posts: 297
Thanks: 116
Thanked 481 Times in 162 Posts
Dante1995 is on a distinguished road
that code works with a construct like this+ISDone Function: code Razor

Code:
[Files]
Source: ISDone\*; Flags: dontcopy;
[ Code]
procedure CurStepChanged(CurStep: TSetupStep);
var
  res, i, ResultCode: integer;
  Arc1, Arc2, Arc3: Array of String;
begin     

If CurStep = ssInstall then
begin
    ExtractTemporaryFile('arc.ini');
    ExtractTemporaryFile('unarc.dll');
    ExtractTemporaryFile('Setup.ini');
    ExtractTemporaryFile('english.ini');
    ExtractTemporaryFile('precomp.exe');
    ExtractTemporaryFile('CLS-MSC.dll');
    ExtractTemporaryFile('CLS-srep.dll');
    ExtractTemporaryFile('CLS-precomp.dll');

    ISDoneError:=false;
    i:=1;
    if (GetIniString('ExtractSettings' + IntToStr(i),'FreeArcFile','',ExpandConstant('{tmp}\Setup.ini')) <> '') then
    begin
    WizardForm.ProgressGauge.Max:=0;
    repeat
    WizardForm.ProgressGauge.Max:= WizardForm.ProgressGauge.Max + 1000;
    i:= i + 1;
    until (GetIniString('ExtractSettings' + IntToStr(i),'FreeArcFile','',ExpandConstant('{tmp}\Setup.ini')) = '');
    end;
    if ISDoneInit(ExpandConstant('{tmp}\records.inf'), $F777, 0,0,0, MainForm.Handle, 512, @ProgressCallback) then begin
      repeat
      ChangeLanguage('English');
      if not SrepInit('',512,0) then ISDoneError := True;
      if not PrecompInit('',128,0) then ISDoneError := True;
      if not FileSearchInit(true) then ISDoneError := True;
      
      i:=1;
      if (GetIniString('ExtractSettings' + IntToStr(i),'FreeArcFile','',ExpandConstant('{tmp}\Setup.ini')) <> '') then
      begin
      SetArrayLength(Arc1,4);
      SetArrayLength(Arc2,4);
      SetArrayLength(Arc3,4);
      repeat
      Arc1[0]:=ExpandConstant(GetIniString('ExtractSettings' + IntToStr(i),'FreeArcFile','',ExpandConstant('{tmp}\Setup.ini')));
      Arc1[1]:=ExpandConstant(GetIniString('ExtractSettings' + IntToStr(i),'Output','',ExpandConstant('{tmp}\Setup.ini')));
      Arc1[2]:=ExpandConstant(GetIniString('ExtractSettings' + IntToStr(i),'Disk','1',ExpandConstant('{tmp}\Setup.ini')));
      if Arc1[0] <> '' then
      begin
      if not FileExists(Arc1[0]) then
      begin
      if MsgBox('Insert disc: ' + Arc1[2], mbError, MB_OKCANCEL) = IDCANCEL then ISDoneError := True;
      end else begin
      if not ISArcExtract( 0, 0, Arc1[0], Arc1[1], '', false, Arc1[3], ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}'), False) then ISDoneError := True;
      i:= i + 1;
      end;
      end;
      until ((GetIniString('ExtractSettings' + IntToStr(i),'FreeArcFile','',ExpandConstant('{tmp}\Setup.ini')) = '') or (ISDoneError = True));
    end;
    until true;
    ISDoneStop;
    end;
  end;
  
  if (CurStep=ssPostInstall) and ISDoneError then begin
    Exec(ExpandConstant('{uninstallexe}'), '/VERYSILENT','', sw_Hide, ewWaitUntilTerminated, ResultCode);
    WizardForm.StatusLabel.Caption:=SetupMessage(msgStatusRollback);
  end;

CIU is complete, what do you want to do is not clear??

Last edited by Dante1995; 21-11-2014 at 05:35.
Reply With Quote