-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuMain.pas
163 lines (144 loc) · 5.18 KB
/
uMain.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
unit uMain;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Objects,
FMX.Layouts, FMX.ExtCtrls, FMX.Controls.Presentation, FMX.StdCtrls, FMX.Edit,
ShellApi, Inifiles, uAbout;
type
TfMain = class(TForm)
iBackground: TImageViewer;
bExit: TButton;
Sprache: TLang;
bInfo: TButton;
cbBFME2DVD: TCheckBox;
eBFME2DVD: TEdit;
cbROTWKDVD: TCheckBox;
eROTWKDVD: TEdit;
bInstallBFME2: TButton;
bPatchBFME2: TButton;
bInstallROTWK: TButton;
bPatchROTWK: TButton;
bInstallEdain: TButton;
bInstallModChanger: TButton;
sLanguage: TSwitch;
lLanguage: TLabel;
procedure bExitClick(Sender: TObject);
procedure cbBFME2DVDChange(Sender: TObject);
procedure sLanguageSwitch(Sender: TObject);
procedure cbROTWKDVDChange(Sender: TObject);
procedure bInstallBFME2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure bPatchBFME2Click(Sender: TObject);
procedure bInstallROTWKClick(Sender: TObject);
procedure bPatchROTWKClick(Sender: TObject);
procedure bInstallEdainClick(Sender: TObject);
procedure bInstallModChangerClick(Sender: TObject);
procedure bInfoClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
fMain: TfMain;
path: String;
implementation
{$R *.fmx}
procedure TfMain.bExitClick(Sender: TObject);
begin
halt;
end;
procedure TfMain.bInfoClick(Sender: TObject);
begin
fAbout.Show;
end;
procedure TfMain.bInstallBFME2Click(Sender: TObject);
begin
if cbBFME2DVD.IsChecked=true then
begin
if fileexists(eBFME2DVD.Text+':\Autorun.exe') then
begin
ShellExecute(0, 'open', PChar(eBFME2DVD.Text+':\Autorun.exe'),'',PChar(eBFME2DVD.Text+':\'),1)
end else showmessage(Sprache.LangStr[Sprache.Lang].Values['snobfme2dvd']);
end else
begin
if fileexists(path+'BFME2\Autorun.exe') then
begin
ShellExecute(0, 'open', PChar(path+'BFME2\Autorun.exe'),'',PChar(path+'BFME2\'),1)
end else showmessage(Sprache.LangStr[Sprache.Lang].Values['snobfme2folder']);
end;
end;
procedure TfMain.bInstallEdainClick(Sender: TObject);
var cfg_ini:TInifile;
EdainVersion:String;
begin
cfg_ini:=TInifile.Create(path+'EdainInstaller.ini');
EdainVersion:=cfg_ini.ReadString('Edain','Version','EdainMod4.3.exe');
cfg_ini.Free;
if FileExists(PChar(path+'Edain\'+EdainVersion+'.exe')) then
begin
ShellExecute(0, 'open', PChar(path+'Edain\'+EdainVersion+'.exe'),'','',1);
//showmessage(Sprache.LangStr[Sprache.Lang].Values['sinstallsuccess']);
end else showmessage(Sprache.LangStr[Sprache.Lang].Values['sedainnotfound']);
end;
procedure TfMain.bInstallModChangerClick(Sender: TObject);
begin
if FileExists(PChar(path+'Edain\edainswitcherinstaller.exe')) then
begin
ShellExecute(0, 'open', PChar(path+'Edain\edainswitcherinstaller.exe'),'','',1);
//showmessage(Sprache.LangStr[Sprache.Lang].Values['sinstallsuccess']);
end else showmessage(Sprache.LangStr[Sprache.Lang].Values['smodswitchernotfound']);
end;
procedure TfMain.bInstallROTWKClick(Sender: TObject);
begin
if cbROTWKDVD.IsChecked=true then
begin
if fileexists(eROTWKDVD.Text+':\Autorun.exe') then
begin
ShellExecute(0, 'open', PChar(eROTWKDVD.Text+':\Autorun.exe'),'',PChar(eROTWKDVD.Text+':\'),1)
end else showmessage(Sprache.LangStr[Sprache.Lang].Values['snorotwkdvd']);
end else
begin
if fileexists(path+'ROTWK\Autorun.exe') then
begin
ShellExecute(0, 'open', PChar(path+'ROTWK\Autorun.exe'),'',PChar(path+'ROTWK\'),1)
end else showmessage(Sprache.LangStr[Sprache.Lang].Values['snorotwkfolder']);
end;
end;
procedure TfMain.bPatchBFME2Click(Sender: TObject);
begin
if FileExists(PChar(path+'Patches\lotrbfme2-65542-'+Sprache.LangStr[Sprache.Lang].Values['langstr']+'.exe')) then
begin
ShellExecute(0, 'open', PChar(path+'Patches\lotrbfme2-65542-'+Sprache.LangStr[Sprache.Lang].Values['langstr']+'.exe'),'','',1);
//showmessage(Sprache.LangStr[Sprache.Lang].Values['spatchsuccess']);
end else showmessage(Sprache.LangStr[Sprache.Lang].Values['spatchnotfound']);
end;
procedure TfMain.bPatchROTWKClick(Sender: TObject);
begin
if FileExists(PChar(path+'Patches\LotrBfMe2EP1-131073-'+Sprache.LangStr[Sprache.Lang].Values['langstr']+'.exe')) then
begin
ShellExecute(0, 'open', PChar(path+'Patches\LotrBfMe2EP1-131073-'+Sprache.LangStr[Sprache.Lang].Values['langstr']+'.exe'),'','',1);
//showmessage(Sprache.LangStr[Sprache.Lang].Values['spatchsuccess']);
end else showmessage(Sprache.LangStr[Sprache.Lang].Values['spatchnotfound']);
end;
procedure TfMain.cbBFME2DVDChange(Sender: TObject);
begin
eBFME2DVD.Enabled:=cbBFME2DVD.IsChecked;
end;
procedure TfMain.cbROTWKDVDChange(Sender: TObject);
begin
eROTWKDVD.Enabled:=cbROTWKDVD.IsChecked;
end;
procedure TfMain.FormCreate(Sender: TObject);
begin
path:=ExtractFilePath(ParamStr(0));
Sprache.Lang:='DE';
end;
procedure TfMain.sLanguageSwitch(Sender: TObject);
begin
if sLanguage.IsChecked=true
then begin Sprache.Lang:='EN'; lLanguage.Text:=Sprache.LangStr[Sprache.Lang].Values['lng_en']; end
else begin Sprache.Lang:='DE'; lLanguage.Text:=Sprache.LangStr[Sprache.Lang].Values['lng_de']; end;
end;
end.