View Single Post
  #39  
Old 08-11-2017, 14:21
Razor12911's Avatar
Razor12911 Razor12911 is offline
Noob
 
Join Date: Jul 2012
Location: South Africa
Posts: 3,751
Thanks: 2,181
Thanked 11,211 Times in 2,309 Posts
Razor12911 is on a distinguished road
Code:
procedure ISDone_Unpack;
begin                                                   
  ISDone_Resources;
  ISDoneError:=false;
  if ISDoneInit(ExpandConstant('{tmp}\records.inf'), $F777, 0,0,0, MainForm.Handle, 512, @ProgressCallback) then
  begin
    ChangeLanguage('English');
    if SrepInit(AddBackSlash(ExpandConstant('{app}')),512 ,0) and PrecompInit('',128, 0) and FileSearchInit(true) then
    begin
      WizardForm.ProgressGauge.Position := 0;
      Wizardform.ProgressGauge.Max := 1000;
      ClsSourcePath(ExpandConstant('{src}'));
      ClsDiskRequest(@MyDiskRequest);
      if not ISArcExtract(0, 90, ExpandConstant('{src}\data.001'), ExpandConstant('{app}'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}'), false) then
      //here dear razor
      if not ISArcExtract(0, 10, ExpandConstant('{src}\data.arc'), ExpandConstant('{app}'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}'), false) then
        ISDoneError := True;
    end;
    ISDoneStop;
  end;
  if ISDoneError = True then
    WizardForm.CancelButton.OnClick(nil);
end;
this part here:

Code:
      if not ISArcExtract(0, 90, ExpandConstant('{src}\data.001'), ExpandConstant('{app}'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}'), false) then
      //here dear razor
      if not ISArcExtract(0, 10, ExpandConstant('{src}\data.arc'), ExpandConstant('{app}'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}'), false) then
        ISDoneError := True;
to properly write it, it's something like
Code:
if not ISArcExtract(0, 90, ExpandConstant('{src}\data.001'), ExpandConstant('{app}'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}'), false) then
  if not ISArcExtract(0, 10, ExpandConstant('{src}\data.arc'), ExpandConstant('{app}'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}'), false) then
     ISDoneError := True;
means if unpacking data.001 and if unpacking fails then unpack data.arc but if data.001 gets unpacked successfully, then don't unpack data.arc, not CLS-diskspan bug but your coding mistakes


you forgot to add ISDoneError := True for data.001, so to fix it, it has to be

Code:
procedure ISDone_Unpack;
begin                                                   
  ISDone_Resources;
  ISDoneError:=false;
  if ISDoneInit(ExpandConstant('{tmp}\records.inf'), $F777, 0,0,0, MainForm.Handle, 512, @ProgressCallback) then
  begin
    ChangeLanguage('English');
    if SrepInit(AddBackSlash(ExpandConstant('{app}')),512 ,0) and PrecompInit('',128, 0) and FileSearchInit(true) then
    begin
      WizardForm.ProgressGauge.Position := 0;
      Wizardform.ProgressGauge.Max := 1000;
      ClsSourcePath(ExpandConstant('{src}'));
      ClsDiskRequest(@MyDiskRequest);
      if not ISArcExtract(0, 90, ExpandConstant('{src}\data.001'), ExpandConstant('{app}'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}'), false) then
      	ISDoneError := True; // that is what you missed
      if not ISArcExtract(0, 10, ExpandConstant('{src}\data.arc'), ExpandConstant('{app}'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}'), false) then
        ISDoneError := True;
    end;
    ISDoneStop;
  end;
  if ISDoneError = True then
    WizardForm.CancelButton.OnClick(nil);
end;
Didn't run test, but it seemed like the obvious source of the problem in the script.
Reply With Quote
The Following 5 Users Say Thank You to Razor12911 For This Useful Post:
ADMIRAL (07-05-2020), danswano (08-11-2017), EzzEldin16 (11-11-2017), oltjon (08-11-2017), pakrat2k2 (08-11-2017)