From bd8e1f6531cd8f13203e09bddffd7f57c31b8c4e Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Sun, 14 Nov 2021 23:14:52 +0100 Subject: [PATCH] Setup: prevent clicking next when no rom file is selected. --- inno_setup_310.iss | 15 ++++++++++++--- inno_setup_38.iss | 11 ++++++++++- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/inno_setup_310.iss b/inno_setup_310.iss index 9a35073f..4e936728 100644 --- a/inno_setup_310.iss +++ b/inno_setup_310.iss @@ -327,7 +327,16 @@ begin MinecraftDownloadPage.Hide; end; Result := True; - end else + end + else if (assigned(LttPROMFilePage)) and (CurPageID = LttPROMFilePage.ID) then + Result := not (LttPROMFilePage.Values[0] = '') + else if (assigned(SMROMFilePage)) and (CurPageID = SMROMFilePage.ID) then + Result := not (SMROMFilePage.Values[0] = '') + else if (assigned(SoEROMFilePage)) and (CurPageID = SoEROMFilePage.ID) then + Result := not (SoEROMFilePage.Values[0] = '') + else if (assigned(OoTROMFilePage)) and (CurPageID = OoTROMFilePage.ID) then + Result := not (OoTROMFilePage.Values[0] = '') + else Result := True; end; @@ -383,7 +392,7 @@ function GetOoTROMPath(Param: string): string; begin if Length(ootrom) > 0 then Result := ootrom - else if Assigned(OoTROMFilePage) then + else if (Assigned(OoTROMFilePage)) then begin R := CompareStr(GetMD5OfFile(OoTROMFilePage.Values[0]), '5bd1fe107bf8106b2ab6650abecd54d6') * CompareStr(GetMD5OfFile(OoTROMFilePage.Values[0]), '6697768a7a7df2dd27a692a2638ea90b') * CompareStr(GetMD5OfFile(OoTROMFilePage.Values[0]), '05f0f3ebacbc8df9243b6148ffe4792f'); if R <> 0 then @@ -426,4 +435,4 @@ begin Result := not (WizardIsComponentSelected('generator/soe')); if (assigned(OoTROMFilePage)) and (PageID = OoTROMFilePage.ID) then Result := not (WizardIsComponentSelected('generator/oot')); -end; \ No newline at end of file +end; diff --git a/inno_setup_38.iss b/inno_setup_38.iss index 93d9cc64..8f005cac 100644 --- a/inno_setup_38.iss +++ b/inno_setup_38.iss @@ -327,7 +327,16 @@ begin MinecraftDownloadPage.Hide; end; Result := True; - end else + end + else if (assigned(LttPROMFilePage)) and (CurPageID = LttPROMFilePage.ID) then + Result := not (LttPROMFilePage.Values[0] = '') + else if (assigned(SMROMFilePage)) and (CurPageID = SMROMFilePage.ID) then + Result := not (SMROMFilePage.Values[0] = '') + else if (assigned(SoEROMFilePage)) and (CurPageID = SoEROMFilePage.ID) then + Result := not (SoEROMFilePage.Values[0] = '') + else if (assigned(OoTROMFilePage)) and (CurPageID = OoTROMFilePage.ID) then + Result := not (OoTROMFilePage.Values[0] = '') + else Result := True; end;