|
#11
|
|||
|
|||
|
Common Code to extract Data/Component Files
Declare a global variable DiskSkip in the top
Code:
var DiskSkip: Boolean; 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;
|
| The Following 4 Users Say Thank You to Fak Eid For This Useful Post: | ||
|
|
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 |