-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSoft.pas
More file actions
472 lines (444 loc) · 14.7 KB
/
Soft.pas
File metadata and controls
472 lines (444 loc) · 14.7 KB
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
unit Soft;
interface
uses
Windows, SysUtils, Forms, Graphics,
param, jpeg, news, anti, instal,
ActnList, Classes, ExtCtrls, ComCtrls, Controls, StdCtrls, Gauges;
type
TSoftw = class(TForm)
Image1: TImage;
Button1: TButton;
GroupBox1: TGroupBox;
Osup: TButton;
Devup: TButton;
GroupBox2: TGroupBox;
Button4: TButton;
Button5: TButton;
GroupBox3: TGroupBox;
Label5: TLabel;
Label6: TLabel;
Animate1: TAnimate;
ProgressBar1: TProgressBar;
Timer4: TTimer;
ActionList1: TActionList;
Activate: TAction;
Button3: TButton;
Button6: TButton;
Button7: TButton;
Button8: TButton;
Button9: TButton;
GroupBox4: TGroupBox;
Button10: TButton;
Label1: TLabel;
Label2: TLabel;
Timer1: TTimer;
Button11: TButton;
Button12: TButton;
GroupBox5: TGroupBox;
Gauge1: TGauge;
Label3: TLabel;
Button14: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Timer4Timer(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure ActivateExecute(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure Button3Click(Sender: TObject);
procedure OsupClick(Sender: TObject);
procedure DevupClick(Sender: TObject);
procedure Button6Click(Sender: TObject);
procedure Button7Click(Sender: TObject);
procedure Button8Click(Sender: TObject);
procedure Button9Click(Sender: TObject);
procedure Button10Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure Button11Click(Sender: TObject);
procedure Button12Click(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure Button14Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Softw: TSoftw;
i:integer=0;
c:integer=0;
Analys:boolean=false;
implementation
uses Main, Develop, SoftSel, PartitionMagic;
{$R *.dfm}
procedure TSoftw.Button1Click(Sender: TObject);
begin
Close;
end;
procedure TSoftw.Button5Click(Sender: TObject);
var
i: shortint;
begin
If MainForm.Label31.Caption='Íåò' then
Application.MessageBox('Äûê, íåò ó âàñ àíòèâèðóñà!','Ïîìîùü!',MB_ICONSTOP)
else
begin
ProgressBar1.Position:=0;
If 500-((cpuspeed+cpuclock+htt+hardspeed+defragspeed) div 100)<=0 then
Timer4.Interval:=1
else
Timer4.Interval:=500-((cpuspeed+cpuclock+htt+hardspeed+defragspeed) div 100);
Animate1.Active:=true;
GroupBox3.Visible:=true;
for i:=0 to ComponentCount-1 do
If Components[i] is TButton then
If (Components[i] as TButton).Caption<>'Çàêðûòü' then
(Components[i] as TButton).Enabled:=false;
Timer4.Enabled:=true;
end;
end;
procedure TSoftw.Timer4Timer(Sender: TObject);
var
i: shortint;
begin
If ProgressBar1.Position<101 then
ProgressBar1.Position:=ProgressBar1.Position+1;
If ProgressBar1.Position=100 then begin
Label6.Caption:='Âèðóñîâ íàéäåíî: '+IntToStr(1+random(4));
Label6.Caption:='Âèðóñîâ íàéäåíî: '+IntToStr(Random(4));
Animate1.Active:=false;
Timer4.Enabled:=false;
for i:=0 to ComponentCount-1 do
If Components[i] is TButton then
If ((Components[i] as TButton).Caption<>'Çàêðûòü') and (((Components[i] as TButton).Caption<>'Îáíîâëåíèå íåâîçìîæíî')) then
(Components[i] as TButton).Enabled:=true;
If Label6.Caption<>'Âèðóñîâ íàéäåíî: 0' then begin
Nws.Memo1.Lines.Add('');
Nws.Memo1.Lines.Add(Date);
Nws.Memo1.Lines.Add(Label6.Caption+'. Âñå âèðóñû óíè÷òîæåíû!');
end;
If Label6.Caption='Âèðóñîâ íàéäåíî: 0' then begin
Nws.Memo1.Lines.Add('');
Nws.Memo1.Lines.Add(Date);
Nws.Memo1.Lines.Add('Â âàøåì êîìïüþòåðå âèðóñîâ íå íàéäåíî! Óðà!');
end;
end;
end;
procedure TSoftw.Button4Click(Sender: TObject);
begin
if Antiv = nil then Application.CreateForm(TAntiv, Antiv);
If MainForm.Label30.Caption<>'Íåò' then begin
If AntivirusBases=Softw.Button4.Caption then
Application.MessageBox('Âðåìåííûå ïðîáëåìû ñî ñâÿçüþ!','Ïîìîùü!',MB_ICONWARNING)
else
if InetTraffic<1 then
Application.MessageBox('Âåñü ïðåîïëà÷åííûé òðàôèê çà èíòåðíåò çàêîí÷èëñÿ!','Ïîìîùü!',MB_ICONSTOP)
else
Antiv.ShowModal;
end
else
Application.MessageBox('Íà êîìïüþòåðå íå óñòàíîâëåíà îïåðàöèîííàÿ ñèñòåìà!','Ïîìîùü!',MB_ICONSTOP);
end;
procedure TSoftw.ActivateExecute(Sender: TObject);
var
i:shortint;
begin
ProgressBar1.Position:=0;
for i:=0 to ComponentCount-1 do begin
If Components[i] is TTimer then
(Components[i] as TTimer).Enabled:=false;
If Components[i] is TButton then
(Components[i] as TButton).Enabled:=true;
end;
Label6.Caption:='Âèðóñîâ íàéäåíî:';
If (MainForm.Label29.Caption<>'Íåò') and (MainForm.Label30.Caption<>'Íåò') and (MainForm.Label31.Caption<>'Íåò') then begin
If day=1 then
If year=1 then
Button4.Caption:=IntToStr(31)+'.'+IntToStr(12)+'.'+IntToStr(Year-1)
else
Button4.Caption:=IntToStr(31)+'.'+IntToStr(Month-1)+'.'+IntToStr(Year)
else
Button4.Caption:=IntToStr(Day-1)+'.'+IntToStr(Month)+'.'+IntToStr(Year);
Button4.Enabled:=true;
end
else
begin
Button4.Caption:='Îáíîâëåíèå íåâîçìîæíî';
Button4.Enabled:=false;
end;
end;
procedure TSoftw.FormActivate(Sender: TObject);
begin
MainForm.Timer1.Enabled:=false;
GroupBox3.Visible:=false;
GroupBox5.Visible:=false;
Activate.Execute;
If c<2 then
inc(c);
If c=1 then
Application.MessageBox('Çäåñü âû ìîæåòå óñòàíîâèòü îïåðàöèîííóþ ñèñòåìó íà ñâîé êîìïüþòåð, à òàêæå ñðåäó ðàçðàáîòêè!','Ïîìîùü!',MB_ICONINFORMATION);
end;
procedure TSoftw.FormClose(Sender: TObject; var Action: TCloseAction);
begin
MainForm.Timer1.Enabled:=true;
end;
procedure TSoftw.Button3Click(Sender: TObject);
begin
If (MainForm.Label36.Caption<>'Ñèñàäìèí') and (MainForm.Label36.Caption<>'Ïåðåâîä÷èê') and (MainForm.Label36.Caption<>'Áèçíåñìåí') and (MainForm.Label36.Caption<>'Ìåäèê') and (MainForm.Label36.Caption<>'×. Âîäèòåëü') and (MainForm.Label36.Caption<>'Ïðîãðàììèñò') and (MainForm.Label36.Caption<>'Íà÷àëüíèê') then
Application.MessageBox('Âû äîëæíû óñòðîèòüñÿ íà ðàáîòó õîòÿ áû ñèñàäìèíîì ÷òîáû ïèñàòü ïðîãðàììû!','Ïîìîùü!',MB_ICONSTOP)
else
begin
If MainForm.Label32.Caption='Íåò' then
Application.MessageBox('Íå óñòàíîâëåíà ñðåäà ðàçðàáîòêè!','Ïîìîùü!',MB_ICONSTOP)
else
Development.ShowModal;
end;
end;
procedure TSoftw.OsupClick(Sender: TObject);
begin
If mainform.Label28.Caption<>'Íåò' then begin
assignfile(data,dir+'\Data\OS.dat');
dataprm:='OS';
SoftSelect.Caption:='Âûáîð îïåðàöèîííûõ ñèñòåì';
SoftSelect.Showmodal;
end
else
Application.MessageBox('Íåò CD-ROM!','Ïîìîùü!',mb_iconstop);
end;
procedure TSoftw.DevupClick(Sender: TObject);
begin
If MainForm.Label30.Caption<>'Íåò' then begin
If mainform.Label28.Caption<>'Íåò' then begin
SoftSelect.Caption:='Âûáîð ñðåäñòâ ðàçðàáîòêè';
dataprm:='Dev';
assignfile(data,dir+'\Data\Development.dat');
SoftSelect.ShowModal;
end
else
Application.MessageBox('Íåò CD-ROM!','Ïîìîùü!',mb_iconstop);
end
else
Application.MessageBox('Äëÿ íà÷àëà íåîáõîäèìî óñòàíîâèòü îïåðàöèîííóþ ñèñòåìó íà êîìïüþòåð!','Ïîìîùü!',MB_ICONSTOP);
end;
procedure TSoftw.Button6Click(Sender: TObject);
begin
If MainForm.Label30.Caption<>'Íåò' then begin
If mainform.Label28.Caption<>'Íåò' then begin
SoftSelect.Caption:='Âûáîð ïðîòèâîñïàìíûõ ôèëüòðîâ';
dataprm:='Spam';
assignfile(data,dir+'\Data\Antispam.dat');
SoftSelect.ShowModal;
end
else
Application.MessageBox('Íåò CD-ROM!','Ïîìîùü!',mb_iconstop);
end
else
Application.MessageBox('Äëÿ íà÷àëà íåîáõîäèìî óñòàíîâèòü îïåðàöèîííóþ ñèñòåìó íà êîìïüþòåð!','Ïîìîùü!',MB_ICONSTOP);
end;
procedure TSoftw.Button7Click(Sender: TObject);
begin
If MainForm.Label30.Caption<>'Íåò' then begin
If mainform.Label28.Caption<>'Íåò' then begin
SoftSelect.Caption:='Âûáîð àíòèâèðóñîâ';
dataprm:='Antivirus';
assignfile(data,dir+'\Data\Antivirus.dat');
SoftSelect.ShowModal;
end
else
Application.MessageBox('Íåò CD-ROM!','Ïîìîùü!',mb_iconstop);
end
else
Application.MessageBox('Äëÿ íà÷àëà íåîáõîäèìî óñòàíîâèòü îïåðàöèîííóþ ñèñòåìó íà êîìïüþòåð!','Ïîìîùü!',MB_ICONSTOP);
end;
procedure TSoftw.Button8Click(Sender: TObject);
begin
If MainForm.Label30.Caption<>'Íåò' then begin
If mainform.Label28.Caption<>'Íåò' then begin
SoftSelect.Caption:='Âûáîð ôàéëîâûõ ìåíåäæåðîâ';
dataprm:='File Manager';
assignfile(data,dir+'\Data\Manager.dat');
SoftSelect.ShowModal;
end
else
Application.MessageBox('Íåò CD-ROM!','Ïîìîùü!',mb_iconstop);
end
else
Application.MessageBox('Äëÿ íà÷àëà íåîáõîäèìî óñòàíîâèòü îïåðàöèîííóþ ñèñòåìó íà êîìïüþòåð!','Ïîìîùü!',MB_ICONSTOP);
end;
procedure TSoftw.Button9Click(Sender: TObject);
begin
If MainForm.Label30.Caption<>'Íåò' then begin
If mainform.Label28.Caption<>'Íåò' then begin
SoftSelect.Caption:='Âûáîð áðàíäìàóåðîâ';
dataprm:='Firewall';
assignfile(data,dir+'\Data\Firewall.dat');
SoftSelect.ShowModal;
end
else
Application.MessageBox('Íåò CD-ROM!','Ïîìîùü!',mb_iconstop);
end
else
Application.MessageBox('Äëÿ íà÷àëà íåîáõîäèìî óñòàíîâèòü îïåðàöèîííóþ ñèñòåìó íà êîìïüþòåð!','Ïîìîùü!',MB_ICONSTOP);
end;
procedure TSoftw.Button10Click(Sender: TObject);
begin
If MainForm.Label30.Caption<>'Íåò' then begin
If Mainform.Label28.Caption<>'Íåò' then begin
If MainForm.Label53.Caption='Íåò' then begin
SoftSelect.Caption:='Âûáîð äåôðàãìåíòàòîðîâ äèñêà';
dataprm:='Defrag';
assignfile(data,dir+'\Data\Defragmenter.dat');
SoftSelect.ShowModal;
end
else
begin
case Application.MessageBox('Âû õîòèòå ïðîâåñòè äåôðàãìåíòàöèþ?  ïðîòèâíîì ñëó÷àå áóäåò ïðîèçâåäåíà óñòàíîâêà íîâîé ïðîãðàììû äëÿ äåôðàãìåíòàöèè äèñêà.','Ïîìîùü!',MB_ICONQUESTION+MB_YESNOCANCEL) of
6:
begin
Gauge1.Progress:=0;
Analys:=false;
Label3.Caption:='Èäåò àíàëèç...';
If 500-((cpuspeed+cpuclock+htt+hardspeed+defragspeed) div 41)<=0 then
Timer1.Interval:=1
else
Timer1.Interval:=500-((cpuspeed+cpuclock+htt+hardspeed+defragspeed) div 41);
Timer1.Enabled:=true;
end;
7:
begin
SoftSelect.Caption:='Âûáîð äåôðàãìåíòàòîðîâ äèñêà';
dataprm:='Defrag';
assignfile(data,dir+'\Data\Defragmenter.dat');
SoftSelect.ShowModal;
end;
end;
end;
end
else
Application.MessageBox('Íåò CD-ROM!','Ïîìîùü!',mb_iconstop);
end
else
Application.MessageBox('Äëÿ íà÷àëà íåîáõîäèìî óñòàíîâèòü îïåðàöèîííóþ ñèñòåìó íà êîìïüþòåð!','Ïîìîùü!',MB_ICONSTOP);
end;
procedure TSoftw.Timer1Timer(Sender: TObject);
var
i: shortint;
begin
If not Analys then begin
MainForm.Timer1.Enabled:=false;
Gauge1.ForeColor:=clMenuHighlight;
GroupBox5.Visible:=true;
for i:=0 to ComponentCount-1 do
If Components[i] is TButton then
If (Components[i] as TButton).Caption<>'Çàêðûòü' then
(Components[i] as TButton).Enabled:=false;
If Gauge1.Progress<100 then
Gauge1.Progress:=Gauge1.Progress+1
else
begin
Analys:=true;
Label3.Caption:='Äåôðàãìåíòàöèÿ äèñêà...';
Gauge1.Progress:=0;
Gauge1.ForeColor:=clHighlight;
If 500-((cpuspeed+cpuclock+htt+hardspeed+defragspeed) div 100)<=0 then
Timer1.Interval:=1
else
Timer1.Interval:=500-((cpuspeed+cpuclock+htt+hardspeed+defragspeed) div 100);
end;
end
else
If DefragTime>30 then begin
if Gauge1.Progress<100 then
Gauge1.Progress:=Gauge1.Progress+1
else
begin
Button10.Enabled:=true;
Button5.Enabled:=true;
Timer1.Enabled:=false;
Label3.Caption:='';
for i:=0 to ComponentCount-1 do
If Components[i] is TButton then
If (Components[i] as TButton).Caption<>'Çàêðûòü' then
(Components[i] as TButton).Enabled:=true;
Application.MessageBox('Äåôðàãìåíòàöèÿ äèñêà çàâåðøåíà! Ðåêîìåíäóåì âàì ïðîâîäèòü äåôðàãìåíòàöèþ êàæäûé ìåñÿö!','Ïîìîùü!',MB_ICONINFORMATION);
defragspeed:=random(4000);
DefragTime:=0;
end;
end
else
begin
Button10.Enabled:=true;
Button5.Enabled:=true;
Timer1.Enabled:=false;
Label3.Caption:='';
for i:=0 to ComponentCount-1 do
If Components[i] is TButton then
If (Components[i] as TButton).Caption<>'Çàêðûòü' then
(Components[i] as TButton).Enabled:=true;
Application.MessageBox('Äåôðàãìåíòàöèÿ äèñêà íå òðåáóåòñÿ!','Ïîìîùü!',MB_ICONINFORMATION);
end;
end;
procedure TSoftw.Button11Click(Sender: TObject);
begin
If MainForm.Label30.Caption<>'Íåò' then begin
If mainform.Label28.Caption<>'Íåò' then begin
SoftSelect.Caption:='Âûáîð áðàóçåðîâ';
dataprm:='Browser';
assignfile(data,dir+'\Data\Browser.dat');
SoftSelect.ShowModal;
end
else
Application.MessageBox('Íåò CD-ROM!','Ïîìîùü!',mb_iconstop);
end
else
Application.MessageBox('Äëÿ íà÷àëà íåîáõîäèìî óñòàíîâèòü îïåðàöèîííóþ ñèñòåìó íà êîìïüþòåð!','Ïîìîùü!',MB_ICONSTOP);
end;
procedure TSoftw.Button12Click(Sender: TObject);
begin
If MainForm.Label30.Caption<>'Íåò' then begin
If mainform.Label28.Caption<>'Íåò' then begin
SoftSelect.Caption:='Âûáîð ïðîãðàìì-òåñòåðîâ';
dataprm:='Benchmark';
assignfile(data,dir+'\Data\Benchmark.dat');
SoftSelect.ShowModal;
end
else
Application.MessageBox('Íåò CD-ROM!','Ïîìîùü!',mb_iconstop);
end
else
Application.MessageBox('Äëÿ íà÷àëà íåîáõîäèìî óñòàíîâèòü îïåðàöèîííóþ ñèñòåìó íà êîìïüþòåð!','Ïîìîùü!',MB_ICONSTOP);
end;
procedure TSoftw.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
If (key=VK_ESCAPE) then
Button1.OnClick(self);
end;
procedure TSoftw.Button14Click(Sender: TObject);
begin
case Application.MessageBox('Õîòèòå èçìåíèòü ñòðóêòóðó ðàçäåëîâ æåñòêîãî äèñêà?  ïðîòèâíîì ñëó÷àå áóäåò ïðîèçâåäåíà óñòàíîâêà íîâîé ïðîãðàììû äëÿ óïðàâëåíèÿ äèñêîâûìè ðàçäåëàìè.','Ïîìîùü!',MB_ICONQUESTION+MB_YESNOCANCEL) of
6: begin
Operation:='PMagic';
Partition.ShowModal;
end;
7: begin
If MainForm.Label30.Caption<>'Íåò' then begin
SoftSelect.Caption:='Âûáîð îïåðàòîðîâ äèñêà';
dataprm:='DiskOperator';
assignfile(data,dir+'\Data\DIskOperator.dat');
SoftSelect.ShowModal;
end
else
Application.MessageBox('Äëÿ íà÷àëà íåîáõîäèìî óñòàíîâèòü îïåðàöèîííóþ ñèñòåìó íà êîìïüþòåð!','Ïîìîùü!',MB_ICONSTOP);
end;
end;
end;
procedure TSoftw.Button2Click(Sender: TObject);
begin
Operation:='Active';
Partition.ShowModal;
end;
end.