Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function CheckDotNetVersion: Boolean;
- var
- DotNetVersion: TFindRec;
- begin
- Result := False;
- if FindFirst(ExpandConstant('{pf64}')+'\dotnet\host\fxr\*', DotNetVersion) then
- begin
- try
- repeat
- StringChangeEx(DotNetVersion.Name, '.', '', True);
- if (Copy(DotNetVersion.Name, 1, 1) = '8') or ((Copy(DotNetVersion.Name, 1, 1) = '7') and (StrToInt(DotNetVersion.Name) >= 7014)) then
- begin
- Result := True;
- Break;
- end;
- until not FindNext(DotNetVersion);
- finally
- FindClose(DotNetVersion);
- end;
- end;
- end;
- procedure CurStepChanged(CurStep: TSetupStep);
- var
- ResultCode: Integer;
- StatusText: string;
- begin
- if (CurStep = ssPostInstall) then
- begin
- if not CheckDotNetVersion then
- begin
- StatusText := WizardForm.StatusLabel.Caption;
- WizardForm.StatusLabel.Caption := CustomMessage('dotNETInstalling');
- WizardForm.ProgressGauge.Style := npbstMarquee;
- try
- if not Exec(ExpandConstant('{tmp}\dotnet.exe'), '/q', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
- MsgBox(CustomMessage('dotNETFailed') + IntToStr(ResultCode) + '.', mbError, MB_OK);
- finally
- WizardForm.StatusLabel.Caption := StatusText;
- WizardForm.ProgressGauge.Style := npbstNormal;
- end;
- end;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement