Skip to content

Commit

Permalink
Merge branch 'makeTLSIssueLouder' (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
rpottsoh committed Jul 27, 2018
2 parents cd6c362 + 612fbd9 commit 9c9cbf7
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 11 deletions.
6 changes: 2 additions & 4 deletions Delphi/Project/ExercismCLIInstaller.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,10 @@
<AppEnableHighDPI>true</AppEnableHighDPI>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<DCC_ExeOutput>Win32\Release</DCC_ExeOutput>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.5.1.2;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.5.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.5.2.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.5.2.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
<DCC_DcuOutput>Win32\Release</DCC_DcuOutput>
<VerInfo_MinorVer>5</VerInfo_MinorVer>
<VerInfo_Release>1</VerInfo_Release>
<VerInfo_AutoIncVersion>true</VerInfo_AutoIncVersion>
<VerInfo_Build>2</VerInfo_Build>
<VerInfo_Release>2</VerInfo_Release>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
Expand Down
16 changes: 12 additions & 4 deletions Delphi/Project/Source/uInstallLocationFrm.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,24 @@ object frmInstallLocation: TfrmInstallLocation
Transparent = True
end
object lblUpdateTLS: TOvcURL
Left = 189
Left = 127
Top = 248
Width = 262
Height = 13
Width = 386
Height = 19
Hint =
'https://support.microsoft.com/en-us/help/3140245/update-to-enabl' +
'e-tls-1-1-and-tls-1-2-as-a-default-secure-protocols-in'
Caption = 'Microsoft instructions for updating default TLS settings'
URL =
'https://support.microsoft.com/en-us/help/3140245/update-to-enabl' +
'e-tls-1-1-and-tls-1-2-as-a-default-secure-protocols-in'
Color = clRed
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Height = -16
Font.Name = 'Tahoma'
Font.Style = [fsUnderline]
ParentColor = False
ParentFont = False
ParentShowHint = False
ShowHint = True
Expand Down Expand Up @@ -6421,4 +6423,10 @@ object frmInstallLocation: TfrmInstallLocation
Left = 76
Top = 200
end
object tmrToggler: TTimer
Enabled = False
OnTimer = tmrTogglerTimer
Left = 508
Top = 192
end
end
20 changes: 17 additions & 3 deletions Delphi/Project/Source/uInstallLocationFrm.pas
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
unit uInstallLocationFrm;

{_define SimTLSCheckFailure}
interface

uses
Expand Down Expand Up @@ -61,12 +61,14 @@ TfrmInstallLocation = class(TForm)
lblUpdateTLS: TOvcURL;
tmrCheckTLS: TTimer;
imgV2Logo: TImage;
tmrToggler: TTimer;
procedure btnCancelClick(Sender: TObject);
procedure btnNextClick(Sender: TObject);
procedure btnBrowseClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure tmrCheckTLSTimer(Sender: TObject);
procedure tmrTogglerTimer(Sender: TObject);
private
{ Private declarations }
public
Expand Down Expand Up @@ -172,22 +174,29 @@ procedure TfrmInstallLocation.tmrCheckTLSTimer(Sender: TObject);
btnNext.Enabled := CheckTLS.TLSok;
if not btnNext.Enabled then
begin
tmrToggler.Enabled := true;
lblUpdateTLS.Visible := true;
MessageDlg(CheckTLS.ErrMessage,mtError,[mbok],0);
end;
end;

procedure TfrmInstallLocation.tmrTogglerTimer(Sender: TObject);
begin
lblUpdateTLS.Transparent := not lblUpdateTLS.Transparent;
end;

{ TCheckTLS }

constructor TCheckTLS.Create(aRESTRequest: TRestRequest; aRESTResponse: TRESTResponse);
var
actualVersion: double;
lFormatSettings: TFormatSettings;
begin
fTLSOK := false;
{$ifndef SimTLSCheckFailure}
aRESTRequest.Execute;
fStatusCode := aRESTResponse.StatusCode;
fMessageStr := '';
fTLSOK := false;
fTLSVersion := '';
if fStatusCode = 200 then
begin
Expand All @@ -203,13 +212,18 @@ constructor TCheckTLS.Create(aRESTRequest: TRestRequest; aRESTResponse: TRESTRes
if not fTLSOK then
fMessageStr := format('TLS Version = %s, must be %0.1f or greater.'+#13#10+
'GitHub requires at least version 1.2'+#13#10+
'Please follow the link to Microsoft for instructions on updating Windows.',[fTLSVersion,cDesiredVersion]);
'Please click the blinking link for instructions from Microsoft on updating TLS.',[fTLSVersion,cDesiredVersion]);
end
else
begin
fMessageStr := format('Err: REST Status Code %d', [fStatusCode]);
fTLSOk := false;
end;
{$else}
fMessageStr := format('TLS Version = %s, must be %0.1f or greater.'+#13#10+
'GitHub requires at least version 1.2'+#13#10+
'Please click the blinking link for instructions from Microsoft on updating TLS',['1.0',cDesiredVersion]);
{$endif}
end;

function TCheckTLS.GetMessageStr: string;
Expand Down

0 comments on commit 9c9cbf7

Please sign in to comment.