diff --git a/src-installer/RDPWInst.dpr b/src-installer/RDPWInst.dpr
index 4ae678c..3d4527c 100644
--- a/src-installer/RDPWInst.dpr
+++ b/src-installer/RDPWInst.dpr
@@ -573,6 +573,23 @@ begin
ResStream.Free;
end;
+function ExtractResText(ResName: String): String;
+var
+ ResStream: TResourceStream;
+ Str: TStringList;
+begin
+ ResStream := TResourceStream.Create(HInstance, ResName, RT_RCDATA);
+ Str := TStringList.Create;
+ try
+ Str.LoadFromStream(ResStream);
+ except
+
+ end;
+ ResStream.Free;
+ Result := Str.Text;
+ Str.Free;
+end;
+
procedure ExtractFiles;
begin
if not DirectoryExists(ExtractFilePath(ExpandPath(WrapPath))) then
@@ -904,14 +921,16 @@ begin
if (ParamCount < 1)
or (
- (ParamStr(1) <> '-i')
+ (ParamStr(1) <> '-l')
+ and (ParamStr(1) <> '-i')
and (ParamStr(1) <> '-u')
and (ParamStr(1) <> '-r')
) then
begin
Writeln('USAGE:');
- Writeln('RDPWInst.exe [-i[-s]|-u|-r]');
+ Writeln('RDPWInst.exe [-l|-i[-s]|-u|-r]');
Writeln('');
+ Writeln('-l display the license agreement');
Writeln('-i install wrapper to Program Files folder (default)');
Writeln('-i -s install wrapper to System32 folder');
Writeln('-u uninstall wrapper');
@@ -919,6 +938,12 @@ begin
Exit;
end;
+ if ParamStr(1) = '-l' then
+ begin
+ Writeln(ExtractResText('LICENSE'));
+ Exit;
+ end;
+
if not SupportedArchitecture then
begin
Writeln('[-] Unsupported processor architecture.');
@@ -934,6 +959,13 @@ begin
Writeln('[*] RDP Wrapper Library is already installed.');
Halt(ERROR_INVALID_FUNCTION);
end;
+ Writeln('[*] Notice to user:');
+ Writeln(' - By using all or any portion of this software, you are agreeing');
+ Writeln(' to be bound by all the terms and conditions of the license agreement.');
+ Writeln(' - To read the license agreement, run the installer with -l parameter.');
+ Writeln(' - If you do not agree to any terms of the license agreement,');
+ Writeln(' do not use the software.');
+
Writeln('[*] Installing...');
if ParamStr(2) = '-s' then
WrapPath := '%SystemRoot%\system32\rdpwrap.dll'
diff --git a/src-installer/RDPWInst.dproj.local b/src-installer/RDPWInst.dproj.local
deleted file mode 100644
index 673bb99..0000000
--- a/src-installer/RDPWInst.dproj.local
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- 2013.12.07 17:17:05.152.dproj,C:\Users\user\Documents\RAD Studio\Projects\Project1.dproj=C:\Users\user\Documents\Delphi Projects (local)\RDPWrapInst\RDPInstall.dproj
- 2013.12.07 19:48:57.905.dproj,C:\Users\user\Documents\Delphi Projects (local)\RDPWrapInst\RDPInstall.dproj=C:\Users\user\Documents\Delphi Projects (local)\RDPWrapInst\RDPWInst.dproj
- 2013.12.08 01:45:08.501.dproj,C:\Users\user\Documents\Delphi Projects (local)\RDPWrapInst\RDPWInst.dproj=C:\Users\user\Documents\Delphi Projects (local)\RDPWrap\devel\installer2.0-binarymaster\RDPWInst.dproj
-
-
diff --git a/src-installer/RDPWInst.identcache b/src-installer/RDPWInst.identcache
deleted file mode 100644
index 2ed9853..0000000
Binary files a/src-installer/RDPWInst.identcache and /dev/null differ
diff --git a/src-installer/resource.res b/src-installer/resource.res
index f0f95de..5f44448 100644
Binary files a/src-installer/resource.res and b/src-installer/resource.res differ
diff --git a/src-rdpconfig/LicenseUnit.dcu b/src-rdpconfig/LicenseUnit.dcu
new file mode 100644
index 0000000..f860bf3
Binary files /dev/null and b/src-rdpconfig/LicenseUnit.dcu differ
diff --git a/src-rdpconfig/LicenseUnit.dfm b/src-rdpconfig/LicenseUnit.dfm
new file mode 100644
index 0000000..fae5719
--- /dev/null
+++ b/src-rdpconfig/LicenseUnit.dfm
@@ -0,0 +1,47 @@
+object LicenseForm: TLicenseForm
+ Left = 0
+ Top = 0
+ BorderIcons = []
+ BorderStyle = bsDialog
+ Caption = 'License Agreement'
+ ClientHeight = 344
+ ClientWidth = 386
+ Color = clBtnFace
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ OldCreateOrder = False
+ Position = poOwnerFormCenter
+ PixelsPerInch = 96
+ TextHeight = 13
+ object mText: TMemo
+ Left = 8
+ Top = 8
+ Width = 370
+ Height = 297
+ ReadOnly = True
+ ScrollBars = ssBoth
+ TabOrder = 0
+ WordWrap = False
+ end
+ object bAccept: TButton
+ Left = 115
+ Top = 311
+ Width = 75
+ Height = 25
+ Caption = '&Accept'
+ ModalResult = 1
+ TabOrder = 1
+ end
+ object bDecline: TButton
+ Left = 196
+ Top = 311
+ Width = 75
+ Height = 25
+ Caption = '&Decline'
+ ModalResult = 2
+ TabOrder = 2
+ end
+end
diff --git a/src-rdpconfig/LicenseUnit.pas b/src-rdpconfig/LicenseUnit.pas
new file mode 100644
index 0000000..a44a2ad
--- /dev/null
+++ b/src-rdpconfig/LicenseUnit.pas
@@ -0,0 +1,43 @@
+{
+ Copyright 2014 Stas'M Corp.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+}
+
+unit LicenseUnit;
+
+interface
+
+uses
+ Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
+ Dialogs, StdCtrls;
+
+type
+ TLicenseForm = class(TForm)
+ mText: TMemo;
+ bAccept: TButton;
+ bDecline: TButton;
+ private
+ { Private declarations }
+ public
+ { Public declarations }
+ end;
+
+var
+ LicenseForm: TLicenseForm;
+
+implementation
+
+{$R *.dfm}
+
+end.
diff --git a/src-rdpconfig/MainUnit.dcu b/src-rdpconfig/MainUnit.dcu
index 2e2f289..d82d482 100644
Binary files a/src-rdpconfig/MainUnit.dcu and b/src-rdpconfig/MainUnit.dcu differ
diff --git a/src-rdpconfig/MainUnit.dfm b/src-rdpconfig/MainUnit.dfm
index 887995d..7e06d8a 100644
--- a/src-rdpconfig/MainUnit.dfm
+++ b/src-rdpconfig/MainUnit.dfm
@@ -2,7 +2,7 @@ object MainForm: TMainForm
Left = 0
Top = 0
BorderStyle = bsDialog
- Caption = 'Remote Desktop Protocol Configuration'
+ Caption = 'RDP Wrapper Configuration'
ClientHeight = 245
ClientWidth = 326
Color = clBtnFace
@@ -19,7 +19,7 @@ object MainForm: TMainForm
TextHeight = 13
object lRDPPort: TLabel
Left = 203
- Top = 22
+ Top = 33
Width = 47
Height = 13
Caption = 'RDP Port:'
@@ -100,7 +100,7 @@ object MainForm: TMainForm
end
object seRDPPort: TSpinEdit
Left = 256
- Top = 19
+ Top = 30
Width = 62
Height = 22
MaxValue = 65535
@@ -109,4 +109,13 @@ object MainForm: TMainForm
Value = 0
OnChange = seRDPPortChange
end
+ object bLicense: TButton
+ Left = 224
+ Top = 6
+ Width = 94
+ Height = 21
+ Caption = 'View license...'
+ TabOrder = 8
+ OnClick = bLicenseClick
+ end
end
diff --git a/src-rdpconfig/MainUnit.pas b/src-rdpconfig/MainUnit.pas
index f7e282f..a236689 100644
--- a/src-rdpconfig/MainUnit.pas
+++ b/src-rdpconfig/MainUnit.pas
@@ -33,6 +33,7 @@ type
rgShadow: TRadioGroup;
seRDPPort: TSpinEdit;
lRDPPort: TLabel;
+ bLicense: TButton;
procedure FormCreate(Sender: TObject);
procedure cbAllowTSConnectionsClick(Sender: TObject);
procedure seRDPPortChange(Sender: TObject);
@@ -40,6 +41,7 @@ type
procedure bCancelClick(Sender: TObject);
procedure bOKClick(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
+ procedure bLicenseClick(Sender: TObject);
private
{ Private declarations }
public
@@ -55,7 +57,27 @@ var
implementation
{$R *.dfm}
-{$R manifest.res}
+{$R resource.res}
+
+uses
+ LicenseUnit;
+
+function ExtractResText(ResName: String): String;
+var
+ ResStream: TResourceStream;
+ Str: TStringList;
+begin
+ ResStream := TResourceStream.Create(HInstance, ResName, RT_RCDATA);
+ Str := TStringList.Create;
+ try
+ Str.LoadFromStream(ResStream);
+ except
+
+ end;
+ ResStream.Free;
+ Result := Str.Text;
+ Str.Free;
+end;
procedure TMainForm.ReadSettings;
var
@@ -170,6 +192,13 @@ begin
Reg.Free;
end;
+procedure TMainForm.bLicenseClick(Sender: TObject);
+begin
+ LicenseForm.mText.Text := ExtractResText('LICENSE');
+ if LicenseForm.ShowModal <> mrOk then
+ Halt(0);
+end;
+
procedure TMainForm.cbAllowTSConnectionsClick(Sender: TObject);
begin
if Ready then
diff --git a/src-rdpconfig/RDPConf.dpr b/src-rdpconfig/RDPConf.dpr
index 708def3..3fd645f 100644
--- a/src-rdpconfig/RDPConf.dpr
+++ b/src-rdpconfig/RDPConf.dpr
@@ -18,7 +18,8 @@ program RDPConf;
uses
Forms,
- MainUnit in 'MainUnit.pas' {MainForm};
+ MainUnit in 'MainUnit.pas' {MainForm},
+ LicenseUnit in 'LicenseUnit.pas' {LicenseForm};
{$R *.res}
@@ -27,5 +28,6 @@ begin
Application.MainFormOnTaskbar := True;
Application.Title := 'Remote Desktop Protocol Configuration';
Application.CreateForm(TMainForm, MainForm);
+ Application.CreateForm(TLicenseForm, LicenseForm);
Application.Run;
end.
diff --git a/src-rdpconfig/RDPConf.dproj b/src-rdpconfig/RDPConf.dproj
index e333e60..ffc33d8 100644
--- a/src-rdpconfig/RDPConf.dproj
+++ b/src-rdpconfig/RDPConf.dproj
@@ -41,6 +41,9 @@
+
+
+
Base
diff --git a/src-rdpconfig/manifest.res b/src-rdpconfig/manifest.res
deleted file mode 100644
index 82e8f47..0000000
Binary files a/src-rdpconfig/manifest.res and /dev/null differ
diff --git a/src-rdpconfig/resource.res b/src-rdpconfig/resource.res
new file mode 100644
index 0000000..883012d
Binary files /dev/null and b/src-rdpconfig/resource.res differ