I need to install some prerequisites for an app using Inno. I want the prerequisites to only install if the prerequisite does not exist or is an earlier version. I have found some solutions such as:
[Code]
procedure InstallFramework;
var
ResultCode: Integer;
begin
if not Exec(ExpandConstant('{tmp}\NDP472-KB4054530-x86-x64-AllOS-ENU.exe'), '/q /norestart', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
begin
{ you can interact with the user that the installation failed }
MsgBox('.NET installation failed with code: ' + IntToStr(ResultCode) + '.',
mbError, MB_OK);
end;
end;
That does not look like it checks to see if the framework exists already or what version may already be installed.
What is the pattern to use to look for a previously installed version, if it exists then check version and if version is older or does not exist then install?