-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathHelpUI.pas
86 lines (68 loc) · 1.94 KB
/
HelpUI.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
unit HelpUI;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls,
Cod.Visual.Button, Cod.SysUtils, ShellAPI, Vcl.Clipbrd, Vcl.TitleBarCtrls,
IOUtils, SetupUnit;
type
THelpForm = class(TForm)
Label2: TLabel;
Label3: TLabel;
UserContain: TPanel;
UserIcon: TLabel;
CButton1: CButton;
CButton2: CButton;
CButton3: CButton;
CButton4: CButton;
TitleBarPanel1: TTitleBarPanel;
procedure HelpSelection(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
HelpForm: THelpForm;
implementation
{$R *.dfm}
procedure THelpForm.FormCreate(Sender: TObject);
begin
// Titlebar
with CustomTitleBar do
begin
Enabled := true;
Control := TitleBarPanel1;
SystemColors := false;
SystemButtons := false;
CaptionAlignment := taCenter;
ShowIcon := false;
PrepareCustomTitleBar(TForm(Self), clBtnFace, clBlack);
end;
end;
procedure THelpForm.HelpSelection(Sender: TObject);
var
FileName: string;
begin
// Case of help
case CButton(Sender).Tag of
1: begin
ShellExecute(0, 'open', 'powershell', nil, nil, 1);
Clipboard.AsText := 'Get-AppxPackage -AllUsers| Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}';
Sleep(500);
SimulateKeyPress32( 86, [ssCtrl], false);
SimulateKeyPress32( 13, [], true);
end;
2: ShellRun('https://github.com/Codrax', false);
3: begin
FileName := AppData + 'setup.log';
if TFile.Exists( FileName ) then
ShellRun( FileName, false )
else
Setup.MsgDialog('File not found', 'There is no log file to be found at at:'#13 + FileName);
end;
4: ShellRun('https://codrutsoftware.cf/', false);
end;
end;
end.