Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials
Register FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #11  
Old 05-03-2024, 11:34
Fak Eid Fak Eid is offline
Registered User
 
Join Date: Jun 2023
Location: Mars
Posts: 147
Thanks: 98
Thanked 152 Times in 54 Posts
Fak Eid is on a distinguished road
Common Code to extract Data/Component Files

Declare a global variable DiskSkip in the top
Code:
var
DiskSkip: Boolean;
Updated changes here:
Code:
procedure CurStepChanged(CurStep: TSetupStep);
var
  i: Integer;
begin
  DiskSkip:= False;
  if CurStep = ssInstall then begin
    ISArcExCancel := 0;
    ISArcExDiskCount := 0;
    ISArcDiskAddingSuccess := False;
    ISArcExError := True;

    #include "Game/UnpackTools_Init.iss"
    { - ADDING DISKS: BEGIN -}
    repeat
      {< Main Archives >}
      #ifdef Data1
        VerifyFileExist('Data-01.bin');
        if DiskSkip then break;
      #endif
      #ifdef Data2
        VerifyFileExist('Data-02.bin');
        if DiskSkip then break;
      #endif

      {< Components >}
      #ifdef Component1
        if Checkbox[8].ISChecked then
        VerifyFileExist('selective-english.bin');
      #endif
      #ifdef Component2
        if Checkbox[9].ISChecked then
        VerifyFileExist('selective-bonus.bin');
      #endif
      until true;
    { - ADDING DISKS: END -}

      ISArcExStop;
      if ISArcExError then
        ShowMessage('Installation was interrupted', 'Either the installation has been cancelled by the user,' +#13+ 'or the files are corrupted.');
      end else if not (ISArcDiskAddingSuccess) and (DiskSkip) then
        ShowMessage('Installation is corrupted', 'Required disks could not be located.');

Common procedure to handle all Data files
Code:
procedure VerifyFileExist(FilePath: WideString);
var
  sPath, sFile: WideString;
  sExt: String;
begin
  sPAth := AddBackslash(ExpandConstant('{src}'));
  if FileExists(sPAth + FilePath) then begin
    ISArcDiskAddingSuccess:= ISArcExAddDisks(sPAth + FilePath, '{#DiskPassword}', ExpandConstant('{app}'));
    if not ISArcDiskAddingSuccess then begin
      DiskSkip:= True;
      Exit;
    end;
    ISArcExDiskCount := ISArcExDiskCount + 1;
  end else
    begin
    ShowMessage('Setup Needs the Next Disk', 'Please browse Disk: [ ' + FilePath +  ' ] after closing this prompt'#13#10'If this disk can be found in another folder, browse to the correct path.');
    sExt:= ExtractFileExt(FilePath); StringChange(sExt, '.', '');
    if OpenFileModern(FMXForm.HandleHWND, sExt, FilePath,  sPAth, 'Please specify the location of the next disk', sFile) then
    begin
      sPAth := ExtractFilePath(sFile);
      ISArcDiskAddingSuccess:= ISArcExAddDisks(sPAth + FilePath, '{#DiskPassword}', ExpandConstant('{app}'));
      if not ISArcDiskAddingSuccess then begin
        DiskSkip:= True;
        Exit;
      end;
      ISArcExDiskCount := ISArcExDiskCount + 1;
    end else begin
      ISArcDiskAddingSuccess := False;
      DiskSkip:= True;
      Exit;
    end;
  end;
end;
Reply With Quote
The Following 4 Users Say Thank You to Fak Eid For This Useful Post:
audiofeel (05-03-2024), Behnam2018 (05-03-2024), BLACKFIRE69 (05-03-2024), ScOOt3r (05-03-2024)
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows Fluent Effects Standalone API - InnoSetup / VCL / FXM BLACKFIRE69 Conversion Tutorials 0 15-11-2023 17:35
Windows Phone Installer similar to razor12911's original design? Kitsune1982 Conversion Tutorials 0 02-07-2020 13:04
INDEX - Conversion Tutorial Index Razor12911 Conversion Tutorials 5 11-06-2020 02:05
Frequently Asked Questions Joe Forster/STA PC Games - Frequently Asked Questions 0 29-11-2005 09:48



All times are GMT -7. The time now is 02:21.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com