Added madExcept
Updated some captions Improved the "Cancel" button
This commit is contained in:
parent
bc5445d255
commit
44db80bc75
|
@ -24,6 +24,7 @@
|
|||
-$X+
|
||||
-$YD
|
||||
-$Z1
|
||||
-GD
|
||||
-cg
|
||||
-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
|
||||
-H+
|
||||
|
@ -33,6 +34,7 @@
|
|||
-K$00400000
|
||||
-LE"c:\programme\borland\delphi7\Projects\Bpl"
|
||||
-LN"c:\programme\borland\delphi7\Projects\Bpl"
|
||||
-DmadExcept
|
||||
-w-UNSAFE_TYPE
|
||||
-w-UNSAFE_CODE
|
||||
-w-UNSAFE_CAST
|
||||
|
|
|
@ -80,7 +80,7 @@ UnsafeType=0
|
|||
UnsafeCode=0
|
||||
UnsafeCast=0
|
||||
[Linker]
|
||||
MapFile=0
|
||||
MapFile=3
|
||||
OutputObjs=0
|
||||
ConsoleApp=1
|
||||
DebugInfo=0
|
||||
|
@ -96,7 +96,7 @@ PackageDLLOutputDir=
|
|||
PackageDCPOutputDir=
|
||||
SearchPath=
|
||||
Packages=vcl;rtl;vclx;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;VclSmp;dbrtl;dbexpress;vcldb;dsnap;dbxcds;inetdb;bdertl;vcldbx;adortl;teeui;teedb;tee;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOffice2k;JvStdCtrlsD7R;JvAppFrmD7R;JvCoreD7R;JvBandsD7R;JvBDED7R;JvDBD7R;JvDlgsD7R;JvCmpD7R;JvCryptD7R;JvCtrlsD7R;JvCustomD7R;JvDockingD7R;JvDotNetCtrlsD7R;JvEDID7R;qrpt;JvGlobusD7R;JvHMID7R;JvInspectorD7R;JvInterpreterD7R;JvJansD7R;JvManagedThreadsD7R;JvMMD7R;JvNetD7R;JvPageCompsD7R;JvPluginD7R;JvPrintPreviewD7R;JvSystemD7R;JvTimeFrameworkD7R;JvUIBD7R;JvValidatorsD7R;JvWizardD7R;JvXPCtrlsD7R;DelphiX_for7;Indy70;DJcl;tb2k_d7;FlatStyle_D5;scited7;mxFlatPack_D7;mbXPLib
|
||||
Conditionals=
|
||||
Conditionals=madExcept
|
||||
DebugSourceDirs=
|
||||
UsePackages=0
|
||||
[Parameters]
|
||||
|
|
|
@ -15,6 +15,11 @@ program AMXInstaller;
|
|||
}
|
||||
|
||||
uses
|
||||
madExcept,
|
||||
madLinkDisAsm,
|
||||
madListHardware,
|
||||
madListProcesses,
|
||||
madListModules,
|
||||
Forms,
|
||||
UnitfrmMain in 'UnitfrmMain.pas' {frmMain},
|
||||
UnitFunctions in 'UnitFunctions.pas',
|
||||
|
|
Binary file not shown.
|
@ -381,8 +381,11 @@ begin
|
|||
MakeDir(ePath + 'addons\metamod\dlls');
|
||||
// rest...
|
||||
for i := 0 to DirList.Count -1 do begin
|
||||
if Cancel then
|
||||
if Cancel then begin
|
||||
AddStatus('', clBlack, False);
|
||||
AddStatus('Installation canceled by user!', clBlack, False);
|
||||
exit;
|
||||
end;
|
||||
|
||||
if Pos('base', DirList[i]) = 1 then begin
|
||||
MakeDir(ePath + 'addons\amxmodx\' + Copy(DirList[i], 6, Length(DirList[i])));
|
||||
|
@ -435,8 +438,11 @@ begin
|
|||
AddStatus('', clBlack, False);
|
||||
AddStatus('Copying files...', clBlack);
|
||||
for i := 0 to FileList.Count -1 do begin
|
||||
if Cancel then
|
||||
if Cancel then begin
|
||||
AddStatus('', clBlack, False);
|
||||
AddStatus('Installation canceled by user!', clBlack, False);
|
||||
exit;
|
||||
end;
|
||||
|
||||
if not IsForbidden(FileList[i], OS) then begin
|
||||
if Pos('base', FileList[i]) = 1 then begin
|
||||
|
@ -578,7 +584,9 @@ var eStr: TStringList;
|
|||
CopyConfig: Boolean;
|
||||
eGoBack: Boolean;
|
||||
begin
|
||||
Screen.Cursor := crAppStart;
|
||||
frmMain.cmdCancel.Show;
|
||||
frmMain.cmdCancel.Caption := '&Cancel';
|
||||
frmMain.cmdNext.Hide;
|
||||
Screen.Cursor := crHourGlass;
|
||||
AddStatus('Scanning for directories...', clBlack);
|
||||
|
@ -609,8 +617,11 @@ begin
|
|||
eStr := TStringList.Create;
|
||||
eStr.LoadFromFile(ExtractFilePath(ParamStr(0)) + 'temp\liblist.gam');
|
||||
if eStr.IndexOf('gamedll "addons\metamod\dlls\metamod.dll"') = -1 then begin
|
||||
if Cancel then
|
||||
if Cancel then begin
|
||||
AddStatus('', clBlack, False);
|
||||
AddStatus('Installation canceled by user!', clBlack, False);
|
||||
exit;
|
||||
end;
|
||||
|
||||
for i := 0 to eStr.Count -1 do begin
|
||||
if Pos('gamedll', TrimLeft(eStr[i])) = 1 then
|
||||
|
@ -649,8 +660,11 @@ begin
|
|||
AddStatus('Creating directories...', clBlack);
|
||||
// rest...
|
||||
for i := 0 to DirList.Count -1 do begin
|
||||
if Cancel then
|
||||
if Cancel then begin
|
||||
AddStatus('', clBlack, False);
|
||||
AddStatus('Installation canceled by user!', clBlack, False);
|
||||
exit;
|
||||
end;
|
||||
|
||||
AddStatus('Creating directory: ' + DirList[i], clBlack);
|
||||
CreateAgain:
|
||||
|
@ -659,7 +673,11 @@ begin
|
|||
FTPMakeDir(ePath + DirList[i]);
|
||||
except
|
||||
on E: Exception do begin
|
||||
if Cancel then exit;
|
||||
if Cancel then begin
|
||||
AddStatus('', clBlack, False);
|
||||
AddStatus('Installation canceled by user!', clBlack, False);
|
||||
exit;
|
||||
end;
|
||||
|
||||
if frmMain.IdFTP.Connected then begin
|
||||
if MessageBox(frmMain.Handle, PChar('An error occured while creating "' + FileList[i] + '"!' + #13 + E.Message + #13 + #13 + 'Retry?'), PChar(Application.Title), MB_ICONSTOP + MB_YESNO) = mrYes then
|
||||
|
@ -691,8 +709,11 @@ begin
|
|||
AddStatus('Uploading files...', clBlack);
|
||||
AddStatus('', clBlack, False);
|
||||
for i := 0 to FileList.Count -1 do begin
|
||||
if Cancel then
|
||||
if Cancel then begin
|
||||
AddStatus('', clBlack, False);
|
||||
AddStatus('Installation canceled by user!', clBlack, False);
|
||||
exit;
|
||||
end;
|
||||
|
||||
if not IsForbidden(FileList[i], OS) then begin
|
||||
AddStatus('Uploading file: ' + FileList[i], clBlack);
|
||||
|
@ -719,7 +740,11 @@ begin
|
|||
end;
|
||||
except
|
||||
on E: Exception do begin
|
||||
if Cancel then exit;
|
||||
if Cancel then begin
|
||||
AddStatus('', clBlack, False);
|
||||
AddStatus('Installation canceled by user!', clBlack, False);
|
||||
exit;
|
||||
end;
|
||||
|
||||
if frmMain.IdFTP.Connected then begin
|
||||
if MessageBox(frmMain.Handle, PChar('An error occured while uploading "' + FileList[i] + '"!' + #13 + E.Message + #13 + #13 + 'Retry?'), PChar(Application.Title), MB_ICONSTOP + MB_YESNO) = mrYes then
|
||||
|
|
|
@ -4924,7 +4924,7 @@ object frmMain: TfrmMain
|
|||
Left = 172
|
||||
Top = 82
|
||||
Width = 353
|
||||
Height = 26
|
||||
Height = 13
|
||||
Caption =
|
||||
'This wizard will guide you through the installation of AMX Mod X' +
|
||||
' (version).'
|
||||
|
@ -5980,6 +5980,7 @@ object frmMain: TfrmMain
|
|||
Top = 0
|
||||
Width = 527
|
||||
Height = 314
|
||||
OnShow = jspFTPShow
|
||||
object lblStep1: TLabel
|
||||
Left = 44
|
||||
Top = 60
|
||||
|
@ -6455,7 +6456,7 @@ object frmMain: TfrmMain
|
|||
ColorBorder = clBtnShadow
|
||||
ColorHighLight = clBtnShadow
|
||||
ColorShadow = clBtnShadow
|
||||
Caption = '&Cancel'
|
||||
Caption = '&Close'
|
||||
ParentColor = False
|
||||
TabOrder = 1
|
||||
OnClick = cmdCancelClick
|
||||
|
|
|
@ -124,6 +124,7 @@ type
|
|||
var AllowExpansion: Boolean);
|
||||
procedure trvDirectoriesCollapsing(Sender: TObject; Node: TTreeNode;
|
||||
var AllowCollapse: Boolean);
|
||||
procedure jspFTPShow(Sender: TObject);
|
||||
private
|
||||
OldProgress: Integer;
|
||||
CurrProgress: Integer;
|
||||
|
@ -150,7 +151,30 @@ end;
|
|||
|
||||
procedure TfrmMain.cmdCancelClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
if (jplWizard.ActivePage = jspFTP) and (cmdConnect.Caption = 'Connecting...') then begin
|
||||
Screen.Cursor := crDefault;
|
||||
Cancel := True;
|
||||
try
|
||||
IdFTP.Disconnect;
|
||||
except
|
||||
// oh, hello BAILOPAN!
|
||||
end;
|
||||
cmdCancel.Caption := 'Close';
|
||||
end
|
||||
else if (jplWizard.ActivePage = jspInstallProgress) then begin
|
||||
if Cancel then
|
||||
Close
|
||||
else if MessageBox(Handle, 'Do you really want to cancel the installation?', PChar(Application.Title), MB_ICONQUESTION + MB_YESNO) = mrYes then begin
|
||||
Screen.Cursor := crDefault;
|
||||
Application.OnException := ExceptionHandler;
|
||||
Cancel := True;
|
||||
if IdFTP.Connected then
|
||||
IdFTP.Quit;
|
||||
end;
|
||||
cmdCancel.Caption := 'Close';
|
||||
end
|
||||
else
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmMain.cmdNextClick(Sender: TObject);
|
||||
|
@ -219,8 +243,10 @@ begin
|
|||
Sleep(1500);
|
||||
ggeAll.Progress := 0;
|
||||
ggeItem.Progress := 0;
|
||||
InstallCustom(ExtractFilePath(ParamStr(0)) + 'temp\', ChosenMod, eOS);
|
||||
cmdNext.Hide;
|
||||
InstallCustom(ExtractFilePath(ParamStr(0)) + 'temp\', ChosenMod, eOS);
|
||||
if Cancel then
|
||||
exit;
|
||||
AddStatus('', clBlack, False);
|
||||
AddStatus('', clBlack, False);
|
||||
AddStatus('- - - - -', clBlack, False);
|
||||
|
@ -230,7 +256,6 @@ begin
|
|||
// ... then upload ...
|
||||
ggeAll.Progress := 0;
|
||||
ggeItem.Progress := 0;
|
||||
Screen.Cursor := crAppStart;
|
||||
InstallFTP(ChosenMod, eOS);
|
||||
end
|
||||
else if jplWizard.ActivePage = jspInstallProgress then
|
||||
|
@ -467,6 +492,7 @@ begin
|
|||
txtPassword.Enabled := False;
|
||||
chkPassive.Enabled := False;
|
||||
cmdConnect.Caption := 'Connecting...';
|
||||
cmdCancel.Caption := '&Cancel';
|
||||
// ... set values ...
|
||||
IdFTP.Host := txtHost.Text;
|
||||
IdFTP.Port := StrToInt(txtPort.Text);
|
||||
|
@ -487,6 +513,7 @@ begin
|
|||
trvDirectories.Enabled := True;
|
||||
cmdConnect.Enabled := True;
|
||||
cmdConnect.Caption := 'Disconnect';
|
||||
cmdCancel.Caption := '&Close';
|
||||
|
||||
CurNode := nil;
|
||||
if eStr.Count <> 0 then begin
|
||||
|
@ -508,6 +535,7 @@ begin
|
|||
CurNode.Expand(False);
|
||||
except
|
||||
on E: Exception do begin
|
||||
Screen.Cursor := crDefault;
|
||||
// reset button properties
|
||||
cmdConnect.Enabled := True;
|
||||
txtHost.Enabled := True;
|
||||
|
@ -518,6 +546,11 @@ begin
|
|||
cmdProxySettings.Enabled := True;
|
||||
cmdNext.Enabled := False;
|
||||
cmdConnect.Caption := 'Connect';
|
||||
cmdCancel.Caption := '&Cancel';
|
||||
if Cancel then begin
|
||||
Cancel := False;
|
||||
exit;
|
||||
end;
|
||||
// analyze messages
|
||||
if Pos('Login incorrect.', E.Message) <> 0 then begin // login failed
|
||||
MessageBox(Handle, 'Login incorrect. Check your FTP settings and try again.', PChar(Application.Title), MB_ICONWARNING);
|
||||
|
@ -541,11 +574,11 @@ begin
|
|||
end
|
||||
else
|
||||
MessageBox(Handle, PChar(E.Message), PChar(Application.Title), MB_ICONWARNING); // unknown error
|
||||
|
||||
// ... connect failed, leave procedure ...
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
Screen.Cursor := crDefault;
|
||||
end
|
||||
else begin
|
||||
|
@ -561,6 +594,7 @@ begin
|
|||
txtPassword.Enabled := True;
|
||||
chkPassive.Enabled := True;
|
||||
cmdConnect.Caption := 'Connect';
|
||||
cmdCancel.Caption := '&Close';
|
||||
cmdNext.Enabled := False;
|
||||
Screen.Cursor := crDefault;
|
||||
end;
|
||||
|
@ -747,4 +781,9 @@ begin
|
|||
Node.SelectedIndex := 0;
|
||||
end;
|
||||
|
||||
procedure TfrmMain.jspFTPShow(Sender: TObject);
|
||||
begin
|
||||
Cancel := False;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
|
Loading…
Reference in New Issue
Block a user