Setup: Fix crash if ROM was present.

This commit is contained in:
Fabian Dill 2021-08-07 08:05:01 +02:00
parent a0fb9bc4ab
commit 3441c390bd
1 changed files with 10 additions and 3 deletions

View File

@ -127,7 +127,8 @@ end;
var ROMFilePage: TInputFileWizardPage;
var R : longint;
var rom: string;
procedure InitializeWizard();
procedure AddRomPage();
begin
rom := FileSearch('Zelda no Densetsu - Kamigami no Triforce (Japan).sfc', WizardDirValue());
if Length(rom) > 0 then
@ -155,10 +156,16 @@ begin
'.sfc');
end;
procedure InitializeWizard();
begin
AddRomPage();
end;
function ShouldSkipPage(PageID: Integer): Boolean;
begin
Result := False;
if PageID = ROMFilePage.ID then
if (assigned(ROMFilePage)) and (PageID = ROMFilePage.ID) then
Result := not (WizardIsComponentSelected('client/lttp') or WizardIsComponentSelected('generator'));
end;