Configurator updated

This commit is contained in:
binarymaster 2014-12-11 01:18:05 +03:00
parent 742fd143ea
commit d6c1110ff6
3 changed files with 59 additions and 1 deletions

View File

@ -196,6 +196,13 @@ object MainForm: TMainForm
Height = 13
Caption = 'ver.'
end
object lsSuppVer: TLabel
Left = 182
Top = 55
Width = 70
Height = 13
Caption = '[support level]'
end
end
object Timer: TTimer
Interval = 250

View File

@ -46,6 +46,7 @@ type
lsWrapVer: TLabel;
bLicense: TButton;
gbDiag: TGroupBox;
lsSuppVer: TLabel;
procedure FormCreate(Sender: TObject);
procedure cbAllowTSConnectionsClick(Sender: TObject);
procedure seRDPPortChange(Sender: TObject);
@ -88,6 +89,7 @@ var
Ready: Boolean = False;
Arch: Byte;
OldWow64RedirectionValue: LongBool;
INI: String;
function WinStationEnumerateW(hServer: THandle;
var ppSessionInfo: PWTS_SESSION_INFOW; var pCount: DWORD): BOOL; stdcall;
@ -440,11 +442,29 @@ begin
Reg.Free;
end;
function CheckSupport(FV: FILE_VERSION): Byte;
var
VerTxt: String;
begin
Result := 0;
if (FV.Version.w.Major = 6) and (FV.Version.w.Minor = 0) then
Result := 1;
if (FV.Version.w.Major = 6) and (FV.Version.w.Minor = 1) then
Result := 1;
VerTxt := Format('%d.%d.%d.%d',
[FV.Version.w.Major, FV.Version.w.Minor, FV.Release, FV.Build]);
if Pos('[' + VerTxt + ']', INI) > 0 then
Result := 2;
end;
procedure TMainForm.TimerTimer(Sender: TObject);
var
WrapperPath: String;
WrapperPath, INIPath: String;
FV: FILE_VERSION;
L: TStringList;
CheckSupp: Boolean;
begin
CheckSupp := False;
case IsWrapperInstalled(WrapperPath) of
-1: begin
lsWrapper.Caption := 'Unknown';
@ -457,6 +477,10 @@ begin
1: begin
lsWrapper.Caption := 'Installed';
lsWrapper.Font.Color := clGreen;
CheckSupp := True;
INIPath := ExtractFilePath(ExpandPath(WrapperPath)) + 'rdpwrap.ini';
if not FileExists(INIPath) then
CheckSupp := False;
end;
2: begin
lsWrapper.Caption := '3rd-party';
@ -529,6 +553,33 @@ begin
IntToStr(FV.Release)+'.'+
IntToStr(FV.Build);
lsTSVer.Font.Color := clWindowText;
lsSuppVer.Visible := CheckSupp;
if CheckSupp then begin
if INI = '' then begin
L := TStringList.Create;
try
L.LoadFromFile(INIPath);
except
end;
INI := L.Text;
L.Free;
end;
case CheckSupport(FV) of
0: begin
lsSuppVer.Caption := '[not supported]';
lsSuppVer.Font.Color := clRed;
end;
1: begin
lsSuppVer.Caption := '[supported partially]';
lsSuppVer.Font.Color := clOlive;
end;
2: begin
lsSuppVer.Caption := '[fully supported]';
lsSuppVer.Font.Color := clGreen;
end;
end;
end;
end;
end;

Binary file not shown.